[rrd-users] Printing a single simple average value

Ruttenberg, Tanya Tanya.Ruttenberg at ssa.gov
Tue Jun 17 13:06:53 CEST 2008


Thanks Alex!  It seems that the only difference between mine and yours
was you specified an output file.  Here's the final that worked

rrdtool graph /tmp/file.png -s "now-6 weeks" -e "now" \
DEF:ds0=router1.rrd:ifInOctets:AVERAGE \
VDEF:ds1=ds0,AVERAGE \
PRINT:ds1:%20.2lf%s

Yup. That's the only difference. Shrug.


-----Original Message-----
From: rrd-users-bounces at lists.oetiker.ch
[mailto:rrd-users-bounces at lists.oetiker.ch] On Behalf Of Alex van den
Bogaerdt
Sent: Tuesday, June 17, 2008 5:23 AM
To: rrd-users at lists.oetiker.ch
Subject: Re: [rrd-users] Printing a single simple average value

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/

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



More information about the rrd-users mailing list