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

HTTP WARNING: HTTP/1.1 400 Bad Request

Post by epixelitsupport »

Hi , Im using Cloudflare and nginx in hosting server and I'm getting this warning in nagios GUI

Its showing error as HTTP WARNING: HTTP/1.1 400 Bad Request - 166 bytes in 0.472 second response time

Please let me a solution for this to get rid of it

Thank you in Advance
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 »

What OS is it installed on ? It sounds like there is a problem with nginx config. Did you follow specific steps from a source you can link to? https://www.linuxhelp.com/how-to-instal ... -on-centos steps through installing nagios with nginx on a cent machine.
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:What OS is it installed on ? It sounds like there is a problem with nginx config. Did you follow specific steps from a source you can link to? https://www.linuxhelp.com/how-to-instal ... -on-centos steps through installing nagios with nginx on a cent machine.
Iam using Ubuntu 18.04 and this is the error I'm getting https://prnt.sc/s012bq

Please check it
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 »

Okay. I misunderstood initially. It sounds like you are using Nagios to check on the nginx server. What does the configuration of this service check look like and what plugin are you using?
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:Okay. I misunderstood initially. It sounds like you are using Nagios to check on the Nginx server. What does the configuration of this service check look like and what plugin are you using?
I'm using nrpe on the client server and this is how we are running the command in nations server https://prnt.sc/s0argw
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 »

What does the host definition look like?

Try running the following from the command line:

Code: Select all

/usr/local/nagios/libexec/check_http -H nginx_address -v
curl nginx_address -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:What does the host definition look like?

Try running the following from the command line:

Code: Select all

/usr/local/nagios/libexec/check_http -H nginx_address -v
curl nginx_address -v
?
Yes That one is Working Perfectly here
https://prnt.sc/s0r0zl
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 »

Please provide the check_http command definition as well as the host definition.
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:Please provide the check_http command definition as well as the host definition.
means , where I get this?

is this asking for https://prnt.sc/s0rp8p

And this also https://prnt.sc/s0s71j
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 »

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$
}	
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked