Skip to content
Permalink
Browse files

made output be standard nagios output and added option for warning ou…

…tput
  • Loading branch information
Jesse Eichar
Jesse Eichar committed Jun 22, 2012
1 parent 97e0ab5 commit e8d6bf95229af7076cf279619eed101d4482de7e
Showing with 10 additions and 2 deletions.
  1. +10 −2 monitoring/nagios/healthcheck.sh
@@ -30,6 +30,7 @@ rm -f $COOKIE_FILE

RESPONSE="Health checks pass"
EXIT=$STATE_OK
STATUS="OK"
if [ "x$CODE" != "x200" ]; then
# Add line to file so that last line is processed by while loop
echo "" >> $OUT
@@ -43,9 +44,16 @@ if [ "x$CODE" != "x200" ]; then
fi
done < $OUT
ISWARNING=`grep -q "/warninghealthcheck" <<< $CHECK`
if [ "x$ISWARNING" != "x" ]; then
STATUS="WARNING"
EXIT=$STATE_WARNING
else
STATUS="CRITICAL"
EXIT=$STATE_CRITICAL
fi
RESPONSE=$FAILURE
EXIT=$STATE_CRITICAL
fi

echo $RESPONSE
echo "$STATUS: $RESPONSE"
exit $EXIT

0 comments on commit e8d6bf9

Please sign in to comment.
You can’t perform that action at this time.