glensc / nagios-plugin-check_raid

Nagios/Icinga/Sensu plugin to check current server's RAID status ⛺
144 stars 84 forks source link

Error runing plug-in on debian 10 #196

Open hardcess opened 5 years ago

hardcess commented 5 years ago

Output of check_raid -d:

check_raid 4.0.10
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: /sbin/dmsetup status --noflush at /usr/lib/nagios/plugins/check_cciss-1.12 line 503.
DEBUG EXEC: /sys/module/hpsa/refcnt at /usr/lib/nagios/plugins/check_cciss-1.12 line 503.
DEBUG EXEC: /proc/driver/cciss at /usr/lib/nagios/plugins/check_cciss-1.12 line 503.
DEBUG EXEC: >&2 /bin/cciss_vol_status -v at /usr/lib/nagios/plugins/check_cciss-1.12 line 499.
DEBUG EXEC: /bin/cciss_vol_status -V /dev/sg0 /dev/sg1 at /usr/lib/nagios/plugins/check_cciss-1.12 line 503.
Unparsed[                 Total cache memory: 96 MiB] at /usr/lib/nagios/plugins/check_cciss-1.12 line 1872, <$fh> line 12.
Unparsed[                        Cache Ratio: 50% Read / 50% Write] at /usr/lib/nagios/plugins/check_cciss-1.12 line 1872, <$fh> line 13.
Unparsed[                 Total cache memory: 96 MiB] at /usr/lib/nagios/plugins/check_cciss-1.12 line 1872, <$fh> line 32.
Unparsed[                        Cache Ratio: 50% Read / 50% Write] at /usr/lib/nagios/plugins/check_cciss-1.12 line 1872, <$fh> line 33.
DEBUG EXEC: /sbin/hpacucli controller all show status at /usr/lib/nagios/plugins/check_cciss-1.12 line 503.
DEBUG EXEC: /sbin/hpacucli controller slot=0 logicaldrive all show at /usr/lib/nagios/plugins/check_cciss-1.12 line 503.
WARNING: cciss:[/dev/sda(Smart Array E200i): Volume 0 (RAID 0): OK, Drives(2): 1I-1-1,1I-1-2=OK, Cache: WriteCache:DISABLED ReadMem:48 MiB WriteMem:48 MiB]; hpacucli:[Smart Array E200i[OK, Cache: Temporarily Disabled, Battery: Failed (Replace Batteries/Capacitors)]: Array A(OK)[LUN1:OK]]

Output of each command from check_raid -d

(command being executed)

(paste your output here)

(second command being executed)

(paste your output here)

Additional environment details: Linux Debian 10

waja commented 4 years ago

Hi there,

with my Debian Maintainers hat for nagios-plugins-contrib on, I can confirm this issue. Looks like the output of cciss_vol_status has changed here. The following output is added to the "Cache status":

                 Total cache memory: 1816 MiB
                        Cache Ratio: 15% Read / 85% Write
glensc commented 4 years ago

@waja can that hat 🎩 help you to produce PR? :)

waja commented 4 years ago

@glensc unfortunately my perl skills are very limited til not existing. :(

glensc commented 4 years ago

probably the task is just to add another pattern and maybe add data for new test case.

waja commented 4 years ago

Anyway ... here is the output of /bin/cciss_vol_status -V /dev/sg0:

Controller: Smart Array P440ar
  Board ID: 0x21c0103c
  Logical drives: 1
  Running firmware: 6.60
  ROM firmware: 6.60
/dev/sda: (Smart Array P440ar) RAID 6 Volume 0 status: OK.   At least one spare drive designated.  At least one spare drive remains available.
  Physical drives: 8
         connector 1I box 1 bay 1                 HITACHI HUC109090CSS600                                  KXJYHXPX     A5B0 OK
         connector 1I box 1 bay 2                 HITACHI HUC109090CSS600                                  W8JP195G     A5B0 OK
         connector 1I box 1 bay 3                 HITACHI HUC109090CSS600                                  KVJZP54F     A5B0 OK
         connector 1I box 1 bay 4                 HITACHI HUC109090CSS600                                  W8JP14JG     A5B0 OK
         connector 2I box 1 bay 5                 HITACHI HUC109090CSS600                                  W8JPYSNG     A5B0 OK
         connector 2I box 1 bay 6                 HITACHI HUC109090CSS600                                  W8JNH4VG     A5B0 OK
         connector 2I box 1 bay 7                 HITACHI HUC109090CSS600                                  W8JP4BRG     A5B0 OK
         connector 2I box 1 bay 8                 HITACHI HUC109090CSS600                                  W8JP74DG     A5B0 OK
/dev/sg0(Smart Array P440ar:0): Non-Volatile Cache status:
                   Cache configured: Yes
                 Total cache memory: 1816 MiB
                        Cache Ratio: 15% Read / 85% Write
                  Read cache memory: 273 MiB
                 Write cache memory: 1543 MiB
                Write cache enabled: Yes
   Flash backed cache present
Marvo2011 commented 4 years ago

Temporary fix:

Change block from:

my %map = ( configured => qr/Cache configured: (.+)/, read_cache_memory => qr/Read cache memory: (.+)/, write_cache_memory => qr/Write cache memory: (.+)/, write_cache_enabled => qr/Write cache enabled: (.+)/, flash_cache => qr/Flash backed cache present/, disabled_temporarily => qr/Write cache temporarily disabled/, disabled_permanently => qr/Write Cache permanently disabled/, );

to:

my %map = ( configured => qr/Cache configured: (.+)/, total_cache_memory => qr/Total cache memory: (.+)/, cache_ratio => qr/Cache Ratio: (.+)/, read_cache_memory => qr/Read cache memory: (.+)/, write_cache_memory => qr/Write cache memory: (.+)/, write_cache_enabled => qr/Write cache enabled: (.+)/, flash_cache => qr/Flash backed cache present/, disabled_temporarily => qr/Write cache temporarily disabled/, disabled_permanently => qr/Write Cache permanently disabled/, );

glensc commented 4 years ago

@Marvo2011 send a pull request, don't forget to include snapshot from your system for unit testing.

Marvo2011 commented 4 years ago

How can I create the unit tests / and get the snapshots?

glensc commented 4 years ago

How can I create the unit tests / and get the snapshots?

it's documented in the project CONTRIBUTING.md file

glensc commented 3 years ago

@knorrie if you can get this issue moving forward just go ahead and submit a pr.