[rrd-users] IMAGE for RRDTOOL
Edgardo Mina
edgardo at staff.singnet.com.sg
Thu Nov 7 09:18:24 MET 2002
Hi RRD Gurus,
i am new to rrdtool, and i am trying to create a perl/cgi script that will
output graph on the ply of the rrd file but i am getting an error, i am
using a solaris 8 and my script is like this :
#!/usr/bin/perl
use CGI;
$query = new CGI;
require "/data/home/stix/bin/config.inc";
@array = split (/&/,$ENV{'QUERY_STRING'});
for $array (@array)
{
$array =~ tr/+/ /;
($name,$value) = split (/=/,$array);
$name =~ s/%([\dA-Fa-f]{2})/pack("C",hex($1))/ge;
$value =~ s/%([\dA-Fa-f]{2})/pack("C",hex($1))/ge;
$form{$name} = $value;
$ipaddress = $form{ipaddress};
}
$ipaddress = "202.160.250.34";
print $query->header(-type=>'image/png');
system ("rrdtool graph - --start=-86400 --title='AboveNet' \\
--height=135 --width=500 --vertical-label='Round Trip Time' --imgformat=PNG \\
DEF:min='$rradir/$ipaddress.rrd':min:AVERAGE \\
DEF:ave='$rradir/$ipaddress.rrd':ave:AVERAGE \\
DEF:max='$rradir/$ipaddress.rrd':max:AVERAGE \\
AREA:ave#00FF00:'Average' \\
GPRINT:ave:LAST:' \\:%8.2lf msec %s' \\
LINE1:min#FF0000:'Minimum' \\
GPRINT:min:LAST:' \\:%8.2lf msec %s' \\
LINE1:max#0000FF:'Maximum' \\
GPRINT:max:LAST:' \\:%8.2lf msec %s'");
am i doing something wrong the error message by the way was this
malformed header from script. Bad header=PNG:
/data/home/stix/web//scripts/graph.cgi
extracted from error_logs of apache
hoping from someone to response
thanks and regards,
edgardo
--
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