HTTP WARNING: HTTP/1.1 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.
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: HTTP WARNING: HTTP/1.1 400 Bad Request

Post by epixelitsupport »

cdienger wrote:Yes, and you should also have one for the host that looks like:

Code: Select all

define host {
    host_name ...
    address ...
    ...
}
The likely problem is that using "-I" causes the check to use the IP address which may not work if the IP hosts multiple websites. Change the command to use -H instead:

Code: Select all

define command{
	command_name 	check_http
	command_line	$USER1$/check_http -I $HOSTADDRESS$ $ARG1$
}	

Here its is https://prnt.sc/s0t615

and I have already changed to H from I
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: HTTP WARNING: HTTP/1.1 400 Bad Request

Post by cdienger »

The value for host_name appears to have a space "... Server". This needs to be a valid hostname that can resolve to an IP.

You can test the command directly with:

Code: Select all

./check_http -I <hostname>
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: HTTP WARNING: HTTP/1.1 400 Bad Request

Post by epixelitsupport »

cdienger wrote:The value for host_name appears to have a space "... Server". This needs to be a valid hostname that can resolve to an IP.

You can test the command directly with:

Code: Select all

./check_http -I <hostname>
I will share you my conf file as PM Please check,
Only this project is not working this for me
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: HTTP WARNING: HTTP/1.1 400 Bad Request

Post by cdienger »

I did not receive a PM. Please try sending again. I would also appreciate the output seen when running the command like so:

Code: Select all

/usr/local/nagios/libexec/check_http -I nginx_hostname -v
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: HTTP WARNING: HTTP/1.1 400 Bad Request

Post by epixelitsupport »

cdienger wrote:I did not receive a PM. Please try sending again. I would also appreciate the output seen when running the command like so:

Code: Select all

/usr/local/nagios/libexec/check_http -I nginx_hostname -v
here it is
https://prnt.sc/s1blxv

and I have resent the conf file
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: HTTP WARNING: HTTP/1.1 400 Bad Request

Post by cdienger »

Modify the host definition so that the address line uses the fqdn instead:

Code: Select all

define host{
use                             linux-box              
host_name                       ... Server                 
alias                           ... Server            
address                         ....com  
}
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
epixelitsupport
Posts: 85
Joined: Fri Nov 08, 2019 2:40 am

Re: HTTP WARNING: HTTP/1.1 400 Bad Request

Post by epixelitsupport »

Thats not helping ,

All the services getting down when I changed to it https://prnt.sc/s1fzjw I have only problem with the Nginx port checking all the services are running good
Locked