From ef9c73420677afec147aa259ff0439ac228b709d Mon Sep 17 00:00:00 2001 From: Stefan Huber Date: Sat, 18 Mar 2017 10:07:02 +0100 Subject: [PATCH] nagios: Fix check_rdns return codes Instead of STATE_* variables mistyped counterparts STATUS_* were returned as exit codes. Reported-by: Ralph Oesker --- nagios/plugins/check_rdns | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 -- 2.39.5