[BUG] [PATCH] False negative on Disk Failure in Raid

Lukas Gehring <gehring-o02PS0xoJP/[email protected]> Wed, 1 Jun 2016 15:32:14 +0200
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
Hello,

When a disk in a RAID fails on a Debian Wheezy System
md logs something like:
~~~
md/raid1:md0: Disk failure on sda1, disabling device.
~~~

Unfortunally logwatch does not report the failure because the it doesn´t searches for 'failure' if a string starts with md. 
See scripts/services/raid:
~~~
#[...]
elsif (/^md/) {
    if (/skipping faulty/) { $print = 1; }
    if (/degraded mode/)  { $print = 1; }
}
#[...]
~~~
So something like
~~~
if (/failure/) { $print = 1; }
~~~
should probably be added at that point.

I wrote a patch, which does that.

Kind Regards,
Lukas Gehring


--- /usr/share/logwatch/scripts/services/raid.orig	2016-06-01 15:18:34.320106877 +0200
+++ /usr/share/logwatch/scripts/services/raid	2016-06-01 15:18:34.297254950 +0200
@@ -31,6 +31,7 @@
    } elsif (/^md/) {
       if (/skipping faulty/) { $print = 1; }
       if (/degraded mode/)  { $print = 1; }
+      if (/failure/) { $print = 1; }
    } elsif (/AppleRAID/){
       if (/restarting/) { $print = 1; }
       if (/rebuild/) { $print = 1; }

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e