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
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
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