[rrd-users] Re: Printing data out under the graph with VDEF

Alex van den Bogaerdt alex at ergens.op.het.net
Sat Nov 11 15:02:22 MET 2006


On Sat, Nov 11, 2006 at 05:21:01PM +1100, Rob Conway wrote:
> 1./  My question is when I print the AVERAGE out at the bottom of my graph is this the average for the time scale of the graph ?   VDEF:DEGCavg=degc1,AVERAGE GPRINT:DEGCavg:"avg=%3.1lf%s" \       -see full code below
>  
>   ## Aquarium Temperature GRAPH ##
>   rrdtool graph /website/degc1d.png --start e-1d --end NOW \
>   --upper-limit 32 --lower-limit 10 --rigid  --slope-mode \
>   --width 402 --height 200 --title "Temperature" \
>   --vertical-label "Degrees C" --interlaced \
>   DEF:degc1=/public/aquadegc.rrd:degc:AVERAGE LINE1:degc1#222222:"Aquarium=" \
>   VDEF:DEGClast=degc1,LAST GPRINT:DEGClast:"%3.1lf%s" \
>   VDEF:DEGCavg=degc1,AVERAGE GPRINT:DEGCavg:"avg=%3.1lf%s" \

degc1 contains a series of averages already (DEF:...:AVERAGE).
These averages are then averaged into one rate (VDEF:...AVERAGE).

> 2/ IN antoher graph I am calculating MAX values every hour and day.  Is it possible to print the maximum for that day out on the bottom of the graph when the time scale of the graph could be 1 week ?  Does MAX work with VDEF ?

Two questions.  "Does MAX work with VDEF?": yes, it does, but it is
spelled "MAXIMUM".  Is this the reason you asked this question?

The other part is a bit more complicated.  You can print anything
you like, so I could answer "yes". But you want to know how to get
those values, and I don't think you can get them in one script.

Theoretically you could create several DEFs:
DEF:day1=...:start=...:end=...
DEF:day2=...:start=...:end=...
...
DEF:day7=...:start=...:end=...

I'm not sure what happens if these DEFs all use the same data source.
It could be that this will confuse the tool.

Another problem could be your dataresolution.  If the data needs to
be made to fit on the graph, rrdtool will possibly loose some resolution.
You will then get the maximum of "on screen" data.

To work around both (possible!) problems, you could always generate these
numbers outside your graph script.  Use "rrdtool graph" to do so, but use
PRINT statements to get the numbers in a variable.  Use this variable in
the real graph script which then processes it as normal text.

Also you need to be aware that:

DEF:x=...:AVERAGE VDEF:y=x,MAXIMUM
and
DEF:x=...:MAX VDEF:y=x,MAXIMUM
may result in quite different numbers.

The maximum of all average rates is quite different from the maximum
of all maxima.

rates:         10,1,2,5,4,5
consolidated1: avg(10,1) avg(2,5) avg(4,5)         DEF:...:AVERAGE
consolidated2: max(10,1) max(2,5) max(4,5)         DEF:...:MAX

max(consolidated1) = max(avg(10,1) avg(2,5) avg(4,5)) = max(5.5, 3.5, 4.5) = 5.5
max(consolidated2) = max(max(10,1) max(2,5) max(4,5)) = max(10, 5, 5) = 10

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

--
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