mailgraph CGI failing to render
Bug #4220 reported by
Kevin Otte
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
mailgraph (Ubuntu) |
Fix Released
|
Medium
|
Daniel T Chen |
Bug Description
Going to the mailgraph page fails to display any graphs, and the following is present in the error_log:
[Fri Nov 11 14:40:44 2005] [error] [client 172.27.1.3] Premature end of script headers: /usr/lib/
ERROR: Garbage ':40:45 2005]\l' after command:
COMMENT:[Fri Nov 11 14:40:45 2005]\l
This is in Ubuntu 5.10
Changed in mailgraph: | |
assignee: | nobody → motu |
Changed in mailgraph: | |
assignee: | motu → crimsun |
To post a comment you must log in.
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;