check_curl
This commit is contained in:
parent
0cb66ef0b3
commit
92e9006a45
|
@ -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: ${RESPONSE_TIME}s - $URL."
|
OUTPUT_MSG="OK: ${RESPONSE_TIME}s - $URL"
|
||||||
OUTPUT_CODE=0
|
OUTPUT_CODE=0
|
||||||
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)."
|
||||||
|
@ -122,8 +122,8 @@ case $OUTPUT_CODE in
|
||||||
2)
|
2)
|
||||||
echo "CRITICAL: $URL"
|
echo "CRITICAL: $URL"
|
||||||
;;
|
;;
|
||||||
*)
|
3)
|
||||||
echo "CRITICAL: $URL"
|
echo "UNKNOWN: $URL"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue