nagios-plugin-check_raid icon indicating copy to clipboard operation
nagios-plugin-check_raid copied to clipboard

Ignoring devices does not work

Open sgf-dma opened this issue 6 years ago • 1 comments

Hi.

Ignoring devices (specified on command-line) does not work (or i'm trying this wrong).

Output of check_raid -d:

# ./check_raid.pl.orig -d -p mdstat md2; echo $?
check_raid 4.0.8
Visit <https://github.com/glensc/nagios-plugin-check_raid#reporting-bugs> how to report bugs
Please include output of **ALL** commands in bugreport

DEBUG EXEC: /proc/mdstat at ./check_raid.pl.orig line 484.
DEBUG EXEC: /proc/mdstat at ./check_raid.pl.orig line 484.
CRITICAL: mdstat:[md2(3.64 TiB raid1):F::U_, md1(799.88 GiB raid1):UU, md0(7.45 GiB raid1):UU]
2

Output of each command from check_raid -d

# cat /proc/mdstat
Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md2 : active (auto-read-only) raid1 sdc1[0]
      3906885632 blocks super 1.2 [2/1] [U_]
      bitmap: 1/30 pages [4KB], 65536KB chunk

md1 : active raid1 sdb2[2] sda2[3]
      838729728 blocks super 1.2 [2/2] [UU]
      bitmap: 1/7 pages [4KB], 65536KB chunk

md0 : active raid1 sdb1[2] sda1[3]
      7806976 blocks super 1.2 [2/2] [UU]

unused devices: <none>

I've found, that the fix is as simple as (well, i don't know perl, so this may be very stupid):

# diff -u check_raid.pl.orig check_raid.pl
--- check_raid.pl.orig  2017-10-05 14:43:47.400308649 +0300
+++ check_raid.pl       2017-10-05 14:44:38.625735881 +0300
@@ -369,7 +369,7 @@
        my $this = shift;
        my ($v) = lc $_[0];

-       foreach (@utils::ignore) {
+       foreach (@App::Monitoring::Plugin::CheckRaid::Utils::ignore) {
                return 0 if lc $_ eq $v;
        }
        return 1;

then output will be

# ./check_raid.pl -d -p mdstat md2; echo $?
check_raid 4.0.8
Visit <https://github.com/glensc/nagios-plugin-check_raid#reporting-bugs> how to report bugs
Please include output of **ALL** commands in bugreport

DEBUG EXEC: /proc/mdstat at ./check_raid.pl line 484.
DEBUG EXEC: /proc/mdstat at ./check_raid.pl line 484.
OK: mdstat:[md1(799.88 GiB raid1):UU, md0(7.45 GiB raid1):UU]
0

Additional environment details: I've tried version 4.0.8 (downloaded from github) on Debian 9.

sgf-dma avatar Oct 05 '17 11:10 sgf-dma

Hi @glensc,

any chance to get this fixed? This was also reported in Debian BTS as a bug: https://bugs.debian.org/894601

Thanks, Jan.

waja avatar Jan 25 '19 08:01 waja