[rrd-users] Help - probably a really stupid mistake somewhere ...
Philip Peake
philip at vogon.net
Tue Aug 17 20:23:05 CEST 2010
I am trying to get my first RDD database going.
I think that I understand the doc/tutorial, so tried a really simple
example.
The database:
rrdtool create test.rrd --start N --step 5 DS:value:GAUGE:5:-1:101
RRA:AVERAGE:0.5:1:12
What I think this does:
* Creates a database called test.rrd (it does).
* Has a step time of 5 seconds (don't want to wait forever to see data).
* Starts from "now".
* Has a single data source called "value", which is a GUAGE (keeps
the value presented)
* Data must be greater than -1 and less than 101
* Has a single value stored, which is the AVERAGE of one "record",
so will be equivalent to the value stored.
* Keeps 12 x 5 = 60 seconds of data.
My data producer:
#!/usr/bin/perl
my $random_number;
while (sleep(5)) {
$random_number = rand(100);
print "Adding $random_number\n";
@cmd = ("rrdtool", "update", "test.rrd", "N:$random_number");
system(@cmd) == 0 or die "Failed: $?";
}
Once every 5 seconds call "rddtool update test.rrd N:<random number in
range 0 to 100>"
The database does change after each update.
My graph:
rrdtool graph mygraph.png -a PNG --start -240 --title="Test"
--vertical-label="Random"\
'DEF:v1=test.rrd:value:AVERAGE' 'LINE1:v1#0400ff:Rnd Value'
What it produces:
Database doesn't seem to be getting the values:
$ rrdtool fetch test.rrd AVERAGE -s -30
value
1282069345: nan
1282069350: nan
1282069355: nan
1282069360: nan
1282069365: nan
1282069370: nan
1282069375: nan
I am obviously doing something wrong ... but what???
Any help appreciated.
Philip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20100817/cd51e0ae/attachment-0001.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mygraph.png
Type: image/png
Size: 9412 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/rrd-users/attachments/20100817/cd51e0ae/attachment-0001.png
More information about the rrd-users
mailing list