Page 1 of 1
check_http warning for 404 Not Found
Posted: Mon Nov 07, 2016 5:28 pm
by vy3734
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?
Re: check_http warning for 404 Not Found
Posted: Mon Nov 07, 2016 5:34 pm
by mcapra
You might alter your command definition to leverage the -e argument:
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)
In practice:
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
Warnings are no good! When we instead leverage the -e argument to say the page's response code must be 200:
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 Found
Re: check_http warning for 404 Not Found
Posted: Tue Nov 08, 2016 8:49 pm
by vy3734
thanks, this working fine.
Re: check_http warning for 404 Not Found
Posted: Wed Nov 09, 2016 11:20 am
by rkennedy
Are we good to mark this thread as resolved?