[rrd-users] Trying to do something simple and it ends up being hard :\
David OBrien
dgobrien at gmail.com
Wed Mar 9 18:13:49 CET 2011
I created a rrd file using:
if (! -e "$rrd/mysql.rrd")
{
print "creating rrd database for mysql...\n";
RRDs::create "$rrd/mysql.rrd",
"-s 60",
"DS:queries:COUNTER:60:0:12500000",
"DS:datain:DERIVE:60:0:12500000",
"DS:dataout:DERIVE:60:0:12500000",
"RRA:LAST:0.5:1:9999",
"RRA:AVERAGE:0.5:1:576",
"RRA:AVERAGE:0.5:6:672",
"RRA:AVERAGE:0.5:24:732",
"RRA:AVERAGE:0.5:144:1460";
}
I am populating it using this:
for i in `mysql -e 'show status'|grep Innodb_rows_|grep ted|cut -f 2`
do
sum=`expr $sum + $i`
done
rrdtool update mysql.rrd N:$sum:0:0
root at main [/home/dgobrien/public_html/collector]# ./net.sh
rrdtool update mysql.rrd N:271801:0:0
1081x197
root at main [/home/dgobrien/public_html/collector]# ./net.sh
rrdtool update mysql.rrd N:271807:0:0
the counter is incrementing and the script runs thru cron once a minute
I am graphing using this:
DATE=`date +%Y%m%d`
rrdtool graph mysqlstats_$DATE.png --width=1000 --height=125 \
-l 0 -X 0 --color CANVAS#000000 --color GRID#888888 --color
SHADEA#FFFFFF --color SHADEB#FFFFFF --color BACK#FFFFFF --color MGRID#BBBBBB
\
DEF:mysql=mysql.rrd:queries:AVERAGE \
AREA:mysql#337722:"Queries\:" \
GPRINT:mysql:MAX:" Max\\: %5.1lf %s" \
GPRINT:mysql:AVERAGE:" Avg\\: %5.1lf %S" \
GPRINT:mysql:LAST:" Current\\: %5.1lf %S"
but the graph always says "nan" and no values show up
I tried with both DERIVE and COUNTER
http://duelingelectrons.com/collector/
can anyone assist me in figuring this out?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20110309/827bca31/attachment.htm
More information about the rrd-users
mailing list