This one time, at band camp, Stephen Gran said:
> Hello,
> 
> The attached patch (with an admittedly imperfect regex) allows the
> exim_mailstats plugin to show rejected mail in the same way that the
> sendmail one does.

The attached patch is updated for the new version of munin-node.

Thanks again,
-- 
 -----------------------------------------------------------------
|   ,''`.                                            Stephen Gran |
|  : :' :                                        [EMAIL PROTECTED] |
|  `. `'                        Debian user, admin, and developer |
|    `-                                     http://www.debian.org |
 -----------------------------------------------------------------
--- exim_mailstats.old     Wed Feb 23 23:52:10 2005
+++ exim_mailstats    Thu Feb 24 18:08:29 2005
@@ -174,6 +174,9 @@
     print "completed.label completed\n";
     print "completed.type DERIVE\n";
     print "completed.min 0\n";
+    print "rejected.label rejected\n";
+    print "rejected.type DERIVE\n";
+    print "rejected.min 0\n";
     exit 0;
 }

@@ -181,15 +184,16 @@
 {
     print "completed.value U\n";
     print "received.value U\n";
+    print "rejected.value U\n";
     exit 0;
 }

 if (-f "$statefile")
 {
     open (IN, "$statefile") or exit 4;
-    if (<IN> =~ /^(\d+):(\d+):(\d+)/)
+    if (<IN> =~ /^(\d+):(\d+):(\d+):(\d+)/)
     {
-       ($pos, $received, $completed) = ($1, $2, $3);
+       ($pos, $received, $completed, $rejected) = ($1, $2, $3, $4);
     }
     close IN;
 }
@@ -214,12 +218,13 @@

 print "received.value $received\n";
 print "completed.value $completed\n";
+print "rejected.value $rejected\n";

 if(-l $statefile) {
        die("$statefile is a symbolic link, refusing to touch it.");
 }
 open (OUT, ">$statefile") or exit 4;
-print OUT "$pos:$received:$completed\n";
+print OUT "$pos:$received:$completed:$rejected\n";
 close OUT;

 sub parseEximfile
@@ -241,6 +246,10 @@
        {
            $completed++;
        }
+       elsif ($line=~/ rejected /)
+       {
+           $rejected++;
+       }
     }
     close(LOGFILE);
 }

Attachment: pgphWksMhCobc.pgp
Description: PGP signature

Reply via email to