[rrd-users] Printing a single simple average value

Alex van den Bogaerdt alex at ergens.op.het.net
Tue Jun 17 11:23:17 CEST 2008


On Mon, Jun 16, 2008 at 01:25:04PM -0400, Ruttenberg, Tanya wrote:

> rrdtool graph - -s "midnight-6w" -e "midnight" \
> DEF:ds0=router1.rrd:ifInOctets:AVERAGE \
> VDEF:ds1=ds0,AVERAGE \
> PRINT:ds1:%20.2lf%s
> 
> At least this doesn't give me any errors, but it doesn't give me any
> output whatsoever.

Seems fine.  As the other reply indicates, indeed the problem may
be outside RRDtool.

To debug:

Alter your script so that it does create a graph.

 rrdtool graph router1_ds0.png -s "midnight-6w" -e "midnight" \
 DEF:ds0=router1.rrd:ifInOctets:AVERAGE \
 VDEF:ds1=ds0,AVERAGE \
 LINE:ds0#FF000:ds0 \
 GPRINT:ds1:%20.2lf%s

If that does result in a line resembling what you expect, and a number
in the graph, you know the RRDtool part is correct.  If not, you know
what to debug.

Then copy the GPRINT line and change GPRINT into PRINT (in the copy only),
rerun the script. RRDtool will now return the number to the caller as well
as show it on the graph.  If you cannot find it, the problem is in your
calling script, not in RRDtool (or, very unlikely, you found a bug).

As soon as it works as expected, remove LINE and GPRINT.

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



More information about the rrd-users mailing list