Bugfix, return status UNKNOWN if there is invalid syntax

This commit is contained in:
Páll Guðjón Sigurðsson 2010-12-14 16:23:50 +00:00
parent 2ba163a879
commit e6c0421abc
1 changed files with 4 additions and 4 deletions

View File

@ -15,8 +15,7 @@ PAR_WARN=$5
PAR_CRIT=$6 PAR_CRIT=$6
#STATUSFILE=/tmp/status.`echo $RANDOM$RANDOM|cut -c1-4` STATUSFILE=/tmp/status.`echo $RANDOM$RANDOM|cut -c1-4`
STATUSFILE=/tmp/xml.status
# Nagios return codes # Nagios return codes
STATE_OK=0 STATE_OK=0
@ -38,6 +37,7 @@ print_usage() {
echo "" echo ""
echo "parameters for STATUS are ignored but must be provided. The results for STATUS can be OK or critical." echo "parameters for STATUS are ignored but must be provided. The results for STATUS can be OK or critical."
echo "parameters for RESOURSECONSERVATION should be 1 and 2." echo "parameters for RESOURSECONSERVATION should be 1 and 2."
exit $STATE_UNKNOWN
} }
# XML Parameter info: # XML Parameter info:
# <system status="online" /> DONE # <system status="online" /> DONE
@ -93,7 +93,7 @@ if [ $PAR_WARN -ge $PAR_CRIT ]; then
exit $exitstatus exit $exitstatus
fi fi
#wget --http-user=$USER --http-password=$PASSWORD --no-check-certificate --no-proxy https://$HOSTNAME/xml/status --output-document=$STATUSFILE >> /dev/null 2>&1 wget --http-user=$USER --http-password=$PASSWORD --no-check-certificate --no-proxy https://$HOSTNAME/xml/status --output-document=$STATUSFILE >> /dev/null 2>&1
#wget --http-user=$USER --http-password=$PASSWORD --no-check-certificate https://$HOSTNAME/xml/status --output-document=$STATUSFILE >> /dev/null 2>&1 #wget --http-user=$USER --http-password=$PASSWORD --no-check-certificate https://$HOSTNAME/xml/status --output-document=$STATUSFILE >> /dev/null 2>&1
@ -304,7 +304,7 @@ case "$ARGS" in
exit $STATE_OK exit $STATE_OK
esac esac
#rm -rf $STATUSFILE rm -rf $STATUSFILE
exit $exitstatus exit $exitstatus