[cricket-users] Problem with RRDs::graph in grapher.cgi

From: Bjorn Nordbo (bn@nextel.no)
Date: Thu Dec 16 1999 - 02:02:55 PST


From: Bjorn Nordbo <bn@nextel.no>

I am having serious trouble with this chunk of code:

Line 878 - 887:

my(@args) = (
    "/dev/null",
    "DEF:ds0=$rrdfile:ds$dsnum:AVERAGE",
    "DEF:ds1=$rrdfile:ds$dsnum:MAX",
    "CDEF:sds0=ds0,$scale",
    "CDEF:sds1=ds1,$scale",
    "PRINT:sds0:AVERAGE:\%f",
    "PRINT:sds1:MAX:\%f" );

    ($mmax, undef, undef) = RRDs::graph @args;

At my system, this RRDs::graph returns undef, meaning an error has
occured. When I check RRDs::error, it is set to "can't make a graph
without contents". I don't get it. No matter what I do, I can't make
RRDs::graph graph. Naturally, this leads to a lot of warnings in the
logs, and the Max and Average values are set to zero. OTOH, the graphs
show up nicely on the web page, it's only this average and max value
fetching "graph" that doesn't work properly.

This is for Cricket 0.70, rrdtool 1.0.8 and Perl 5.002 on Solaris
2.6/UltraII.

BTW, isn't %lf right, not %f?

This script fail here. Could anyone please tell me if they can make
it work?

#!/local/bin/perl5.005 -w

use lib '/local/net/experimental/bn/lib/perl';
use RRDs;

$rrdfile = '/local/net/experimental/bn/cricket-data/router-interfaces/serial11_1
_3.rrd';
$dsnum = 1;
$scale = 8;

my($args) =
        "/dev/null
        DEF:ds0=$rrdfile:ds$dsnum:AVERAGE
        DEF:ds1=$rrdfile:ds$dsnum:MAX
        CDEF:sds0=ds0,$scale
        CDEF:sds1=ds1,$scale
        PRINT:sds0:AVERAGE:\%f
        PRINT:sds1:MAX:\%f";

($mmax, undef, undef) = RRDs::graph $args;
$error = RRDs::error;
print "$error\n" if (defined $error);
print $mmax;

Any help greatly appreciated!

Yours,

Bjørn Nordbo <bn@nextel.no>

--------------------------- ONElist Sponsor ----------------------------

Independent contractors: Find your next project gig through JobSwarm!
        You can even make $$$ by referring friends.
<a href=" http://clickme.onelist.com/ad/jobswarm2 ">Click Here</a>

------------------------------------------------------------------------



This archive was generated by hypermail 2b29 : Mon Mar 06 2000 - 19:01:07 PST