From 554bebfe59822b62e8bc6a18c71490767deca941 Mon Sep 17 00:00:00 2001 From: Chl Date: Sun, 5 Jan 2020 21:29:44 +0100 Subject: [PATCH] nagios/glue_records: small corr. --- nagios/check_glue_records.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nagios/check_glue_records.sh b/nagios/check_glue_records.sh index 65f67d4..3fcd9e0 100755 --- a/nagios/check_glue_records.sh +++ b/nagios/check_glue_records.sh @@ -102,8 +102,7 @@ while [ "$#" -gt 0 ]; do fi for IPADDR in $LIST_IP_NS_SERVERS; do # Query our server - OUTPUT=$( dig @"$IPADDR" $DOMAIN SOA +short 2>&1 ) - if [ "$?" -eq 0 ]; then + if OUTPUT=$( dig @"$IPADDR" $DOMAIN SOA +short 2>&1 ); then # The server responded, store the SOA for later analyze LIST_SOA="$( printf "%s\n%s" "$LIST_SOA" "$OUTPUT" | grep -v "^$" )" else @@ -112,7 +111,7 @@ while [ "$#" -gt 0 ]; do OUTPUT_DETAIL_CRITICAL="Problematic server behind IP" OUTPUT_EXIT_STATUS=$STATE_CRITICAL fi - OUTPUT_DETAIL_CRITICAL="$OUTPUT_DETAIL_CRITICAL $IPADDRESS" + OUTPUT_DETAIL_CRITICAL="$OUTPUT_DETAIL_CRITICAL $IPADDR" fi done