[rrd-users] How to add an AVERAGE line on graph

Lewis Getschel lgetschel at denver.westerngeco.slb.com
Mon Oct 31 18:56:41 MET 2005


All-
     I'm a newbie with rrdtool, using cgi scripts I received from 
another of our offices.
The graphs of the data are fine, but I've been asked to add a line 
showing the current AVERAGE. (a simple horizontal line at the "current 
graph average" (ie 24)
The definitions below draw the graph fine, and display the max, average, 
and current values itself. I've tried searching archives, google and my 
last few months of this list, but can't find a way to add a line for the 
average. The last line of below ('LINE2:A#FF00FF:') displays the average 
value of the data at that collection time.
I suspect that if I could figure out the correct 'term' to use, I'd 
solve this easily.
I can make a constant line with 'LINE2:24#FF00FF:' , but all my attempts 
at replacing the 24 with an average have failed.

Could someone please tell me how I can accomplish what I want?
Thanks, -Lewis


<RRD::GRAPH
    /usr/local/mrtg/html/cluster/cluster1d0.gif
    --rigid
    --lower-limit 0
    --upper-limit 100
    --start -1d --end now-10min
    --vertical-label "Cluster Utilization"
    --height 150
    --width 500
    --lazy
    --title "Total cluster cpu utilization (5 Minutes Average)"
    --imginfo '<IMG SRC=/mrtg/html/cluster/%s WIDTH=%lu HEIGHT=%lu >'
              
'DEF:A=/usr/local/mrtg/html/cluster/totalcluster.rrd:ds0:AVERAGE'
              'DEF:B=/usr/local/mrtg/html/cluster/totalidle.rrd:ds0:AVERAGE'
              'DEF:C=/usr/local/mrtg/html/cluster/totalidle.rrd:ds1:AVERAGE'
              'CDEF:D=A,UN,0,A,IF'
              'CDEF:E=B,UN,0,B,IF'
              'CDEF:F=C,UN,0,C,IF'
              'CDEF:G=100,E,E,F,+,/,*'
              'AREA:D#0000FF:Total CPU Utilization'
              'GPRINT:D:MAX:Max %.1lf%s'
              'GPRINT:D:AVERAGE:AVG %.1lf%s'
              'GPRINT:D:LAST:Current %.1lf%s\j'
              'LINE2:G#FF0000:Percentage of nodes allocated    '
              'GPRINT:G:MAX:Max %.1lf%s'
              'GPRINT:G:AVERAGE:AVG %.1lf%s'
              'GPRINT:G:LAST:Current %.1lf%s\j'
'LINE2:A#FF00FF:'
 >

-- 
Lewis Getschel


--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://lists.ee.ethz.ch/rrd-users
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the rrd-users mailing list