[-]
[+]
|
Changed |
check_equallogic.changes
|
|
[-]
[+]
|
Changed |
check_equallogic.spec
^
|
|
[-]
[+]
|
Changed |
check_equallogic
^
|
@@ -55,6 +55,8 @@
# 20120821 Minor bugfix in vol/volumes check (added space in perfdata) #
# 20120911 Added percentage of raid rebuild when raid expanding #
# 20120913 Bugfix in percentage output in raid check #
+# 20121204 Added percentage of raid rebuild when raid verifying #
+# 20121204 Changed raid percentage output when multiple members around #
#########################################################################
# Usage: ./check_equallogic -H host -C community -t type [-v volume] [-w warning] [-c critical]
#########################################################################
@@ -283,18 +285,22 @@
if [ "$s" = "1" ]; then s1=$((s1 + 1)); fi
if [ "$s" = "2" ]; then s2=$((s2 + 1)); fi
if [ "$s" = "3" ]; then s3=$((s3 + 1)); fi
- if [ "$s" = "4" ]; then s4=$((s4 + 1)); raidpercentage=$(snmpwalk -v 2c -O vqe -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.13.1.2 | sed -n '1p'); fi
+ if [ "$s" = "4" ]; then s4=$((s4 + 1)); fi
if [ "$s" = "5" ]; then s5=$((s5 + 1)); fi
if [ "$s" = "6" ]; then s6=$((s6 + 1)); fi
- if [ "$s" = "7" ]; then s7=$((s7 + 1)); raidpercentage=$(snmpwalk -v 2c -O vqe -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.13.1.2 | sed -n '1p'); fi
+ if [ "$s" = "7" ]; then s7=$((s7 + 1)); fi
done
+ declare -a raidpercentage=($(snmpwalk -v 2c -O vqe -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.13.1.2))
+ index=0
+ for value in ${raidpercentage[@]}; do if [[ $value -eq 0 ]]; then unset raidpercentage[$index]; fi; let index++; done
+
if [ $s6 -gt 0 ]; then echo "RAID CATASTROPHIC LOSS"; exit ${STATE_CRITICAL}; fi
if [ $s5 -gt 0 ]; then echo "RAID FAILED"; exit ${STATE_CRITICAL}; fi
if [ $s2 -gt 0 ]; then echo "RAID DEGRADED"; exit ${STATE_WARNING}; fi
- if [ $s4 -gt 0 ]; then echo "RAID RECONSTRUCTING (${raidpercentage}%)"; exit ${STATE_WARNING}; fi
- if [ $s3 -gt 0 ]; then echo "RAID VERIFYING"; exit ${STATE_WARNING}; fi
- if [ $s7 -gt 0 ]; then echo "RAID EXPANDING (${raidpercentage}%)"; exit ${STATE_WARNING}; fi
+ if [ $s4 -gt 0 ]; then echo "RAID RECONSTRUCTING (${raidpercentage[@]}%)"; exit ${STATE_WARNING}; fi
+ if [ $s3 -gt 0 ]; then echo "RAID VERIFYING (${raidpercentage[@]}%)"; exit ${STATE_WARNING}; fi
+ if [ $s7 -gt 0 ]; then echo "RAID EXPANDING (${raidpercentage[@]}%)"; exit ${STATE_WARNING}; fi
if [ $s1 -gt 0 ]; then echo "RAID OK"; exit ${STATE_OK}; fi
;;
|