[rrd-users] putting values in the legend

Alan McKay alan.mckay at gmail.com
Sat Mar 30 00:05:56 CET 2013


First, thanks for all your great tools Tobi - been using MRTG in
particular for years now.

This is my first time rolling my own rrdtool graphs and in general it
has gone well and I've managed to get some nice stuff put together.
I'm graphing my internet connection speed at home.   I have different
coloured lines and it shows the colour code with the names of each one
down in the legend.   Now I want to put the current value of each in
the legend and I'm having all sorts of issues.

Here is how I define my RRD - basically I define a bunch of variables
500,1000,1500, up to 4000.  These coorespond with the files that
"speedtest.net" uses for the jpg files they use to test your speed.  I
also define one for ping times as you see.

rrdtool create speedtest.rrd --step=1800 --start 1364597863
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

But when I run my script to make a graph, you see my error below.
Everything worked fine before I put in the GPRINT statement.  Just
before the first one you see the "500" which is the text which appears
down in the legend.   Well I want the value of the variable name to
appear next to it.  The current value.

Not sure what I am doing wrong ... it seems to be telling me it wants
a consolodation function but I don't know why.   And when I give it
one it complains about RPN

root at userver:~/speedtest.net/rrd# ./rrdgraphnew.sh
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 GPRINT:my500:"%#.#lf"
DEF:my1000=/var/log/speedtest/speedtest.rrd:1000:AVERAGE
LINE1:my1000#FF0000:1000 GPRINT:my1000:"%#.#lf"
DEF:my1500=/var/log/speedtest/speedtest.rrd:1500:AVERAGE
LINE1:my1500#00FF00:1500 GPRINT:my1500:"%#.#lf"
DEF:my2000=/var/log/speedtest/speedtest.rrd:2000:AVERAGE
LINE1:my2000#0000FF:2000 GPRINT:my2000:"%#.#lf"
DEF:my2500=/var/log/speedtest/speedtest.rrd:2500:AVERAGE
LINE1:my2500#FFFF00:2500 GPRINT:my2500:"%#.#lf"
DEF:my3000=/var/log/speedtest/speedtest.rrd:3000:AVERAGE
LINE1:my3000#00FFFF:3000 GPRINT:my3000:"%#.#lf"
DEF:my3500=/var/log/speedtest/speedtest.rrd:3500:AVERAGE
LINE1:my3500#FF00FF:3500 GPRINT:my3500:"%#.#lf"
DEF:my4000=/var/log/speedtest/speedtest.rrd:4000:AVERAGE
LINE1:my4000#C0C0C0:4000 GPRINT:my4000:"%#.#lf"
CDEF:myavg=my500,my1000,my1500,my2000,my2500,my3000,my3500,my4000,8,AVG
LINE2:myavg#000000:Average HRULE:28#000000:Advertised
ERROR: Cannot parse CF in 'GPRINT:my500:"%#.#lf"'


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