Lukas Gehring
2016-06-01 13:32:14 UTC
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; }
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; }