Overlaying Percentage
Moderators: Developers, Moderators
Overlaying Percentage
I couldn't find this detailed anywhere, and have spent a good bit of time trying to wrestle cacti into doing it. Basically, I need to include the Inode data from the ucd-snmp query in the graph of hard disk utilization, and this number only comes in % form, 0-100. I have attempted to make a cdef to do the graphing on the same template as the partition size info, with the function
cdef=CURRENT_DATA_SOURCE,CURRENT_GRAPH_MAXIMUM_VALUE,100,/,*
I suspect the value for CURRENT_GRAPH_MAXIMUM_VALUE is not what I expect, what can I use as a variable to get the desired effect? When i statically set the value to 1.6B it works great... Any advice is appreciated. Thanks!
Jeff
cdef=CURRENT_DATA_SOURCE,CURRENT_GRAPH_MAXIMUM_VALUE,100,/,*
I suspect the value for CURRENT_GRAPH_MAXIMUM_VALUE is not what I expect, what can I use as a variable to get the desired effect? When i statically set the value to 1.6B it works great... Any advice is appreciated. Thanks!
Jeff
I have a feeling that the variable you are looking for is CURRENT_DS_MAXIMUM_VALUE. The variable CURRENT_GRAPH_MAXIMUM_VALUE (upper limit) is set to '100' by default on all graphs since most graphs use auto scale. Also, your CDEF doesn't look quite right, here's how I would do it:
-Ian
Code: Select all
cdef=CURRENT_DATA_SOURCE,CURRENT_DS_MAXIMUM_VALUE,/,100,*
Still no good...
What i'm looking for exactly is a variable that contains the height of the graph in data units, in this case its 1.6 billion, the size of a partition. That will let me figure how the other data will have to be scaled. Is there no variable that has this information?
Jeff
Jeff
CURRENT_GRAPH_MAXIMUM_VALUE ??
I dont want to seem naive but what the hex does that mean? I tried using the "Graph: Upper Limit" option which puts that CGMV variable into the CDEF, but it acted like it was 0 (or some similarly tiny number) and resulted in a flat line at the bottom of the graph. Here's what I have for a cdef maybe you can tell me what i'm doing wrong...raX wrote:The CURRENT_GRAPH_MAXIMUM_VALUE variables contains this data, only if you put it into the "Upper Limit" field of your graph.
-Ian
cdef=CURRENT_DATA_SOURCE,CURRENT_GRAPH_MAXIMUM_VALUE,100,/,*
It works great when i replace CGMV with the actual max value of a particular graph, 1600000000, like so...
cdef=CURRENT_DATA_SOURCE,1600000000,100,/,*
Thanks for your help
Jeff
Re: CURRENT_GRAPH_MAXIMUM_VALUE ??
If that's the case, then your only problem seems to be getting "CURRENT_GRAPH_MAXIMUM_VALUE" to substitute with the correct value. If you look at the graph source for this graph, what is displayed for "--upper-limit="?jeffmeden wrote:It works great when i replace CGMV with the actual max value of a particular graph, 1600000000, like so...
-Ian
graph source....
whats the best way to dump graph source?
Re: graph source....
Click on the "Graphs" tab and click on the graph you want to get the graph source for. Under the graph, click the "source" link.jeffmeden wrote:whats the best way to dump graph source?
-Ian
Upper limit...
There is none... heres the dump
/usr/local/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="charlie - Disk Space - /var" \
--rigid \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes" \
DEF:a="/usr/local/www/data-dist/rra/charlie_hdd_free_229.rrd":hdd_used:AVERAGE \
DEF:b="/usr/local/www/data-dist/rra/charlie_hdd_free_229.rrd":hdd_free:AVERAGE \
DEF:c="/usr/local/www/data-dist/rra/charlie_hdd_free_229.rrd":inode_percent:AVERAGE \
CDEF:cdefa=a,1024,* \
CDEF:cdefe=b,1024,* \
CDEF:cdefi=c,100,100,/,* \
AREA:cdefa#F51D30:"Used" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" \
STACK:cdefe#002A97:"Available" \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" \
LINE2:cdefi#7EE600:"Inode %" \
GPRINT:c:LAST:" Current\:%8.2lf %s" \
GPRINT:c:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:c:MAX:"Maximum\:%8.2lf %s\n"
/usr/local/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="charlie - Disk Space - /var" \
--rigid \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes" \
DEF:a="/usr/local/www/data-dist/rra/charlie_hdd_free_229.rrd":hdd_used:AVERAGE \
DEF:b="/usr/local/www/data-dist/rra/charlie_hdd_free_229.rrd":hdd_free:AVERAGE \
DEF:c="/usr/local/www/data-dist/rra/charlie_hdd_free_229.rrd":inode_percent:AVERAGE \
CDEF:cdefa=a,1024,* \
CDEF:cdefe=b,1024,* \
CDEF:cdefi=c,100,100,/,* \
AREA:cdefa#F51D30:"Used" \
GPRINT:cdefa:LAST:" Current\:%8.2lf %s" \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf %s\n" \
STACK:cdefe#002A97:"Available" \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" \
LINE2:cdefi#7EE600:"Inode %" \
GPRINT:c:LAST:" Current\:%8.2lf %s" \
GPRINT:c:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:c:MAX:"Maximum\:%8.2lf %s\n"
You will need to disable auto-scale to have Cacti use the upper limit on the graph. Whether auto scale is turned on or off should have no effect on the problem you are having above, but we can try turning it off for testing reasons.
If this graph uses a graph template, go into "Graph Templates", select the applicable template and uncheck "Auto Scale". If the graph is not using a graph template, go into "Graph Management" instead and do the same thing. Now, when you display the graph source, you should see --upper-limit.
-Ian
If this graph uses a graph template, go into "Graph Templates", select the applicable template and uncheck "Auto Scale". If the graph is not using a graph template, go into "Graph Management" instead and do the same thing. Now, when you display the graph source, you should see --upper-limit.
-Ian
back to the original problem
Disabling autoscale means that each graph will have to be hand-scaled, which is the problem i was trying to avoid with overlaying the percentage graph.... I'm working with the prefab ucd/net HD Space graph to do this. Is there any way to get it to scale automatically *and* have a max value to use for the percentage? This doesnt seem like it should be that uncommon or difficult, if it is i'll just go back to using two seperate graphs. Thanks for your help!
Jeff
Jeff
Re: back to the original problem
Yes, you can still provide a value for "Upper Limit" even when auto scale is turned on. RRDTool will ignore this value, but Cacti will still use the value for the CURRENT_GRAPH_MAXIMUM_VALUE variable. If you are using a template and need to edit the "Upper Limit" field on a per-graph basis, you will need to edit the template and check the "Use Per-Graph Value" box for that field.jeffmeden wrote:Is there any way to get it to scale automatically *and* have a max value to use for the percentage?
-Ian
*blank stare*
Okay, what I meant to ask was, How can I do this without having to edit every single graph by hand? I've never had a 'problem' making this work, I have only had a problem making it work like it should, as in the template will work for ANY host without having to monkey with the specific settings. It seems like the 'max value on a graph' variable shouldnt be too hard to come up with. Is it?
Well there is one thing that you can do that would make this more automatic. For instance when you create a traffic graph, the data source "Maximum Value" automatically gets filled in with the ifSpeed variable from the interface. You can easily extend this behavior to fill in the "Upper Limit" field for the graph as well.
To do this, select "Data Queries" on the menu and choose "SNMP - Interface Statistics". Now choose "In/Out Bits" or "In/Out Bytes" depending on which one you typically use. Inside the "Suggested Values" box under the "Data Template" header you want to add a new item. The first field (value) should be '|query_ifSpeed|'. The second field (field name) should be 'upper_limit'. Now click the "Add" button to the right to save this.
Now when you create a new traffic graph, the upper limit field will be automatically filled in. You should make sure that the "Use Per-Graph Value" checkbox is checked for the graph template or your precious values might get overwritten .
-Ian
To do this, select "Data Queries" on the menu and choose "SNMP - Interface Statistics". Now choose "In/Out Bits" or "In/Out Bytes" depending on which one you typically use. Inside the "Suggested Values" box under the "Data Template" header you want to add a new item. The first field (value) should be '|query_ifSpeed|'. The second field (field name) should be 'upper_limit'. Now click the "Add" button to the right to save this.
Now when you create a new traffic graph, the upper limit field will be automatically filled in. You should make sure that the "Use Per-Graph Value" checkbox is checked for the graph template or your precious values might get overwritten .
-Ian
Re: Overlaying Percentage
I think I am attempting to do the same thing, but I am not having much luck.
Post here: http://forums.cacti.net/viewtopic.php?f=21&t=46236
Post here: http://forums.cacti.net/viewtopic.php?f=21&t=46236
Who is online
Users browsing this forum: No registered users and 0 guests