[rrd-users] FW: Graph help Plz

Robert Davis robertd at msicc.com
Thu Apr 19 23:39:14 MEST 2001

-----Original Message-----
From: 	Robert Davis  
Sent:	Thursday, April 19, 2001 4:37 PM
To:	'rrd-users'
Subject:	Graph help Plz

Hello all,

I have been looking at RRDTool for about a week now.  I am running rrdtool
and perl on a windows 2000 advanced server machine.   I have created a rrd
database that I have similated data going into for  a day now.  I have
written a script that similates data input into the database by a router
with the fields of input bytes, and output bytes.  I have also wriiten a
Perl/CGI script using the perl-shared module, and it creates the graph just
fine, but there is no data on the graph. I have poured over the mail-list
archives and have read everything I can find on RRDTool, but I can't seem to
isolate the problem.  

Here is my Simulator code:
use RRDs;	
$c = "4";
$sleep_time = "5";
($a, $b) = split(/\./,$int);
$in = $a;
$devname = "Internet";
$rrdfile = "C:\\Inetpub\\rddsite\\www\\cgi-bin\\$devname.rrd";
print "Deamonizing Script...\n";
while( $c eq "4") {

$last = RRDs::last ("$rrdfile");
my $ERR=RRDs::error;
#die "Error while retrieving last update on $rrdfile -- $ERR\n" if $ERR;

if ($ERR) 
my $t = time();				
$ERR = undef;
RRDs::create ("$rrdfile", "-b", "$t", "-s", "5",
"DS:int1in:ABSOLUTE:600:0:193000", "DS:int1out:ABSOLUTE:600:0:193000",
my $ERR1=RRDs::error; die "\$ERR1 -- Error while creating $rrdfile --
$ERR1\n" if $ERR1; print "Created $rrdfile\n";
#RRDs::update ("$rrdfile", "$t:$r");
#my $ERR2=RRDs::error;
#die "\$ERR2 -- Error while updating $rrdfile -- $ERR2\n" if $ERR2;
my ($t, $r, $r2, $a, $b, $c, $d, $temp, $temp2);
($a, $b) = split(/\./,$temp);
($c, $d) = split(/\./,$temp2);
$r = $a;
$r2 = $c;
print "TIME:IN:OUT = $t:$r:$r2\n";
RRDs::update ("$rrdfile", "$t:$r:$r2");
my $ERR3=RRDs::error;
die "\$ERR3 -- Error while updating $rrdfile -- $ERR3\n" if $ERR3;

print "sleeping for $sleep_time seconds...\n";
sleep ($sleep_time);


I know this is very badly written code, but I did it in about 5 min in a
rush.  As you can see I simulate data form a router interface by rand number
generation and dropping everything after the decimal for simplicity.  I feed
that number and the current time stamp into the Rrd database every 5 min.
Now here is the code for my cgi page.  Again I know this is bad coding on
this one, but I am just learning and the code is a work in progress.

print "Content-type:text/html\n\n";
use RRDs;

print <<EOF1;

$fixed = 768000;
$et = (time()-300);
$st = ($et - 900);
$limit = 1536000;
print "<p>START:END  $st:$et</p>\n";
print "<p>$basepath$rrdfile</p>\n";
print "<p>\n";

RRDs::graph ("$device.png",
"-t", "Internet Connection",
"-e", "$et", "-s", "$st",
my $ERR=RRDs::error;
print $ERR;
die "Error while creating graph -- $ERR\n" if $ERR;

print "<IMG src='$device.png'>\n";
print "</p>\n";
print "</body>\n";
print "</html>";



I have run tests and can confirm the cgi is seeing the database, and is able
to open it.  Also, the graph is created, but no data is graphed on it.  What
is the problem?  Can anyone see a mistake that I am overlooking?  I would
appreciate any assistance that can be provided.

Thank You,
Robert H. Davis II
Telecom Analyst
MSI Network Services, Ltd.
robertd at msicc.com


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