@@ -57,6 +57,7 @@
# 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 #
+# 20121228 ps type now also checks for failed power supply fans #
#########################################################################
# Usage: ./check_equallogic -H host -C community -t type [-v volume] [-w warning] [-c critical]
#########################################################################
@@ -312,6 +313,7 @@
ps)
psstate=$(snmpwalk -v 2c -O vqe -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.8.1.3)
+ psfanstate=$(snmpwalk -v 2c -O vqe -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.8.1.4)
s3=0; s2=0; s1=0; ps_count=0
for s in $psstate
@@ -322,10 +324,22 @@
ps_count=$(($ps_count + 1))
done
- if [ $s3 -gt 0 ]; then echo "$s3 of $ps_count PSU(s): FAILED"; exit ${STATE_CRITICAL}; fi
- if [ $s2 -gt 0 ]; then echo "$s2 of $ps_count PSU(s): NO AC POWER"; exit ${STATE_CRITICAL}; fi
- if [ $s1 -gt 0 ]; then echo "$s1 of $ps_count PSU(s): OK"; exit ${STATE_OK}; fi
- ;;
+ if [ $s3 -gt 0 ]; then echo "$s3 of $ps_count PSU(s): FAILED"; exit ${STATE_CRITICAL}; fi
+ if [ $s2 -gt 0 ]; then echo "$s2 of $ps_count PSU(s): NO AC POWER"; exit ${STATE_CRITICAL}; fi
+ if [ $s1 -gt 0 ]
+ then
+ fanfail=0; psfan_count=0
+ for fan in $psfanstate
+ do
+ if [[ $fan -gt 1 ]]; then fanfail=$(($fanfail + 1)); fi
+ let psfan_count++
+ done
+
+ if [[ $fanfail -gt 0 ]]; then echo "$fanfail of $psfan_count PSU Fan(s): FAN NOT OPERATIONAL"; exit ${STATE_CRITICAL}; fi
+
+ echo "$s1 of $ps_count PSU(s): OK"; exit ${STATE_OK}
+ fi
+ ;;
info)
membernumber=$(snmpwalk -v 2c -O vq -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.11.1.1 | wc -l)
@@ -523,12 +537,12 @@
declare -a fanunknown=($(snmpwalk -v 2c -O vqe -c ${community} ${host} .1.3.6.1.4.1.12740.2.1.7.1.4 | grep -n "0" | awk -F : '{print $1}' | tr '\n' ' '))
if [[ ${#fanfinalcrit[*]} -gt 0 ]]
- then echo "CRITICAL Fans: ${fanfinalcrit[*]}"; exit ${STATE_CRITICAL}
+ then echo "CRITICAL Enclosure Fans: ${fanfinalcrit[*]}"; exit ${STATE_CRITICAL}
elif [[ ${#fanfinalwarn[*]} -gt 0 ]]
- then echo "WARNING Fans: ${fanfinalwarn[*]}"; exit ${STATE_WARNING}
+ then echo "WARNING Enclosure Fans: ${fanfinalwarn[*]}"; exit ${STATE_WARNING}
elif [[ ${#fanunknown[*]} -gt 0 ]]
- then echo "UNKNOWN Check Fans, an unknown error occured"; exit ${STATE_UNKNOWN}
- else echo "All Fans OK"; exit ${STATE_OK}
+ then echo "UNKNOWN Check Enclosure Fans, an unknown error occured"; exit ${STATE_UNKNOWN}
+ else echo "All Enclosure Fans OK"; exit ${STATE_OK}
fi
;;
|