|
This is the patch:
--- /usr/local/libexec/nagios/check_3ware.sh 2010-08-27 02:34:55.000000000 +0100
+++ /home/dan/bin/check_3ware.sh 2010-09-02 01:08:39.000000000 +0100
@@ -66,6 +66,12 @@
MSG="$MSG $STATUS -"
PREEXITCODE=1
;;
+ VERIFYING)
+ CHECKUNIT=`$TWCLI info $i unitstatus | ${GREP} -E "${UNIT[$COUNT]}" | ${AWK} '{print $1,$3,$5}'`
+ STATUS="/$i/$CHECKUNIT"
+ MSG="$MSG $STATUS -"
+ PREEXITCODE=1
+ ;;
DEGRADED)
CHECKUNIT=`$TWCLI info $i unitstatus | ${GREP} -E "${UNIT[$COUNT]}" | ${AWK} '{print $1,$3}'`
STATUS="/$i/$CHECKUNIT"
This is what it outputs:
$ sudo ~/bin/check_3ware.sh
WARNING: /c0/u0 VERIFYING 89% - /c0/u1 VERIFYING 0% - /c0/u2 VERIFYING 0% -
After replacing the original script, I get this output when testing it from the
command line on the Nagios server:
$ /usr/local/libexec/nagios/check_nrpe2 -H supernews-vpn -c check_3ware.sh
WARNING: /c0/u0 VERIFYING 99% - /c0/u1 VERIFYING 1% - /c0/u2 VERIFYING 0% -
I now see this on my Nagios webpage:
Status: WARNING
Status Information: WARNING:
/c0/u0 VERIFYING 99% -
/c0/u1 VERIFYING 1% -
/c0/u2 VERIFYING 0% -
|