glensc / nagios-plugin-check_raid

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

Fixes for cciss_vol_status 1.12a #221

Closed sylvainfaivre closed 6 months ago

sylvainfaivre commented 1 year ago

New PR replacing #205

@glensc I don't really understand why you asked for a new PR, as @knorrie's commits can be merged on the current master without any conflict, but here is a new PR with same code anyway.

sylvainfaivre commented 1 year ago

This code works well and fixes our problems on 3 boxes with varying Debian and cciss_vol_status versions :

$ > ./check_raid-fixed.pl  -d
check_raid 4.0.10-27-g84f14c5
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 ./check_raid-fixed.pl line 503.
DEBUG EXEC: /usr/bin/lsscsi -g at ./check_raid-fixed.pl line 503.
DEBUG EXEC: >&2 /usr/bin/cciss_vol_status -v at ./check_raid-fixed.pl line 499.
DEBUG EXEC: /usr/bin/cciss_vol_status -V /dev/sg0 at ./check_raid-fixed.pl line 503.
OK: cciss:[/dev/sda(Smart Array P410): Volume 0 (RAID 5): OK, Drives(3): 1I-1-1,1I-1-2,1I-1-3=OK, Cache: WriteCache ReadMem:36 MiB WriteMem:108 MiB]
$ > ./check_raid-fixed.pl -d
check_raid 4.0.10-27-g84f14c5
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 ./check_raid-fixed.pl line 503.
DEBUG EXEC: /usr/bin/lsscsi -g at ./check_raid-fixed.pl line 503.
DEBUG EXEC: >&2 /usr/bin/cciss_vol_status -v at ./check_raid-fixed.pl line 499.
DEBUG EXEC: /usr/bin/cciss_vol_status -V /dev/sg0 at ./check_raid-fixed.pl line 503.
OK: cciss:[/dev/sda(Smart Array P420): Volume 0 (RAID 5): OK, Drives(3): 1I-1-1,1I-1-2,1I-1-3=OK, Cache: WriteCache FlashCache TotalMem:816 MiB Ratio:'10% Read / 90% Write' ReadMem:82 MiB WriteMem:734 MiB]
$ > ./check_raid-fixed.pl -d
check_raid 4.0.10-27-g84f14c5
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 ./check_raid-fixed.pl line 503.
DEBUG EXEC: /usr/bin/lsscsi -g at ./check_raid-fixed.pl line 503.
DEBUG EXEC: >&2 /usr/bin/cciss_vol_status -v at ./check_raid-fixed.pl line 499.
DEBUG EXEC: /usr/bin/cciss_vol_status -V /dev/sg0 at ./check_raid-fixed.pl line 503.
Unparsed[           Unknown cache disable code: 30] at ./check_raid-fixed.pl line 1898, <$fh> line 18.
WARNING: cciss:[/dev/sda(Smart Array P220i): Volume 0 (RAID 1(1+0)): OK, Drives(2): 1I-1-1,1I-1-2=OK, Cache: WriteCache:DISABLED FlashCache TotalMem:304 MiB Ratio:'25% Read / 75% Write' ReadMem:76 MiB WriteMem:228 MiB]
glensc commented 6 months ago

merged https://github.com/glensc/nagios-plugin-check_raid/pull/205 instead