diff --git a/check_curl.sh b/check_curl.sh index 6e36357..c0b70bf 100755 --- a/check_curl.sh +++ b/check_curl.sh @@ -100,7 +100,7 @@ CURL_EXIT=$? # Parse curl output HTTP_CODE=$(echo "$CURL_OUTPUT" | cut -d ';' -f 1) -RESPONSE_TIME=$(echo "$CURL_OUTPUT" | cut -d ';' -f 2) +RESPONSE_TIME=$(echo "$CURL_OUTPUT" | cut -d ';' -f 2 | xargs printf "%0.2f\n") # Check curl exit status if [ $CURL_EXIT -ne 0 ]; then @@ -390,7 +390,7 @@ if [ $(echo "$RESPONSE_TIME_MS > $CRIT_TIME" | bc) -eq 1 ]; then echo "CRITICAL - Response time $RESPONSE_TIME seconds -> $URL | response_time=${RESPONSE_TIME_MS}ms" exit 2 elif [ $(echo "$RESPONSE_TIME_MS > $WARN_TIME" | bc) -eq 1 ]; then - echo "WARNING - response time $RESPONSE_TIME seconds -> $URL | response_time=${RESPONSE_TIME}s" + echo "WARNING - response time $RESPONSE_TIME seconds -> $URL | response_time=${RESPONSE_TIME_MS}s" exit 1 fi