[rrd-users] absolute and relative graphing of the same value

Alex van den Bogaerdt alex at ergens.op.het.net
Wed Jul 9 02:37:41 CEST 2008


On Tue, Jul 08, 2008 at 06:13:58PM +0200, Karl Fischer wrote:

> Here's the diskspace example - this doesn't always do what I want ...
> 
> --title=Used Disk Space - delta in Bytes/h
> DEF:dfUsed=Space.rrd:dfUsed:LAST
> CDEF:Btime=dfUsed,POP,TIME
> CDEF:Btdiff=dfUsed,POP,TIME,PREV(Btime),-
> CDEF:prev=PREV(dfUsed)
> CDEF:delta=dfUsed,prev,-,Btdiff,/,3600,*
> AREA:delta#7777ff
> 
> It seems to have some erratic behavior when changing the start/end time of the
> graph and therefore the scale ...
> 
> Any hints for me?

That "3600" is the amount of time per CDP entry.  If you let RRDtool
choose which RRA to use, it may very well choose another RRA than the
one containing 3600 seconds per entry.

I always recommend:

1: Know which RRA you want to use (e.g. the one with 3600 seconds per CDP)
2: adjust your end time so that it matches the RRA:
   endtime=int(endtime/3600)*3600
3: compute start time from the width of the graph in pixels:
   starttime=endtime-width*3600
   (if widht==400, that's 400 hours. Actually any whole number of hours
   will do, as long as 400 can be integer divided by that number)
4: check that you actually have enough rows in your RRA

Now when you run rrdtool with these parameters, you know for sure which
RRA is going to be used, and now you can use "3600" in your script.

You also know how many hours are on the graph, so you can multiply the
average rate by the number of hours to get an accurate number of bytes
transfered.

-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/



More information about the rrd-users mailing list