[rrd-users] RRD Fetch always shows Nan

Phil.Daws at daimlerchryslerservices-it.co.uk Phil.Daws at daimlerchryslerservices-it.co.uk
Thu Oct 10 10:51:35 MEST 2002



Hi :

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 ?

Thanks

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#! /bin/perl -w
# -*- mode: Perl -*-

use Date::Manip;
use lib qw(/opt/rrdtool-1.0.33/lib/perl);
use RRDs 1.000011;

my $rrd="/portal/content/mrtg/appresponse.rrd";
my @args = ($rrd, '-b', 1009839600, '-s', 300,
                         "DS:login_uk:GAUGE:600:U:U",
                         "RRA:AVERAGE:0.5:1:600",
                         "RRA:AVERAGE:0.5:6:700",
                         "RRA:AVERAGE:0.5:24:775",
                         "RRA:AVERAGE:0.5:288:797",
                         "RRA:MAX:0.5:1:600",
                         "RRA:MAX:0.5:6:700",
                         "RRA:MAX:0.5:24:775",
                         "RRA:MAX:0.5:288:797");
RRDs::create(@args);
my $e = RRDs::error();
die "ERROR: Cannot create logfile: $e\n" if $e;

open(INFILE, "/logs/01 Oct 2002 TransactionChecks.log") or die "Cannot open
file!";
while (<INFILE>) {
        chomp;
        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);
                printf("%s %s\n",$epoch,$response);
                RRDs::update("$rrd","$epoch:$response");
                my $e = RRDs::error();
                die "ERROR: Cannot update $rrd with '$epoch:$response' $e\n" if
$e;
                };

}
close INFILE;
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------




******************************************************************************
CONFIDENTIALITY STATEMENT


This email, its content and any files transmitted with it are intended
solely for the addressee(s) and may be legally privileged and/or
confidential. Access by any other party is unauthorised without the
express written permission of the sender. If you have received this
email in error you may not copy or use the contents, attachments
or information in anyway. Please destroy it and contact the sender
on  0870 840 5000 or via email return. This email has been
prepared using information believed by the author to be reliable
and accurate, but DaimlerChrysler Services UK Ltd. makes no
warranty as to accuracy or completeness. In particular
DaimlerChrysler Services UK Ltd. does not accept responsibility for
changes made to this email after it was sent. Any opinions
expressed in this document are those of the author and do not
necessarily reflect the opinions of DaimlerChrysler Services UK Ltd,
or its affiliates. 


CONFIDENTIALITY STATEMENT
******************************************************************************

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