GD::Graph isn't numeric etc.
From: FB (fransb_at_lumara.nl)
Date: 01/26/05
- Next message: Jay G. Scott: "Net-DHCPClient; example fails; tap.al"
- Previous message: Mike: "Re: Using Net::Telnet to connect to Perl server"
- Next in thread: Brian McCauley: "Re: GD::Graph isn't numeric etc."
- Reply: Brian McCauley: "Re: GD::Graph isn't numeric etc."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 26 Jan 2005 18:43:49 GMT
Hi,
first of all, I must be a fool, thinking I can write monitoring software
using RRDs, Mysql and GD while being a very very newbie in perl..
My problem is, I derive data out of RRD, with theses datapoints I try to
graph using GD.
After running the script it says:
Argument "0.0375,0.0363,0.0282,0.0353,0.0396,0.0370,0.0235,0.0228,..." isn't
numeric in numeric eq (==) at
/usr/lib/perl5/site_perl/5.8.3/GD/Graph/axestype.pm line 1452
The lines in the script are: (I know the sed lines look a 'bit' newbie-like
:-))
==============//=================
push @RRDATA, `$rrdtool fetch $rrddir/$DatabaseName AVERAGE |/bin/grep -v
ds |/bin/grep -v nan |/usr/bin/tail -12`;
foreach $_ (@RRDATA) {
($time, $unerr, $corr, $uncorr, $uncorrpercent, $corrpercent) = split('
');
$upct = `printf "%6.4f" $uncorrpercent`;
$timerecord = join(",",$timerecord,"\"$time\"");
$timerecord =~ s/^,//g;
$timerecord =~ s/://g;
$timerecord = join("$timerecord","\"$time\"");
$datarecord = join(",",$datarecord, $upct);
$datarecord =~ s/^,//g;
}
my @data = ([$timerecord],[$datarecord]);
my $mygraph = GD::Graph::bars->new(500, 300);
$mygraph->set(
x_label => 'Time',
y_label => 'Cer %',
title => $DatabaseName,
) or warn $mygraph->error;
my $myimage = $mygraph->plot(\@data) or die $mygraph->error;
print "Content-type: image/png\n\n";
print $myimage->png;
===============//======================
anybody a clue??
Thanks a lot in advance!
Frans
- Next message: Jay G. Scott: "Net-DHCPClient; example fails; tap.al"
- Previous message: Mike: "Re: Using Net::Telnet to connect to Perl server"
- Next in thread: Brian McCauley: "Re: GD::Graph isn't numeric etc."
- Reply: Brian McCauley: "Re: GD::Graph isn't numeric etc."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|