Opened 8 years ago

Closed 8 years ago

Last modified 2 years ago

#227 closed task (fixed)

mailscanner plugin warnings removed and logtail syntax annotated

Reported by: dz@… Owned by: jo
Priority: highest Milestone: Munin 3.0.0
Component: design Version: 1.2.4
Severity: trivial Keywords: None
Cc: None

Description

The mailscanner plugin emits some unnecessary warnings (e.g. if the line "
Virus Scanning: F-Prot found 2 infections" is found) and the logtail syntax may vary:

--- mailscanner.orig    2006-05-09 07:42:45.000000000 +0200
+++ mailscanner 2006-05-12 08:16:47.000000000 +0200
@@ -71,26 +71,34 @@
 }

 my @lines = split(/\n/, qx($logtail -f $logfile -o $offsetfile));
+
+# sometimes the logtail syntax is:
+#my @lines = split(/\n/, qx($logtail $logfile $offsetfile));
+
 foreach (@lines) {
        SWITCH: {
                if (/New Batch: S/) {
-                       s/.*New Batch: Scanning ([0-9]+) messages.*/$1/;
-                       $total += $_;
+                       if (s/.*New Batch: Scanning ([0-9]+) messages.*/$1/) {
+                               $total += $_;
+                       }
                        last SWITCH;
                }
                if (/Virus Scanning: F/) {
-                       s/.*Virus Scanning: Found ([0-9]+) viruses.*/$1/g;
-                       $viruses += $_;
+                       if (s/.*Virus Scanning: Found ([0-9]+) viruses.*/$1/g) {
+                               $viruses += $_;
+                       }
                        last SWITCH;
                }
                if (/Spam Checks: F/) {
-                       s/.*Spam Checks: Found ([0-9]+) spam.*/$1/g;
-                       $spams += $_;
+                       if (s/.*Spam Checks: Found ([0-9]+) spam.*/$1/g) {
+                               $spams += $_;
+                       }
                        last SWITCH;
                }
                if (/Other Checks: F/) {
-                       s/.*Other Checks: Found ([0-9]+) problems.*/$1/g;
-                       $others += $_;
+                       if (s/.*Other Checks: Found ([0-9]+) problems.*/$1/g) {
+                               $others += $_;
+                       }
                        last SWITCH;
                }
        }

Change History (1)

comment:1 Changed 8 years ago by janl

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.