1
0
mirror of https://github.com/opinkerfi/nagios-plugins.git synced 2024-12-22 09:03:54 +01:00

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

View File

@ -15,8 +15,7 @@ PAR_WARN=$5
PAR_CRIT=$6
#STATUSFILE=/tmp/status.`echo $RANDOM$RANDOM|cut -c1-4`
STATUSFILE=/tmp/xml.status
STATUSFILE=/tmp/status.`echo $RANDOM$RANDOM|cut -c1-4`
# Nagios return codes
STATE_OK=0
@ -38,6 +37,7 @@ print_usage() {
echo ""
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."
exit $STATE_UNKNOWN
}
# XML Parameter info:
# <system status="online" /> DONE
@ -93,7 +93,7 @@ if [ $PAR_WARN -ge $PAR_CRIT ]; then
exit $exitstatus
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
@ -304,7 +304,7 @@ case "$ARGS" in
exit $STATE_OK
esac
#rm -rf $STATUSFILE
rm -rf $STATUSFILE
exit $exitstatus