[rrd-users] Re: rrd - graphing data along with trend

Serge Maandag serge.maandag at staff.zeelandnet.nl
Thu Apr 1 21:14:18 MEST 2004


> now i want to show a graph for several monthes which shows 
> one line of actual polls (consolidated by average) , and a 
> second line within the graph that shows the average per each 
> month (the average on each month is the same all month 
> long...) from that second line, i should be able to determine 
> the trend .
>  
> how can that second line be defined (if at all) ??
> any kind of idea would help.

First, to get the average:
Prior to graphing yu could do a `rrdtool fetch` on the rrd and
Calculate the average yourself or you could do a `rrdtoolgraph`
In which you leave out all the line, stack and area statements.
You just simply print out the average with the PRINT statement.
You can grab that value as rrdtool prints it to stdout.

Secondly you do your graph statement and you insert the line as
a HLINE or as an AREA.
If you insert it as an area, you just make a cdef that has the
Same value for the entire period. You need to use a DEFined value
In each cdef, but a trick is to multiply that by zero and to add 
your value. Sounds harder than it is:

$myavg = `script that gives you the average for the period`

DEF:bla=/my.rrd:ds0:AVERAGE
CDEF:avg=bla,0,*,$myavg,+
AREA:avg

Gives you a line over the entire graph having the value $myavg.
I tend to use AREA's i.s.o. HLINES, since the latter ones can 
Be outside the scale of the y-axis.

Perhaps this all is much easier with the newer VDEF's, try google..

Serge.

-------------
Op de inhoud van dit e-mailbericht en de daaraan gehechte bijlagen is de inhoud van de volgende disclaimer van toepassing: http://www.zeelandnet.nl/disclaimer.php

--
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://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list