[rrd-users] Re: RRD Fetch always shows Nan

Alex van den Bogaerdt alex at ergens.op.het.net
Thu Oct 10 11:16:40 MEST 2002

On Thu, Oct 10, 2002 at 09:51:35AM +0100, Phil.Daws at daimlerchryslerservices-it.co.uk wrote:

> We have some historic data that we want to add into RRD .... The format of the
> data is as follows :
> 01 Oct 2002 08:16:43 23364 Login
> 01 Oct 2002 08:21:32 12067 Login
> The script I am using to populate is detailed below, but when I fetch the data
> back it always shows as NaN ... Cannot work out what I am doing wrong ?

In your script:  generate a log file of commands you execute
(or: would like to execute).

Then use this file to debug the update process step by step.

>         my ($day,$month,$year,$time,$response,$type) = split (" ",$_);
>         if ($type =~ /Login/ && $response > 0) {
>                 $date=&ParseDateString("$day $month $year $time");
>                 $epoch=&UnixDate($date,"%s");
>                 $response=int($response);

It seems as if "epoch" becomes 1009839600 and similar.
"response" becomes 23364.  At least, that's what it looks
like to me.  Verify this.

>                 printf("%s %s\n",$epoch,$response);

Why not do: printf("rrdtool update %s %s:%s\n",$rrd,$epoch,$response);

>  RRDs::update("$rrd","$epoch:$response");
>  my $e = RRDs::error();
>  die "ERROR: Cannot update $rrd with '$epoch:$response' $e\n" if $e;

Not sure if this will report a logical error.  It will report a hard
error such as "file not found" et al.

Create the database by hand and then update using the printf()ed
commands.  After each update, check using rrdtool info.  Maybe even
do a rrdtool dump and check its contents (your fetch command may
be wrong !!!)


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