Comment 1 for bug 4220

Revision history for this message
Kevin Otte (nivex) wrote :

The following is provided by Ian Kilgore <email address hidden>:

The problem line is this:

'COMMENT:['.localtime(time).']\l',

The commands to librrds are delimted by colons, localtime (in scalar
context) returns a string with several colons (hour:minute:second).
librrds on sarge swallows the colons fine (for the COMMENT field), the Ubuntu version does not.

Patch for ubuntu version:

--- mailgraph.cgi 2005-12-22 11:51:48.000000000 -0500
+++ mailgraph.cgi.orig 2005-12-22 11:51:31.000000000 -0500
@@ -18,8 +18,6 @@
 my $rrd = '/var/lib/mailgraph/mailgraph.rrd'; # path to where the RRD database is
 my $rrd_virus = '/var/lib/mailgraph/mailgraph_virus.rrd'; # path to where the Virus RRD database is
 my $tmp_dir = '/var/lib/mailgraph'; # temporary directory where to store the images
-my $curtime = localtime(time);
-$curtime =~ s/:/-/g;

 my @graphs = (
        { title => 'Day Graphs', seconds => 3600*24, },
@@ -80,7 +78,7 @@
                'GPRINT:rrecv:AVERAGE:avg\: %5.2lf msgs/min',
                'GPRINT:rmrecv:MAX:max\: %4.0lf msgs/min',

- 'COMMENT:['.$curtime.']\l',
+ 'COMMENT:['.localtime(time).']\l',
        );
        my $ERR=RRDs::error;
        die "ERROR: $ERR\n" if $ERR;
@@ -150,7 +148,7 @@
                'GPRINT:rspam:AVERAGE:avg\: %5.2lf msgs/min',
                'GPRINT:rmspam:MAX:max\: %4.0lf msgs/min',

- 'COMMENT:['.$curtime.']\l',
+ 'COMMENT:['.localtime(time).']\l',
        );
        my $ERR=RRDs::error;
        die "ERROR: $ERR\n" if $ERR;