mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-26 02:48:28 +00: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/[^\/]+$//;
|
($dirname = $0) =~ s/[^\/]+$//;
|
||||||
|
|
||||||
|
$dovelogfile = 0 ;
|
||||||
|
|
||||||
$logfile = $ENV{'LOGFILE'} || '/var/log/mail.log';
|
$logfile = $ENV{'LOGFILE'} || '/var/log/mail.log';
|
||||||
|
|
||||||
|
if ( $logfile =~ /dovecot/ ) {
|
||||||
|
$dovelogfile = 1 ;
|
||||||
|
}
|
||||||
|
|
||||||
# Use an overrided $PATH for all external programs if needed
|
# Use an overrided $PATH for all external programs if needed
|
||||||
$DOVEADM = "doveadm";
|
$DOVEADM = "doveadm";
|
||||||
|
|
||||||
|
@ -208,25 +214,26 @@ sub parseDovecotfile {
|
||||||
my $line =<logf>;
|
my $line =<logf>;
|
||||||
chomp ($line);
|
chomp ($line);
|
||||||
|
|
||||||
if ($line !~ m/dovecot/) { next; }
|
if ( $dovelogfile == 0 and $line !~ m/dovecot/) { next; }
|
||||||
|
else {
|
||||||
|
if ($line =~ m/Aborted/) {
|
||||||
|
$aborted++;
|
||||||
|
|
||||||
if ($line =~ m/Aborted/) {
|
} elsif ($line =~ m/Login:/) {
|
||||||
$aborted++;
|
$login++;
|
||||||
|
|
||||||
} elsif ($line =~ m/Login:/) {
|
if ( $line =~ m/TLS/) {
|
||||||
$login++;
|
$tls++;
|
||||||
|
} elsif ($line =~ m/SSL/) {
|
||||||
|
$ssl++;
|
||||||
|
}
|
||||||
|
|
||||||
if ( $line =~ m/TLS/) {
|
if ( $line =~ m/pop3-login:/) {
|
||||||
$tls++;
|
$pop3login++;
|
||||||
} elsif ($line =~ m/SSL/) {
|
} elsif ($line =~ m/imap-login:/) {
|
||||||
$ssl++;
|
$imaplogin++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ( $line =~ m/pop3-login:/) {
|
|
||||||
$pop3login++;
|
|
||||||
} elsif ($line =~ m/imap-login:/) {
|
|
||||||
$imaplogin++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
close(logf);
|
close(logf);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue