check_curl
This commit is contained in:
parent
53359eea2b
commit
157b860f97
|
@ -87,7 +87,7 @@ OUTPUT_MSG=""
|
||||||
OUTPUT_CODE=0
|
OUTPUT_CODE=0
|
||||||
|
|
||||||
if [ $RESPONSE_CODE -eq 200 ] && [ "$(echo "$RESPONSE_TIME < $CRITICAL_LEVEL" | bc -l)" -eq 1 ]; then
|
if [ $RESPONSE_CODE -eq 200 ] && [ "$(echo "$RESPONSE_TIME < $CRITICAL_LEVEL" | bc -l)" -eq 1 ]; then
|
||||||
OUTPUT_MSG="OK: website is up and responded in $RESPONSE_TIME seconds."
|
OUTPUT_MSG="OK: ${RESPONSE_TIME}s - $url."
|
||||||
elif [ $RESPONSE_CODE -eq 200 ] && [ "$(echo "$RESPONSE_TIME < $WARNING_LEVEL" | bc -l)" -eq 1 ]; then
|
elif [ $RESPONSE_CODE -eq 200 ] && [ "$(echo "$RESPONSE_TIME < $WARNING_LEVEL" | bc -l)" -eq 1 ]; then
|
||||||
OUTPUT_MSG="WARNING: response time is slow ($RESPONSE_TIME seconds)."
|
OUTPUT_MSG="WARNING: response time is slow ($RESPONSE_TIME seconds)."
|
||||||
OUTPUT_CODE=1
|
OUTPUT_CODE=1
|
||||||
|
@ -112,9 +112,9 @@ rm -rf "$TMP_RESPONSE"
|
||||||
OUTPUT_MSG+=" | response_time=${RESPONSE_TIME}s;$WARNING_LEVEL;$CRITICAL_LEVEL;0"
|
OUTPUT_MSG+=" | response_time=${RESPONSE_TIME}s;$WARNING_LEVEL;$CRITICAL_LEVEL;0"
|
||||||
|
|
||||||
case $OUTPUT_CODE in
|
case $OUTPUT_CODE in
|
||||||
0)
|
#0)
|
||||||
echo "OK: $URL"
|
# echo "OK: $URL"
|
||||||
;;
|
# ;;
|
||||||
1)
|
1)
|
||||||
echo "WARNING: $URL"
|
echo "WARNING: $URL"
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue