Page 1 of 1

check_http returning 400 Bad Request

Posted: Tue Oct 11, 2016 5:42 pm
by gaugupt3
when I use check_http -I IP_address -p 50075 -v -N -L, I get
<A HREF="http://IP_address:50075/" target="_blank">GET / HTTP/1.0
User-Agent: check_http/v2.0.3 (nagios-plugins 2.0.3)
Connection: close
Accept: */*


http://IP_address:50075/ is 70 characters
STATUS: HTTP/1.1 400 Bad Request
**** HEADER ****
Connection: close
Server: Jetty(6.1.26)
**** CONTENT ****
[[ skipped ]]
HTTP WARNING: HTTP/1.1 400 Bad Request - 70 bytes in 0.010 second response time </A>|time=0.010237s;;;0.000000 size=70B;;;0

but if I use hostname for the same host, I get HTTP /OK status. I am not sure what is happening.. Any pointers

Re: check_http returning 400 Bad Request

Posted: Wed Oct 12, 2016 10:38 am
by rkennedy
It sounds like there is a virtualhost setup, which is expecting the DNS name and not the IP. You'll want to use the hostname for the check.