Your message dated Mon, 04 Jan 2010 14:00:07 +0100
with message-id <[email protected]>
and subject line Re: munin-node: postfix_mail(stats|volume) broken if "dateext"
option of logrotate is used
has caused the Debian Bug report #440114,
regarding munin-node: postfix_mail(stats|volume) broken if "dateext" option of
logrotate is used
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
440114: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=440114
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: munin-node
Version: 1.2.5-1
Severity: normal
Personally I prefer rotating logfiles using logrotate's "dateext"
option which changes e.g. mail.log into mail.log-20070829 instead of
mail.log.1; however, two of the postfix_* plugins which try to read
yesterday's logfile cannot cope with that for two reasons:
- They don't check for "$logfile-$prevdate".
- $prevdate is composed without leading zeros, e.g. 2007829, correct
was 20070829.
The attached patch fixes both errors in postfix_mailstats, the changes
for postfix_mailvolume are virtually identical.
On a side note, the way prevdate is calculated may lead to funny plugin
results around daylight saving time switching days.
Christoph
-- System Information:
Debian Release: 4.0
APT prefers stable
APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15.53
Locale: lang=de_de.ut...@euro, lc_ctype=de_de.ut...@euro (charmap=UTF-8)
Versions of packages munin-node depends on:
ii adduser 3.102 Add and remove users and groups
ii libnet-server-perl 0.94-1 An extensible, general perl server
ii lsb-base 3.1-23.1 Linux Standard Base 3.1 init scrip
ii perl 5.8.8-7 Larry Wall's Practical Extraction
ii procps 1:3.2.7-3 /proc file system utilities
Versions of packages munin-node recommends:
ii libnet-snmp-perl 5.2.0-1 Script SNMP connections
-- no debconf information
--- postfix_mailstats.in 2007-08-15 12:57:55.000000000 +0200
+++ postfix_mailstats.in 2007-08-29 12:20:39.000000000 +0200
@@ -112,6 +112,10 @@
{
$rotlogfile = "$logfile.$prevdate";
}
+elsif (-f "$logfile-$prevdate")
+{
+ $rotlogfile = "$logfile-$prevdate";
+}
elsif (-f "$logfile.0")
{
$rotlogfile = $logfile . ".0";
@@ -246,7 +250,7 @@
sub get_prev_date
{
my @date = localtime (time - 86400);
- my $prevdate = $date[5]+1900 . $date[4]+1 . $date[3];
+ my $prevdate = sprintf ('%4d%02d%02d', $date[5]+1900, $date[4]+1, $date[3]);
return $prevdate;
}
signature.asc
Description: Digital signature
--- End Message ---
--- Begin Message ---
The code looking for rotated logfiles has been removed from the plugins
in Munin 1.4.
I'll close this bug report.
--
Stig Sandbeck Mathisen
--- End Message ---