Overlaying Percentage

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
jeffmeden
Posts: 14
Joined: Wed Mar 10, 2004 12:55 pm
Location: Columbus, OH

Overlaying Percentage

Post by jeffmeden »

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
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

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:

Code: Select all

cdef=CURRENT_DATA_SOURCE,CURRENT_DS_MAXIMUM_VALUE,/,100,*
-Ian
jeffmeden
Posts: 14
Joined: Wed Mar 10, 2004 12:55 pm
Location: Columbus, OH

Still no good...

Post by jeffmeden »

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
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

The CURRENT_GRAPH_MAXIMUM_VALUE variables contains this data, only if you put it into the "Upper Limit" field of your graph.

-Ian
jeffmeden
Posts: 14
Joined: Wed Mar 10, 2004 12:55 pm
Location: Columbus, OH

CURRENT_GRAPH_MAXIMUM_VALUE ??

Post by jeffmeden »

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
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...
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
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Re: CURRENT_GRAPH_MAXIMUM_VALUE ??

Post by raX »

jeffmeden wrote:It works great when i replace CGMV with the actual max value of a particular graph, 1600000000, like so...
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="?

-Ian
jeffmeden
Posts: 14
Joined: Wed Mar 10, 2004 12:55 pm
Location: Columbus, OH

graph source....

Post by jeffmeden »

whats the best way to dump graph source?
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Re: graph source....

Post by raX »

jeffmeden wrote:whats the best way to dump 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.

-Ian
jeffmeden
Posts: 14
Joined: Wed Mar 10, 2004 12:55 pm
Location: Columbus, OH

Upper limit...

Post by jeffmeden »

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"
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

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
jeffmeden
Posts: 14
Joined: Wed Mar 10, 2004 12:55 pm
Location: Columbus, OH

back to the original problem

Post by jeffmeden »

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
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Re: back to the original problem

Post by raX »

jeffmeden wrote:Is there any way to get it to scale automatically *and* have a max value to use for the percentage?
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.

-Ian
jeffmeden
Posts: 14
Joined: Wed Mar 10, 2004 12:55 pm
Location: Columbus, OH

*blank stare*

Post by jeffmeden »

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?
raX
Lead Developer
Posts: 2243
Joined: Sat Oct 13, 2001 7:00 pm
Location: Carlisle, PA
Contact:

Post by raX »

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
deu439356
Cacti User
Posts: 73
Joined: Wed Aug 13, 2008 8:08 am

Re: Overlaying Percentage

Post by deu439356 »

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 Reply

Who is online

Users browsing this forum: No registered users and 2 guests