[rrd-developers] Display Graph - RRDTool and Perl
ManishRoy
roymanish1982 at gmail.com
Tue Jun 17 06:41:53 CEST 2008
Hi,
I am new bee in RRD. i am trying to create a graph.
my code is:
Create RRD File
#!usr\bin\perl
use RRDs;
#
# Create Database
#
$db = "/tmp/RRDDemo/RRDData.rrd";
print "--------------- DB Created Start \n ";
RRDs::create
(
$db,
"--step=300",
"DS:in:COUNTER:320:U:U",
"DS:out:COUNTER:320:0:U:U",
"RRA:AVERAGE:0.5:1:288",
"RRA:AVERAGE:0.5:12:168",
"RRA:MIN:0.5:12:168",
"RRA:MAX:0.5:12:168",
);
print RRDs::error();
print "\n--------------- DB Ends Start ";
Update RRD
#!usr\bin\perl
use RRDs;
#
# Update Database
#
$db = "/tmp/RRDDemo/RRDData.rrd";
print "--------- DB UpdationStarts-------\n";
$currtime=time();
$time=time()+100;
$value=100;
$value1= $value + 10;
RRDs::update($db,"$time:$currtime:$value1");
#RRDs::update($db,"$time:$value1");
print RRDs::error(),"\n";
print "--------- DB UpdationStarts-------";
Create Graph
#!usr\bin\perl
use RRDs;
#
# Graph Creation
#
$time = 1213621589-100;
$time1= time();
RRDs::graph
(
"/tmp/RRDDemo/INOUTGraph.png",
"--title=In-Out Data",
"--vertical-label=Value",
"--lower-limit=0",
"DEF:a=/tmp/RRDDemo/RRDData.rrd:in:AVERAGE",
"DEF:b=/tmp/RRDDemo/RRDData.rrd:in:MAX",
"AREA:a#00ff00:Incoming",
"LINE1:b#ff0000:Max Incoming",
);
print RRDs::error();
I am not able to generate graph .
Can anly one plz hel me out
--
View this message in context: http://www.nabble.com/Display-Graph---RRDTool-and-Perl-tp17878015p17878015.html
Sent from the RRDTool - Dev mailing list archive at Nabble.com.
More information about the rrd-developers
mailing list