absolute and relative graphing of the same value

View: New views
2 Messages — Rating Filter:   Alert me  

absolute and relative graphing of the same value

by Karl Fischer-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Dear all,

I'm looking for a way to display a value in two ways without recording it twice:

Lets say I'm monitoring a typical GAUGE value like diskspace or temperature.

Now I want do display the temperature as an absolute value (=> GAUGE => 25C) *and*
I want to display (in another grapgh) the change rate (eg. +3C/h), which would
be a typical DERIVE application ...

I tried to use GAUGE and operate with rpn PREV, but since the temporary step-size
varys when graphing, I wasn't very lucky in calculating the right numbers ...

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?

Thanks

- Karl

_______________________________________________
rrd-users mailing list
rrd-users@...
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users

Re: absolute and relative graphing of the same value

by Alex van den Bogaerdt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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/

_______________________________________________
rrd-users mailing list
rrd-users@...
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
LightInTheBox - Buy quality products at wholesale price