1 diff -Naur logwatch-7.5.5-orig/conf/services/mdadm.conf logwatch-7.5.5/conf/services/mdadm.conf
2 --- logwatch-7.5.5-orig/conf/services/mdadm.conf 2021-01-22 21:59:40.000000000 +0100
3 +++ logwatch-7.5.5/conf/services/mdadm.conf 2021-10-04 13:52:30.850057355 +0200
5 # Logwatch will try to find md devices in /etc/mdadm.conf or
6 # /etc/mdadm/mdadm.conf. If none of these files exist it can scan actively
7 # for md devices. Set to 'Yes' to enable active scanning:
8 -$mdadm_enable_scan = No
9 +$mdadm_enable_scan = Yes
11 # Logwatch will emit an error for md devices listed in /etc/mdadm.conf
12 # that are not present. If you do not want this (e.g. raid devices may come
13 diff -Naur logwatch-7.5.5-orig/scripts/services/mdadm logwatch-7.5.5/scripts/services/mdadm
14 --- logwatch-7.5.5-orig/scripts/services/mdadm 2021-01-22 21:59:40.000000000 +0100
15 +++ logwatch-7.5.5/scripts/services/mdadm 2021-10-06 11:41:14.800307603 +0200
17 } elsif ( -f "/etc/mdadm/mdadm.conf" ) {
18 open(MDADM,"< /etc/mdadm/mdadm.conf");
19 } elsif ($enable_scan) {
20 - open(MDADM,"mdadm --detail --scan 2>/dev/null|");
21 + open(MDADM,"sudo mdadm --detail --scan 2>/dev/null|");
29 - open(MDADM,"mdadm --misc --detail $dev 2>&1 |");
30 + open(MDADM,"sudo mdadm --misc --detail $dev 2>&1 |");
32 if ($_ =~ /cannot open .*: No such file or directory/) {
33 print $_ unless $ignore_missing;
37 if (lc($mdhash{'state'}) =~ /clean|active/) {
38 - print "$dev : $mdhash{'state'}\n" if $Detail;
39 + if (lc($mdhash{'state'}) =~ /degraded/) {
40 + print "$dev : $mdhash{'state'}\n";
42 + print "$dev : $mdhash{'state'}\n" if $Detail;
45 print "$dev : $mdhash{'state'}\n";
46 if (defined($mdhash{'middle devices'})) {