check_http returning 400 Bad Request

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
gaugupt3
Posts: 3
Joined: Tue Oct 11, 2016 5:39 pm

check_http returning 400 Bad Request

Post 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
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_http returning 400 Bad Request

Post 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.
Former Nagios Employee
Locked