dovecot script patch

Ivana Varekova <[email protected]>
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
/I'm going through fedora logwatch patches and this one is not in 
//upstream branch so I'm sending it here.
// 
//Ivana Hutarova Varekova/

_______________________________________________
Logwatch-Devel mailing list
[email protected]
http://www2.list.logwatch.org:81/mailman/listinfo/logwatch-devel
logwatch-dovecot.patch (text/x-patch, 3 KB)
diff -up ./dovecot.pp1 ./dovecot
--- ./dovecot.pp1	2009-06-02 16:09:31.000000000 +0200
+++ ./dovecot	2009-06-02 16:12:28.000000000 +0200
@@ -141,6 +141,8 @@ while (defined($ThisLine = <STDIN>)) {
       $TLSInitFail++;
    } elsif (($Host) = ($ThisLine =~ /Aborted login \[(.*)\]/) ) {
       $Aborted{$Host}++;
+   } elsif (($Reason) = ($ThisLine =~ /Aborted login \((.*)\):/)) {
+      $Aborted{$Reason}++;
 
 # This is for Dovecot 1.0 series
 # Overly general matches in this section -mgt
@@ -149,19 +151,27 @@ while (defined($ThisLine = <STDIN>)) {
       $Disconnected{"Inactivity"}++;
    } elsif ($ThisLine =~ /Disconnected in IDLE/) {
       $Disconnected{"in IDLE"}++;
-   } elsif ($ThisLine =~ /Disconnected$/) {
+   } elsif (($ThisLine =~ /Disconnected$/) or
+            (($Reason) = ($ThisLine =~ /pop3-login: Disconnected: (.+)/)) or
+            (($Reason) = ($ThisLine =~ /imap-login: Disconnected: (.+)/)) ) {
       $Disconnected{"no reason"}++;
-   } elsif (($Reason) = ($ThisLine =~ /pop3-login: Disconnected: (.+)/) ) {
-      $Disconnected{"no reason"}++;
-   } elsif (($Reason) = ($ThisLine =~ /imap-login: Disconnected: (.+)/) ) {
-      $Disconnected{"no reason"}++;
-   } elsif (($Reason) = ($ThisLine =~ /IMAP.+: Disconnected: (.+) (bytes=)?/) ) {
-      $Disconnected{$Reason}++;
-   } elsif (($Reason) = ($ThisLine =~ /POP3.+: Disconnected: (.+) top/) ) {
+   } elsif ( (($Reason) = ($ThisLine =~ /POP3.+: Disconnected: (.+) top/)) or. 
+          (($Reason) = ($ThisLine =~ /pop3-login: Disconnected \((.+)\): /)) or. 
+          (($Reason) = ($ThisLine =~ /IMAP.+: Disconnected: (.+) bytes=/)) or 
+          (($Reason) = ($ThisLine =~ /IMAP.+: Disconnected: (.+)/)) ) { 
       $Disconnected{$Reason}++;
    } elsif ($ThisLine =~ /(IMAP|POP3).+: (Connection closed.*)/) {
       $Disconnected{$2}++;
-
+   } elsif (($Reason) = ($ThisLine =~ /IMAP.+: Connection closed bytes=/))  { 
+        $ConnectionCl{"no reason"}++; 
+   } elsif ( (($Reason) = ($ThisLine =~ /IMAP.+: Connection closed: (.*) bytes=/)) or. 
+             (($Reason) = ($ThisLine =~ /POP3.+: Connection closed: (.*) (top=|bytes=)/)) ) { 
+      $ConnectionCl{$Reason}++; 
+   } elsif ($ThisLine =~ /POP3.+: Connection closed top=.* retr=.* del=.* size=.*/) { 
+      $ConnectionCl{"no reason"}++; 
+   } elsif (($Error) = ($ThisLine =~ /child \d* \(login\) returned error (.*)/)) {...... 
+   # dovecot: child 23747 (login) returned error 89 
+      $ChildErr{$Error}++; 
    } else {
       # Report any unmatched entries...
       chomp($ThisLine);
@@ -262,6 +272,20 @@ if (keys %Disconnected) {
    }
 }
 
+if (keys %ConnectionCl) {
+   print "\n\nDovecot connections closed:";
+   foreach my $Reason (sort keys %ConnectionCl) {
+      print "\n   $Reason: $ConnectionCl{$Reason} Time(s)";
+   }
+}
+
+if (keys %ChildErr) {
+   print "\n\nDovecot child error:";
+   foreach my $Error (sort keys %ChildErr) {
+      print "\n   error number ". $Error . ": ". $ChildErr{$Error} ." Time(s)";
+   }
+}
+
 if ((keys %Aborted) && ($Detail >= 10)) {
    print "\n\nLogout/aborts:";
    foreach my $Host (sort keys %Aborted) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.