License
Apache License 2.0
check_http now supports querying a JSON response with the GoJSONQ package. See the examples below for using this new feature.
.\check_http.exe -h
#Perform an HTTP get request and assert whether it is OK, warning or critical.
#
#Usage:
#  check_http [flags]
#  check_http [command]
#
#Available Commands:
#  help        Help about any command
#  version     Print the version
#
#Flags:
#  -e, --expectedValue string   The expected response data value
#  -f, --format string          The expected response format: json
#  -h, --help                   help for check_http
#  -p, --path string            The path in the return value data to test against the expected value
#  -r, --redirect               follow redirects?
#  -t, --timeout int            timeout in seconds (default 15)
#  -u, --url string             the URL to check (default "http://127.0.0.1")
#
#Use "check_http [command] --help" for more information about a command.
.\check_http.exe -u https://icanhazdadjoke.com/j/HeaFdiyIJe
# CheckHttp OK - Url https://icanhazdadjoke.com/j/HeaFdiyIJe responded with 200
.\check_http.exe -u https://icanhazdadjoke.com/j/HeaFdiyIJe  -f json -p id -e HeaFdiyIJe
# CheckHttp OK - Url https://icanhazdadjoke.com/j/HeaFdiyIJe responded with 200. The value found at id has expected value HeaFdiyIJe
.\check_http.exe -u https://icanhazdadjoke.com/j/HeaFdiyIJe  -f json -p id -e UROBOROS
# CheckHttp CRITICAL - Url https://icanhazdadjoke.com/j/HeaFdiyIJe responded with 200. The value found at id has unexpected value HeaFdiyIJe
.\check_http.exe -u https://icanhazdadjoke.com/j/HeaFdiyIJe  -f json -p "data.id.sets[0].value" -e HeaFdiyIJe
# CheckHttp CRITICAL - Url https://icanhazdadjoke.com/j/HeaFdiyIJe responded with 200. The value found at data.id.sets[0].value has unexpected value <nil>
Please describe the reason for reporting this asset. Our moderators will be notified and will disable the asset if it is found to be inappropriate.
×