mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
Merge pull request #690 from shurale/patch-1
689-dovecot-plugin-log-file-format
This commit is contained in:
commit
5fc178cfce
1 changed files with 23 additions and 16 deletions
|
@ -21,8 +21,14 @@ $aborted = 0;
|
|||
|
||||
($dirname = $0) =~ s/[^\/]+$//;
|
||||
|
||||
$dovelogfile = 0 ;
|
||||
|
||||
$logfile = $ENV{'LOGFILE'} || '/var/log/mail.log';
|
||||
|
||||
if ( $logfile =~ /dovecot/ ) {
|
||||
$dovelogfile = 1 ;
|
||||
}
|
||||
|
||||
# Use an overrided $PATH for all external programs if needed
|
||||
$DOVEADM = "doveadm";
|
||||
|
||||
|
@ -208,8 +214,8 @@ sub parseDovecotfile {
|
|||
my $line =<logf>;
|
||||
chomp ($line);
|
||||
|
||||
if ($line !~ m/dovecot/) { next; }
|
||||
|
||||
if ( $dovelogfile == 0 and $line !~ m/dovecot/) { next; }
|
||||
else {
|
||||
if ($line =~ m/Aborted/) {
|
||||
$aborted++;
|
||||
|
||||
|
@ -229,6 +235,7 @@ sub parseDovecotfile {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
close(logf);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue