Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignoring devices does not work #176

Open
sgf-dma opened this issue Oct 5, 2017 · 1 comment
Open

Ignoring devices does not work #176

sgf-dma opened this issue Oct 5, 2017 · 1 comment
Labels

Comments

@sgf-dma
Copy link

sgf-dma commented Oct 5, 2017

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.

@glensc glensc added the mdstat label Oct 5, 2017
@waja
Copy link

waja commented Jan 25, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants