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;
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 second) .
context) returns a string with several colons (hour:minute:
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/ mailgraph. rrd'; # path to where the RRD database is mailgraph/ mailgraph_ virus.rrd' ; # path to where the Virus RRD database is mailgraph' ; # temporary directory where to store the images
+++ mailgraph.cgi.orig 2005-12-22 11:51:31.000000000 -0500
@@ -18,8 +18,6 @@
my $rrd = '/var/lib/
my $rrd_virus = '/var/lib/
my $tmp_dir = '/var/lib/
-my $curtime = localtime(time);
-$curtime =~ s/:/-/g;
my @graphs = (
'GPRINT: rrecv:AVERAGE: avg\: %5.2lf msgs/min',
'GPRINT: rmrecv: MAX:max\ : %4.0lf msgs/min',
{ title => 'Day Graphs', seconds => 3600*24, },
@@ -80,7 +78,7 @@
- 'COMMENT: ['.$curtime. ']\l', ['.localtime( time).' ]\l',
'GPRINT: rspam:AVERAGE: avg\: %5.2lf msgs/min',
'GPRINT: rmspam: MAX:max\ : %4.0lf msgs/min',
+ 'COMMENT:
);
my $ERR=RRDs::error;
die "ERROR: $ERR\n" if $ERR;
@@ -150,7 +148,7 @@
- 'COMMENT: ['.$curtime. ']\l', ['.localtime( time).' ]\l',
+ 'COMMENT:
);
my $ERR=RRDs::error;
die "ERROR: $ERR\n" if $ERR;