check_curl help message
This commit is contained in:
parent
92e9006a45
commit
9fa8c95210
20
check_curl
20
check_curl
|
@ -3,6 +3,16 @@
|
||||||
# Define the usage message
|
# Define the usage message
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $0 -u <url> [-w <warning>] [-c <critical>] [-C <contains>] [-L] [-I] [-H <headers>] [-p] [-R]"
|
echo "Usage: $0 -u <url> [-w <warning>] [-c <critical>] [-C <contains>] [-L] [-I] [-H <headers>] [-p] [-R]"
|
||||||
|
echo "[Arguments]:
|
||||||
|
-u Specify the URL to check (required).
|
||||||
|
-w Set the warn level for response time (default: 1 second).
|
||||||
|
-c Set the critical level for response time (default: 2 seconds).
|
||||||
|
-C If the body does not contain this string, return CRITICAL.
|
||||||
|
-L Follow redirects.
|
||||||
|
-I Insecure mode (--insecure).
|
||||||
|
-H Specify headers. Formatted like \"Header1: value,Header2: value\"
|
||||||
|
-p Print the curl command and exit
|
||||||
|
-R Set curl --resolve option."
|
||||||
exit 3
|
exit 3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,12 +70,10 @@ for value in "${values[@]}"; do
|
||||||
HEADER_ARGS+=' -H "'$value'" '
|
HEADER_ARGS+=' -H "'$value'" '
|
||||||
done
|
done
|
||||||
|
|
||||||
CURL_CMD=""
|
#if $PRINT_ONLY; then
|
||||||
|
# echo "curl $CURL_CMD"
|
||||||
if $PRINT_ONLY; then
|
# exit 3
|
||||||
echo "curl $CURL_CMD"
|
#fi
|
||||||
exit 3
|
|
||||||
fi
|
|
||||||
|
|
||||||
TMP_ERROR_LOG=$(mktemp)
|
TMP_ERROR_LOG=$(mktemp)
|
||||||
TMP_RESPONSE=$(mktemp)
|
TMP_RESPONSE=$(mktemp)
|
||||||
|
|
Loading…
Reference in New Issue