[rrd-users] What am I doing wrong?

Dean Takemori dtakemori at home.comtelhi.com
Tue Oct 14 21:04:02 MEST 2003


Hello,

I've just started to use RRD, but am stumped.  I cannot seem to get  
values into the
RRA files.  I'm using the following perl code snippits.  But, when I  
run rrdtool fetch
on the updated RRA file, it's just full of nan's.  The print statements  
seem to tell
me that I'm putting in valid numbers.

What am I doing wrong?


#!/usr/bin/perl -w

use constant START => 1059732001;
use constant RRDMESS => "test.rrd";
use constant RRADAY  => "RRA:MAX:0:1:2016";
use constant RRAWEEK => "RRA:MAX:0:2:4032";
use constant RRAMONTH => "RRA:MAX:0:8:8064";
use constant RRADAYAVE  => "RRA:AVERAGE:0:1:2016";
use constant RRAWEEKAVE => "RRA:AVERAGE:0:2:4032";
use constant RRAMONTHAVE => "RRA:AVERAGE:0:8:8064";

use RRDs;

my $START = START;

unlink(RRDMESS);
######################################################################## 
######
RRDs::create(RRDMESS, "-b $START", "-s 290",
              "DS:deleted:GAUGE:300:0:U",
              "DS:new:GAUGE:300:0:U",
              "DS:pending:GAUGE:300:0:U",
              "DS:saved:GAUGE:300:0:U",
              RRADAY, RRAWEEK, RRAMONTH,
              RRADAYAVE, RRAWEEKAVE, RRAMONTHAVE);
my $ERR = RRDs::error;
if ($ERR) { die("Unable to create test: $ERR"); }

[snip]

foreach my $v ( @foo )
   {
     print("$v->{'timestamp'}:$v->{'var'}:20:3:18\n");
     RRDs::update(RRDMESS, "$v->{'timestamp'}:$v->{'var'}:20:3:18");
   }


Script output is similar to ...
1060853966:10000:20:3:18
1060855893:0:20:3:18
1060856042:10000:20:3:18
1060856255:10000:20:3:18
...


And rrdtool fetch (MAX or AVERAGE) output is like
1066071320: nan nan nan nan
1066071610: nan nan nan nan
1066071900: nan nan nan nan
1066072190: nan nan nan nan
...



--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list