@@ -46,24 +46,36 @@
# 20120104 Bugfix in info check if only one controller available #
# 20120123 Bugfix in volumes check #
# 20120125 Added perfdata in volumes check, volume names now w/o quotes #
+# 20120319 Added poolconn check by Erwin Bleeker #
+# 20120330 Rewrite of poolusage (orig is now: memberusage) by E. Bleeker#
+# 20120405 Bugfix in poolusage to show result without thresholds #
+# 20120430 Added snapshots type by Roland Penner #
+# 20120503 Rewrite of info check (Fix for multiple members, FW Check) #
+# 20120815 Added percentage of raid rebuild when raid reconstructing #
+# 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 #
#########################################################################
-# Usage: ./check_equallogic -H host -C community -t type [-w warning] [-c critical]
+# Usage: ./check_equallogic -H host -C community -t type [-v volume] [-w warning] [-c critical]
#########################################################################
help="check_equallogic (c) 2009-2012 Claudio Kuenzler (published under GPL licence)\n
Usage: ./check_equallogic -H host -C community -t type [-v volume] [-w warning] [-c critical]\n
Options:\n-H Hostname\n-C SNMP-Community name (at least read-only)\n-t Type to check, see list below\n-v Name of volume to check\n-w Warning Threshold\n-c Critical Threshold\n
Requirements: snmpwalk, awk, grep, wc\n
-types:\nconn -> Checks number of ISCSI connections (if no thresholds are given, outputs information)
+types:\nconn -> Checks total number of ISCSI connections (if no thresholds are given, outputs information)
disk -> Checks Status of all disks
diskusage -> Checks the actual usage of the defined raid (if no thresholds are given, outputs information)
etherrors -> Checks ethernet interfaces for ethernet packet errors (thresholds possible)
ethif -> Checks ethernet interfaces (if no thresholds are given, outputs information)
fan -> Status of Fans
health -> Overall health status of Equallogic device
-info -> Shows some Information
-poolusage -> Checks utilization of disk pools (if no thresholds are given, outputs information)
+info -> Shows some Information and checks for same firmware version
+memberusage -> Shows disk utilisation of all members of the same group (if no thresholds are given, outputs information)
+poolconn -> Check highest number of ISCSI connections per pool (if no thresholds are given, outputs information)
+poolusage -> Checks utilization of pools (if no thresholds are given, outputs information)
ps -> Checks Power Supply/Supplies
raid -> Checks RAID status
+snapshots -> Checks Snapshot Reserve status (warning level is taken from the equallogic volume config, critical level can be set with -c )
temp -> Checks Temperature sensors
uptime -> Shows uptime
vol -> Checks a single volume, must be used with -v option (if no thresholds are given, outputs information)
@@ -271,18 +283,18 @@
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)); 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" = "5" ]; then s5=$((s5 + 1)); fi
if [ "$s" = "6" ]; then s6=$((s6 + 1)); fi
- if [ "$s" = "7" ]; then s7=$((s7 + 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
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"; 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"; 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
;;
@@ -310,23 +322,38 @@
;;
info)
- modelnumber=$(snmpwalk -v 2c -O vq -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.11.1.1)
- serialnumber=$(snmpwalk -v 2c -O vq -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.11.1.2)
- controllernumber=$(snmpwalk -v 2c -O vq -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.11.1.3)
- disknumber=$(snmpwalk -v 2c -O vq -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.11.1.4)
- firmware1=$(snmpwalk -v 2c -O vq -c ${community} ${host} 1.3.6.1.4.1.12740.4.1.1.1.4.1 | cut -d " " -f 4 | awk 'NR==1')
- firmware2=$(snmpwalk -v 2c -O vq -c ${community} ${host} 1.3.6.1.4.1.12740.4.1.1.1.4.1 | cut -d " " -f 4 | awk 'NR==2')
- if [ ${controllernumber} -gt 1 ]
- then
- if [ ${firmware1} = ${firmware2} ]
- then firmware=${firmware1}
- else firmware="Firmware differ!"
- fi
- else firmware=${firmware1}
- fi
- echo "Equallogic Model ${modelnumber}, Serial No ${serialnumber}, ${controllernumber} controller(s) running FW ${firmware}, ${disknumber} disks"
- exit ${STATE_OK}
- ;;
+ membernumber=$(snmpwalk -v 2c -O vq -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.11.1.1 | wc -l)
+ declare -a modelnumber=($(snmpwalk -v 2c -O vq -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.11.1.1 | sort -u))
+ declare -a serialnumber=($(snmpwalk -v 2c -O vq -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.11.1.2))
+
+ controllers=0
+ for ctrl in $(snmpwalk -v 2c -O vq -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.11.1.3); do controllers=$((${controllers} + $ctrl)); done
+
+ disknumber=0
+ for disks in $(snmpwalk -v 2c -O vq -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.11.1.4); do disknumber=$((${disknumber} + $disks)); done
+
+ declare -a firmware=($(snmpwalk -v 2c -O vq -c ${community} ${host} 1.3.6.1.4.1.12740.4.1.1.1.4.1 | cut -d " " -f 4 | sort -u))
+
+ if [ ${controllers} -gt 1 ]
+ then
+ memberstring="members"
+ modelstring="models"
+ serialstring="Serials"
+ controllerstring="Controllers"
+ else
+ memberstring="member"
+ modelstring="model"
+ serialstring="Serial"
+ controllerstring="Controller"
+ fi
+
+ if [ ${#firmware[*]} -gt 1 ]
+ then echo "Warning: Different firmware versions used across members (${firmware[*]})"; exit ${STATE_WARNING}
+ fi
+
+ echo "$membernumber $memberstring in Group. Used $modelstring: ${modelnumber[*]}. $serialstring: ${serialnumber[*]}. $controllerstring: ${controllers}. Running Firmware: ${firmware}. Total disks: ${disknumber}."
+ exit ${STATE_OK}
+ ;;
ethif)
i=0
@@ -416,7 +443,7 @@
conn)
connections=0
- for line in $(snmpwalk -v 2c -O vq -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.12.1.1)
+ for line in $(snmpwalk -v 2c -O vqe -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.12.1.1)
do connections=`expr ${connections} + ${line}`
done
if [ -n "${warning}" ] || [ -n "${critical}" ]
@@ -432,6 +459,29 @@
fi
;;
+ poolconn)
+ highest=0
+ for line in $(snmpwalk -v 2c -O vqe -c ${community} ${host} 1.3.6.1.4.1.12740.2.1.12.1.1)
+ do
+ if [ "${line}" -ge "${highest}" ]
+ then
+ highest=${line}
+ fi
+ done
+
+ if [ -n "${warning}" ] || [ -n "${critical}" ]
+ then
+ if [ ${highest} -ge ${warning} ] && [ ${highest} -lt ${critical} ]
+ then echo "POOL CONNECTIONS WARNING ${highest} ISCSI Connections (Threshold: ${warning}) | connections=${highest};${warning};${critical}"; exit ${STATE_WARNING}
+ elif [ ${highest} -ge ${critical} ]
+ then echo "POOL CONNECTIONS CRITICAL ${highest} ISCSI Connections (Threshold: ${critical}) | connections=${highest};${warning};${critical}"; exit ${STATE_CRITICAL}
+ else echo "POOL CONNECTIONS OK ${highest} ISCSI Connections | connections=${highest};${warning};${critical}"; exit ${STATE_OK}
+ fi
+ else
+ echo "${highest} ISCSI Connections | connections=${highest}"; exit ${STATE_OK}
+ fi
+ ;;
+
fan)
declare -a fannames=($(snmpwalk -v 2c -O vqe -c ${community} ${host} .1.3.6.1.4.1.12740.2.1.7.1.2 | tr '\n' ' '))
@@ -478,16 +528,105 @@
;;
poolusage)
+ exitstate=0
+ c=1
+ for x in `snmpwalk -v 2c -O vqe -c ${community} ${host} 1.3.6.1.4.1.12740.16.1.2.1.1`
+ do
+ pooltotal[$c]=${x}
+ let c=c+1
+ done
+
+ c=1
+ for x in `snmpwalk -v 2c -O vqe -c ${community} ${host} 1.3.6.1.4.1.12740.16.1.2.1.2`
+ do
+ poolused[$c]=${x}
+ let c=c+1
+ done
+
+ c=1
+ for x in `snmpwalk -v 2c -O vqe -c ${community} ${host} 1.3.6.1.4.1.12740.16.1.2.1.17`
+ do
+ pooldelegated[$c]=${x}
+ let c=c+1
+ done
+
+ c=1
+ for x in `snmpwalk -v 2c -O vqe -c ${community} ${host} 1.3.6.1.4.1.12740.16.1.2.1.9`
+ do
+ poolreplication[$c]=${x}
+ let c=c+1
+ done
+
+ c=1
+ for x in `snmpwalk -v 2c -O vqe -c ${community} ${host} 1.3.6.1.4.1.12740.16.1.1.1.3`
+ do
+ poolname[$c]=${x}
+ let c=c+1
+
+ done
+
|