t@ma209dlvmon libexec]# ./check_http -H ma209blvnav -p 8080
HTTP WARNING: HTTP/1.1 404 Not Found - 167 bytes in 0.003 second response time |time=0.003447s;;;0.000000 size=167B;;;
Why status is WARNING for 404 Not Found? Can status be changed to critical?
check_http warning for 404 Not Found
Re: check_http warning for 404 Not Found
You might alter your command definition to leverage the -e argument:
In practice:
Warnings are no good! When we instead leverage the -e argument to say the page's response code must be 200:
Code: Select all
-e, --expect=STRING
Comma-delimited list of strings, at least one of them is expected in
the first (status) line of the server response (default: HTTP/1.)
If specified skips all other status line logic (ex: 3xx, 4xx, 5xx processing)Code: Select all
[root@localhost libexec]# ./check_http -H www.google.com -u "/test.html" -p 80
HTTP WARNING: HTTP/1.1 404 Not Found - 1714 bytes in 0.098 second response time |time=0.098465s;;;0.000000 size=1714B;;;0
Code: Select all
[root@localhost libexec]# ./check_http -H www.google.com -u "/test.html" -p 80 -e "200"
HTTP CRITICAL - Invalid HTTP response received from host: HTTP/1.1 404 Not FoundFormer Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
Re: check_http warning for 404 Not Found
thanks, this working fine.
Re: check_http warning for 404 Not Found
Are we good to mark this thread as resolved?
Former Nagios Employee