1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-11-24 03:13:47 +01:00

Merge pull request #20 from uakfdotb/patch-1

Fix "critical HDD detection" bug in check_hparray
This commit is contained in:
Pall Sigurdsson 2015-10-17 22:47:04 +11:00
commit 688e8b8412

View File

@ -81,7 +81,7 @@ check_raid()
{ {
raid_ok=`cat $TEMPFILE |grep -i ok|wc -l` raid_ok=`cat $TEMPFILE |grep -i ok|wc -l`
raid_warning=`cat $TEMPFILE|grep -i -E 'rebuild|predictive' |wc -l` raid_warning=`cat $TEMPFILE|grep -i -E 'rebuild|predictive' |wc -l`
raid_critical_1=`cat $TEMPFILE|grep -i 'failed|recovery' | wc -l` raid_critical_1=`cat $TEMPFILE|grep -i -E 'failed|recovery' | wc -l`
err_check=`expr $raid_ok + $raid_warning + $raid_critical_1 ` err_check=`expr $raid_ok + $raid_warning + $raid_critical_1 `
@ -133,7 +133,7 @@ case "$1" in
exit 0 exit 0
;; ;;
--all) --all)
controllers=`sudo -u root hpacucli controller all show | sed 's/.*Slot \([0-9]*\).*/\1/'` controllers=`sudo -u root $HPACUCLI controller all show | sed 's/.*Slot \([0-9]*\).*/\1/'`
for i in $controllers ; do sudo -u root $HPACUCLI controller slot=$i pd all show status;done > $TEMPFILE for i in $controllers ; do sudo -u root $HPACUCLI controller slot=$i pd all show status;done > $TEMPFILE
check_raid check_raid
;; ;;