diff --git a/check_curl.sh b/check_curl.sh index de03c36..0195e13 100755 --- a/check_curl.sh +++ b/check_curl.sh @@ -418,9 +418,9 @@ elif [ $(echo "$RESPONSE_TIME_MS > $WARN_TIME" | bc) -eq 1 ]; then fi # Check critical string -BODY_CONTAINS=" " +BODY_CONTAINS="" if [ -n "$CRIT_STRING" ]; then - BODY=$(curl -s $FOLLOW_REDIRECTS $INSECURE "$HEADERS" "$RESOLVE" "$TIMEOUT" "$URL") + BODY=$(curl -s $FOLLOW_REDIRECTS $INSECURE "$HEADERS" $RESOLVE $TIMEOUT "$URL") # shellcheck disable=SC2076 if ! [[ $BODY =~ "$CRIT_STRING" ]]; then if $SANITIZE_HTML; then @@ -429,7 +429,7 @@ if [ -n "$CRIT_STRING" ]; then echo "CRITICAL - response body does not contain the required string: $BODY" exit 2 else - BODY_CONTAINS=" and contained substring " + BODY_CONTAINS=" and contained substring" fi fi @@ -441,5 +441,5 @@ else perfdata_str="| $perfdata" fi -echo "OK - response time was $RESPONSE_TIME seconds, code $HTTP_CODE.${BODY_CONTAINS}-> $URL $perfdata_str" +echo "OK - response time was $RESPONSE_TIME seconds, code $HTTP_CODE${BODY_CONTAINS}. $perfdata_str" exit 0