Hi,
after I noticed that missing images have always a "WIDTH=0 HEIGHT=0" in the
html output and are available if you view the media files of the page in
Iceweasel/Firefox I've added some debugging code.

s...@arthur:/var/www/cgi-bin$ diff -u mrtg-rrd.cgi mrtg-sven.cgi
--- mrtg-rrd.cgi        2009-04-18 19:39:03.000000000 +0200
+++ mrtg-sven.cgi       2009-04-27 22:52:46.000000000 +0200
@@ -461,6 +461,17 @@
        my $rrd_error = RRDs::error;
        print_error("RRDs::graph failed, $rrd_error") if defined $rrd_error;

+       open FILE, ">>/tmp/debugme.txt" or die $!;
+       if ($rv[1] == 0) {
+           print FILE "Bad rv value: $rv[0] $rv[1] $rv[2]\n";
+           print FILE "Call to RRDs::graph $file -s -$back @local_args 
@{$target->{args}} VRULE:$oldsec#ff0000 VRULE:$seconds#ff0000 
@local_args_end\n";
+       } else {
+           print FILE "Good rv value: $rv[0] $rv[1] $rv[2]\n";
+           print FILE "Call to RRDs::graph $file -s -$back @local_args 
@{$target->{args}} VRULE:$oldsec#ff0000 VRULE:$seconds#ff0000 
@local_args_end\n";
+       }
+       close FILE;
+
+
        # In array context just return the values
        if (wantarray) {
                if (defined $target->{factor}) {

This gives me the following output for a good and a bad image result:
Good rv value: ARRAY(0x89e71f0) 497 154
Call to RRDs::graph /var/www/mrtg/temp-day.png -s -108000 -x 
HOUR:1:HOUR:6:HOUR:2:0:%-H --lazy -c FONT#000000 -c MGRID#000000 -c 
FRAME#000000 -g -l 0 -c BACK#f5f5f5 -c ARROW#000000 -b 1000 -w 400 -h 100 
DEF:in=/var/www/mrtg/temp.rrd:ds0:AVERAGE 
DEF:maxin=/var/www/mrtg/temp.rrd:ds0:MAX 
DEF:out=/var/www/mrtg/temp.rrd:ds1:AVERAGE 
DEF:maxout=/var/www/mrtg/temp.rrd:ds1:MAX -v CPU, MB AREA:in#ffa000:In 
LINE2:out#f00000:Out PRINT:out:MAX:%.1lf PRINT:in:MAX:%.1lf 
PRINT:out:AVERAGE:%.1lf PRINT:in:AVERAGE:%.1lf PRINT:out:LAST:%.1lf 
PRINT:in:LAST:%.1lf HRULE:100#cc0000 VRULE:1240696800#ff0000 
VRULE:1240783200#ff0000

Bad rv value: ARRAY(0x89560b8) 0 0
Call to RRDs::graph /var/www/mrtg/temp-week.png -s -691200  --lazy -c 
FONT#000000 -c MGRID#000000 -c FRAME#000000 -g -l 0 -c BACK#f5f5f5 -c 
ARROW#000000 -b 1000 -w 400 -h 100 DEF:in=/var/www/mrtg/temp.rrd:ds0:AVERAGE 
DEF:maxin=/var/www/mrtg/temp.rrd:ds0:MAX 
DEF:out=/var/www/mrtg/temp.rrd:ds1:AVERAGE 
DEF:maxout=/var/www/mrtg/temp.rrd:ds1:MAX -v CPU, MB AREA:in#ffa000:In 
LINE2:out#f00000:Out PRINT:out:MAX:%.1lf PRINT:in:MAX:%.1lf 
PRINT:out:AVERAGE:%.1lf PRINT:in:AVERAGE:%.1lf PRINT:out:LAST:%.1lf 
PRINT:in:LAST:%.1lf HRULE:100#cc0000 VRULE:1240178400#ff0000 
VRULE:1240783200#ff0000

The only difference between the good and the bad seems to be the definition for
the -x parameter. According to the rrdtool manpage you should not fiddle with
-x because it's complex so that should work out of the box when you don't set.
it. That makes me believe that there's something broken with the RRDs.pm in
the rrdtool package.

So we now need someone to build the latest rrdtool on Lenny to see if it's
already fixed.


My ugly workaround would be to set the $rv[1] and $rv[2] values when they're
empty. With my debugging code commented out that looks like this:

s...@arthur:/var/www/cgi-bin$ diff -u mrtg-rrd.cgi mrtg-sven.cgi
--- mrtg-rrd.cgi        2009-04-18 19:39:03.000000000 +0200
+++ mrtg-sven.cgi       2009-04-27 23:06:00.000000000 +0200
@@ -461,6 +461,19 @@
        my $rrd_error = RRDs::error;
        print_error("RRDs::graph failed, $rrd_error") if defined $rrd_error;

+       #open FILE, ">>/tmp/debugme.txt" or die $!;
+       if ($rv[1] == 0) {
+           #print FILE "Bad rv value: $rv[0] $rv[1] $rv[2]\n";
+           #print FILE "Call to RRDs::graph $file -s -$back @local_args 
@{$target->{args}} VRULE:$oldsec#ff0000 VRULE:$seconds#ff0000 
@local_args_end\n";
+           $rv[1] = "497";
+           $rv[2] = "154";
+       } else {
+           #print FILE "Good rv value: $rv[0] $rv[1] $rv[2]\n";
+           #print FILE "Call to RRDs::graph $file -s -$back @local_args 
@{$target->{args}} VRULE:$oldsec#ff0000 VRULE:$seconds#ff0000 
@local_args_end\n";
+       }
+       #close FILE;
+
+
        # In array context just return the values
        if (wantarray) {
                if (defined $target->{factor}) {


Sven
-- 
forevermore



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to