Package: munin-node
Version: 1.0.5-1
Severity: wishlist
Tags: patch

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.

Thanks for considering,

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.10-1-686-smp
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.ISO-8859-15 (charmap=ISO-8859-15) 
(ignored: LC_ALL set to en_US.ISO-8859-15)

Versions of packages munin-node depends on:
ii  libnet-server-perl            0.87-2     An extensible, general perl server
ii  perl                          5.8.4-6    Larry Wall's Practical Extraction 
ii  procps                        1:3.2.5-1  /proc file system utilities

-- no debconf information

-- 
 -----------------------------------------------------------------
|   ,''`.                                            Stephen Gran |
|  : :' :                                        [EMAIL PROTECTED] |
|  `. `'                        Debian user, admin, and developer |
|    `-                                     http://www.debian.org |
 -----------------------------------------------------------------
--- /usr/share/munin/plugins/exim_mailstats.old Tue Dec 28 17:37:32 2004
+++ /usr/share/munin/plugins/exim_mailstats     Thu Feb 17 23:18:26 2005
@@ -39,6 +39,7 @@
 $pos   = undef;
 $received = 0;
 $completed = 0;
+$rejected = 0;
 ($dirname = $0) =~ s/[^\/]+$//;
 $EXIM = "/usr/sbin/exim";
 $EXIM = "/usr/sbin/exim4" if (-x "/usr/sbin/exim4"); # a Debianism
@@ -133,6 +134,9 @@
     print "completed.label completed\n";
     print "completed.type COUNTER\n";
     print "completed.cdef completed,60,*\n";
+    print "rejected.label rejected\n";
+    print "rejected.type COUNTER\n";
+    print "rejected.cdef rejected,60,*\n";
     exit 0;
 }
 
@@ -140,6 +144,7 @@
 {
     print "completed.value U\n";
     print "received.value U\n";
+    print "rejected.value U\n";
     exit 0;
 }
 
@@ -148,7 +153,7 @@
     open (IN, "$statefile") or exit 4;
     if (<IN> =~ /^(\d+):(\d+):(\d+)/)
     {
-       ($pos, $received, $completed) = ($1, $2, $3);
+       ($pos, $received, $completed, $rejected) = ($1, $2, $3, $4);
     }
     close IN;
 }
@@ -173,12 +178,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 
@@ -199,6 +205,10 @@
        elsif (substr ($line, 37,9) eq 'Completed')
        {
            $completed++;
+       }
+       elsif ($line=~/rejected/)
+       {
+           $rejected++;
        }
     }
     close(LOGFILE);    

Attachment: signature.asc
Description: Digital signature

Reply via email to