From: Stefan Huber Date: Sat, 18 Mar 2017 09:07:02 +0000 (+0100) Subject: nagios: Fix check_rdns return codes X-Git-Url: https://git.sthu.org/?a=commitdiff_plain;h=ef9c73420677afec147aa259ff0439ac228b709d;p=shutils.git nagios: Fix check_rdns return codes Instead of STATE_* variables mistyped counterparts STATUS_* were returned as exit codes. Reported-by: Ralph Oesker --- diff --git a/nagios/plugins/check_rdns b/nagios/plugins/check_rdns index 90a8ce6..f99792b 100755 --- a/nagios/plugins/check_rdns +++ b/nagios/plugins/check_rdns @@ -104,14 +104,14 @@ DIGSTATUS=$? if [ $DIGSTATUS != "0" ]; then echo "DNS failed: dig exit code $DIGSTATUS |" - exit $STATUS_CRITICAL + exit $STATE_CRITICAL fi # Get the actual result HOST=$(echo "$RESULT" | grep -m 1 -o "[[:space:]]IN[[:space:]]*PTR[[:space:]].*\.$" | awk '{ print $3 }' ) if [ -z "$HOST" ]; then echo "DNS failed: reverse DNS gave no answer. |" - exit $STATUS_CRITICAL + exit $STATE_CRITICAL fi @@ -123,7 +123,7 @@ MATCHED= if [ -n "$EXPECT" ]; then if [ "$EXPECT" != "$HOST" ]; then echo "DNS critical - query result \"$HOST\" != \"$EXPECT\", query time: $QUERYTIME msec |" - exit $STATUS_CRITICAL + exit $STATE_CRITICAL else MATCHED=" (match ok)" fi @@ -131,14 +131,14 @@ fi if [ -n "$CRITICAL" ] && [ "$QUERYTIME" -gt "$CRITICAL" ]; then echo "DNS critical - query time $QUERYTIME msec too large ($CRITICAL msec), query result: \"$HOST\"$MATCHED |" - exit $STATUS_CRITICAL + exit $STATE_CRITICAL fi if [ -n "$WARNING" ] && [ "$QUERYTIME" -gt "$WARNING" ]; then echo "DNS warning - query time $QUERYTIME msec too large ($WARNING msec), query result: \"$HOST\"$MATCHED |" - exit $STATUS_WARNING + exit $STATE_WARNING fi echo "DNS OK - query time $QUERYTIME msec, query result: \"$HOST\"$MATCHED |" -exit $STATUS_OK +exit $STATE_OK