@@ -55,7 +55,7 @@
#
# ChangeLog:
#
-# 19/08/11 (1.10)
+# 19/08/11 (1.11)
# - Added support to disable chache check (-c)
#
# 10/06/08 (1.8)
@@ -102,6 +102,7 @@
REVISION=`echo '$Revision: 1.8 $' | sed -e 's/[^0-9.]//g'`
DEBUG="0"
VERBOSE="0"
+NO_CACHE="0"
HPPROC="/proc/driver/cciss/cciss"
COMPAQPROC="/proc/driver/cpqarray/ida"
hpacucli="/usr/sbin/hpacucli"
@@ -191,7 +192,12 @@
exit $STATE_UNKNOWN
fi
-check=`$hpacucli controller all show status 2>&1`
+if [ "$NO_CACHE" = "1" ] ; then
+ check=`$hpacucli controller all show status | grep -v "Cache Status" 2>&1`
+else
+ check=`$hpacucli controller all show status 2>&1`
+fi
+
status=$?
if test ${status} -ne 0; then
echo "RAID UNKNOWN - $hpacucli did not execute properly : "${check}
@@ -234,11 +240,9 @@
if echo ${check} | egrep Failed >/dev/null; then
echo "RAID CRITICAL - HP Smart Array Failed: "${check} | egrep Failed
exit $STATE_CRITICAL
-elif [ "$NO_CACHE" != "1" ] ; then
- if echo ${check} | egrep Disabled >/dev/null; then
+elif echo ${check} | egrep Disabled >/dev/null; then
echo "RAID CRITICAL - HP Smart Array Problem: "${check} | egrep Disabled
exit $STATE_CRITICAL
- fi
elif echo ${check2} | egrep Rebuild >/dev/null; then
echo "RAID WARNING - HP Smart Array Rebuilding: "${check2} | egrep Rebuild
exit $STATE_WARNING
|