[rrd-users] more GPRINT problems ... numbers in legend are not right

Alan McKay alan.mckay at gmail.com
Sat Mar 30 13:37:29 CET 2013


Hi again folks,

I've got things mostly working now but there is an error in my legend.
  And I'm just not sure why.

You can see I have defined my RRD with no consolidation :

rrdtool create speedtest.rrd --step=1800 --start 1364646481
DS:500:GAUGE:1800:0:55 DS:1000:GAUGE:1800:0:55 DS:1500:GAUGE:1800:0:55
DS:2000:GAUGE:1800:0:55 DS:2500:GAUGE:1800:0:55
DS:3000:GAUGE:1800:0:55 DS:3500:GAUGE:1800:0:55
DS:4000:GAUGE:1800:0:55 DS:ping:GAUGE:1800:1:U RRA:AVERAGE:0.5:1:17520


Here : RRA:AVERAGE:0.5:1:17520

So according to the RRD Tool example there is no averaging taking
place because of the 1, so I should just get my original numbers back.

And I do get them back on my graph, but for some reason when I try to
stick that number in my legend it is not correct.  You can see my
graph here :

http://108.162.170.186/speedtest/

And I created it like this :

rrdtool graph /var/www/speedtest/downloadday.png  --start -1d --end
now --slope-mode --title 'speedtest.teksavvy.com_download_speed' -w
600 -h 200 --alt-autoscale-max --lower-limit 0 --vertical-label Mbps
DEF:my500=/var/log/speedtest/speedtest.rrd:500:AVERAGE
LINE1:my500#aa00aa:500 COMMENT:Current GPRINT:my500:AVERAGE:%6.2lf%s
DEF:my1000=/var/log/speedtest/speedtest.rrd:1000:AVERAGE
LINE1:my1000#FF0000:1000 COMMENT:Current
GPRINT:my1000:AVERAGE:%6.2lf%s
DEF:my1500=/var/log/speedtest/speedtest.rrd:1500:AVERAGE
LINE1:my1500#00FF00:1500 COMMENT:Current
GPRINT:my1500:AVERAGE:%6.2lf%s COMMENT:\j
DEF:my2000=/var/log/speedtest/speedtest.rrd:2000:AVERAGE
LINE1:my2000#0000FF:2000 COMMENT:Current
GPRINT:my2000:AVERAGE:%6.2lf%s
DEF:my2500=/var/log/speedtest/speedtest.rrd:2500:AVERAGE
LINE1:my2500#FFFF00:2500 COMMENT:Current
GPRINT:my2500:AVERAGE:%6.2lf%s
DEF:my3000=/var/log/speedtest/speedtest.rrd:3000:AVERAGE
LINE1:my3000#00FFFF:3000 COMMENT:Current
GPRINT:my3000:AVERAGE:%6.2lf%s COMMENT:\j
DEF:my3500=/var/log/speedtest/speedtest.rrd:3500:AVERAGE
LINE1:my3500#FF00FF:3500 COMMENT:Current
GPRINT:my3500:AVERAGE:%6.2lf%s
DEF:my4000=/var/log/speedtest/speedtest.rrd:4000:AVERAGE
LINE1:my4000#C0C0C0:4000 COMMENT:Current
GPRINT:my4000:AVERAGE:%6.2lf%s
CDEF:myavg=my500,my1000,my1500,my2000,my2500,my3000,my3500,my4000,8,AVG
LINE2:myavg#000000:Average COMMENT:Current
GPRINT:myavg:AVERAGE:%6.2lf%s\j HRULE:28#000000:Advertised
COMMENT:28\l

And if we just look at one value at a time, for example my average of
all the other values.

CDEF:myavg=my500,my1000,my1500,my2000,my2500,my3000,my3500,my4000,8,AVG
LINE2:myavg#000000:Average COMMENT:Current
GPRINT:myavg:AVERAGE:%6.2lf%s\j

My CDEF statement computes it into the variable 'myavg' which I put on
the graph with LINE2 as you see.   But I want to just print the value
and because of the problem I reported in an earlier thread, GPRINT is
forcing me to use a consolidation function which I have a feeling is
what is making it output the wrong value.   I don't want to print a
consolidated value I just want the value.

And the same goes for the other values I pull out of the RRD file
directly - since my RRD does not have any consolidation taking place I
just want to deal with the value itself and just want to print the
value.

I've seen other code do this so what am I doing wrong?

thanks,
-Alan




-- 
“Don't eat anything you've ever seen advertised on TV”
         - Michael Pollan, author of "In Defense of Food"



More information about the rrd-users mailing list