[prev in list] [next in list] [prev in thread] [next in thread]
List: rrd-users
Subject: [rrd-users] problem with rrd upadte and graph
From: mail () paeddy ! ch (Patrick Ammann)
Date: 1999-08-25 10:44:02
Message-ID: 4.1.19990825124322.00988f00 () mail ! nextra ! ch
[Download RAW message or body]
Hi,
After I spend a lot of time reading the tutorial I still have a problem. I
wrote the following script in perl which should fill the rrd Database with
some random values which should be graphed. The problem is that I can see
that the rrd database is modified but the grapher won't show me anything.
Perhaps I made only a little fault and someone could help me.
Thanks for your help in advance.
Here is the script:
#!/usr/bin/perl -w
use lib qw(/opt/apache/nextview/lib/);
use DBF;
use CFG;
use RRDs;
my ($si, $sTime, $sData);
$Step = 300;
$sPeriod = 5*24*60*60;
$sTime = time()-$Step*$sPeriod;
RRDs::create '/opt/apache/htdocs/test3.rrd', '-b', $sTime, '-s', $Step,
'DS:cpu:GAUGE:600:U:U',
'RRA:AVERAGE:0.5:1:600',
'RRA:AVERAGE:0.5:6:600',
'RRA:AVERAGE:0.5:24:600',
'RRA:AVERAGE:0.5:288:732',
'RRA:MAX:0.5:1:600',
'RRA:MAX:0.5:6:600',
'RRA:MAX:0.5:24:600',
'RRA:MAX:0.5:288:732';
die if(RRDs::error);
my $sRRDfile = '/opt/apache/htdocs/test3.rrd';
for ($si=0;$si<1000;$si++) {
$sTime = $sTime+300;
$sData = int(rand(100000));
print "$sTime:$sData\n";
RRDs::update $sRRDfile, "$sTime:$sData";
die if(RRDs::error);
}
my $sTitel = 'Test';
my $sType = 'cpu';
my $sPeriod = 24*60*60;
my $sPNGfile = '/opt/apache/htdocs/test3.png';
my $sFeedback = DBF::colGraphRRD($sRRDfile, $sPNGfile,
$sPeriod, $sTitel, $sType);
print "The feedback was $sFeedback\n";
exit;
Patrick Ammann
,_, mail at paeddy.ch
(O,O) http://www.paeddy.ch
( )
-"-"-------------------------------------------------------------
--
* To unsubscribe from the rrd-users mailing list, send a message with the
subject: unsubscribe to rrd-users-request at list.ee.ethz.ch
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic