I'm trying to create an HRULE on one of my graphs based off of a value I'm getting from an SNMP query.
The query returns the (static) capacity of the feed for my PDUs (Server Tech Smart Sentry) What I want is to create 2 seperate HRULES, one for 50% utilization, and the other should show 80%.
I've tried using the settings for Nth percentile (|0:bits:0:current:0|) but this doesn't work.
Can someone point me in the right direction on how I need to add these 2 HRULEs? I know I could set the value, but I have different capacity (20A/30A) circuits...
Need help generating an HRULE
Moderators: Developers, Moderators
-
- Cacti User
- Posts: 101
- Joined: Tue May 24, 2005 8:46 am
- Location: Rochester, New Hampshire
- Contact:
Wouldn't you want to use a CDEF for that? Make it something like
CURRENT_DATA_SOURCE,.5,*
and
CURRENT_DATA_SOURCE,.8,*
And make the hrule use that cdef for that data source. I have actually not done anything like this, but it should make it fluid, so if for some reason your capacity changes, your hrules will change as well.
CURRENT_DATA_SOURCE,.5,*
and
CURRENT_DATA_SOURCE,.8,*
And make the hrule use that cdef for that data source. I have actually not done anything like this, but it should make it fluid, so if for some reason your capacity changes, your hrules will change as well.
-
- Posts: 5
- Joined: Fri Aug 27, 2010 4:28 pm
Tried that already-- created the CDEF
Went to the graph template and added an item
Data Source: <data template pointing to the script that polls the value>
Graph Item Type: HRULE
Consolidation Function: <tried them all>
CDEF Function: <80% CDEF as listed above>
But this results in a broken graph, debug looks like:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="cducab1-at1 - Load (Amps)" \
--base=1000 \
--height=120 \
--width=600 \
--alt-autoscale \
--vertical-label="Amps" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/html/cacti/rra/268/20908.rrd":loadAA_1x2:AVERAGE \
DEF:b="/var/www/html/cacti/rra/268/20908.rrd":loadAB_1x2:AVERAGE \
CDEF:cdefa=a,100,/ \
CDEF:cdeff=b,100,/ \
CDEF:cdefba=TIME,1283185586,GT,a,a,UN,0,a,IF,IF,TIME,1283185586,GT,b,b,UN,0,b,IF,IF,+,200,/ \
CDEF:cdefbd=TIME,1283185586,GT,a,a,UN,0,a,IF,IF,TIME,1283185586,GT,b,b,UN,0,b,IF,IF,+,100,/ \
CDEF:cdefbg=a,.8,* \
LINE1:cdefa#B90054FF:"InfeedAA\:" \
GPRINT:cdefa:MIN:" Min\:%8.2lf" \
GPRINT:cdefa:LAST:"Current\:%8.2lf" \
GPRINT:cdefa:AVERAGE:"Avg\:%8.2lf" \
GPRINT:cdefa:MAX:"Max\:%8.2lf\n" \
LINE1:cdeff#35962BFF:"InfeedAB\:" \
GPRINT:cdeff:MIN:" Min\:%8.2lf" \
GPRINT:cdeff:LAST:"Current\:%8.2lf" \
GPRINT:cdeff:AVERAGE:"Avg\:%8.2lf" \
GPRINT:cdeff:MAX:"Max\:%8.2lf\n" \
AREA:cdefba#FF00FF19:"All Infeeds\:" \
GPRINT:cdefba:AVERAGE:"Avg\:%8.2lf\n" \
COMMENT:" \n" \
GPRINT:cdefbd:LAST:"Totals\: Current Load\:%8.2lf" \
GPRINT:cdefbd:AVERAGE:"Average Load\:%8.2lf %s" \
GPRINT:cdefbd:MAX:"Maximum Load\:%8.2lf\n" \
HRULE:#FF0000FF:"80% utilization\:"
RRDTool Says:
ERROR: parameter '#FF0000FF' does not represent a number in line HRULE:#FF0000FF:80% utilization\:
Went to the graph template and added an item
Data Source: <data template pointing to the script that polls the value>
Graph Item Type: HRULE
Consolidation Function: <tried them all>
CDEF Function: <80% CDEF as listed above>
But this results in a broken graph, debug looks like:
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="cducab1-at1 - Load (Amps)" \
--base=1000 \
--height=120 \
--width=600 \
--alt-autoscale \
--vertical-label="Amps" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/var/www/html/cacti/rra/268/20908.rrd":loadAA_1x2:AVERAGE \
DEF:b="/var/www/html/cacti/rra/268/20908.rrd":loadAB_1x2:AVERAGE \
CDEF:cdefa=a,100,/ \
CDEF:cdeff=b,100,/ \
CDEF:cdefba=TIME,1283185586,GT,a,a,UN,0,a,IF,IF,TIME,1283185586,GT,b,b,UN,0,b,IF,IF,+,200,/ \
CDEF:cdefbd=TIME,1283185586,GT,a,a,UN,0,a,IF,IF,TIME,1283185586,GT,b,b,UN,0,b,IF,IF,+,100,/ \
CDEF:cdefbg=a,.8,* \
LINE1:cdefa#B90054FF:"InfeedAA\:" \
GPRINT:cdefa:MIN:" Min\:%8.2lf" \
GPRINT:cdefa:LAST:"Current\:%8.2lf" \
GPRINT:cdefa:AVERAGE:"Avg\:%8.2lf" \
GPRINT:cdefa:MAX:"Max\:%8.2lf\n" \
LINE1:cdeff#35962BFF:"InfeedAB\:" \
GPRINT:cdeff:MIN:" Min\:%8.2lf" \
GPRINT:cdeff:LAST:"Current\:%8.2lf" \
GPRINT:cdeff:AVERAGE:"Avg\:%8.2lf" \
GPRINT:cdeff:MAX:"Max\:%8.2lf\n" \
AREA:cdefba#FF00FF19:"All Infeeds\:" \
GPRINT:cdefba:AVERAGE:"Avg\:%8.2lf\n" \
COMMENT:" \n" \
GPRINT:cdefbd:LAST:"Totals\: Current Load\:%8.2lf" \
GPRINT:cdefbd:AVERAGE:"Average Load\:%8.2lf %s" \
GPRINT:cdefbd:MAX:"Maximum Load\:%8.2lf\n" \
HRULE:#FF0000FF:"80% utilization\:"
RRDTool Says:
ERROR: parameter '#FF0000FF' does not represent a number in line HRULE:#FF0000FF:80% utilization\:
Who is online
Users browsing this forum: No registered users and 3 guests