Page 1 of 2
HTTP WARNING: HTTP/1.1 400 Bad Request
Posted: Tue Apr 14, 2020 1:54 pm
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
Re: HTTP WARNING: HTTP/1.1 400 Bad Request
Posted: Tue Apr 14, 2020 4:22 pm
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.
Re: HTTP WARNING: HTTP/1.1 400 Bad Request
Posted: Wed Apr 15, 2020 1:33 pm
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
Re: HTTP WARNING: HTTP/1.1 400 Bad Request
Posted: Wed Apr 15, 2020 2:30 pm
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?
Re: HTTP WARNING: HTTP/1.1 400 Bad Request
Posted: Thu Apr 16, 2020 1:03 am
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
Re: HTTP WARNING: HTTP/1.1 400 Bad Request
Posted: Thu Apr 16, 2020 2:02 pm
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
?
Re: HTTP WARNING: HTTP/1.1 400 Bad Request
Posted: Thu Apr 16, 2020 2:31 pm
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
Re: HTTP WARNING: HTTP/1.1 400 Bad Request
Posted: Thu Apr 16, 2020 2:42 pm
by cdienger
Please provide the check_http command definition as well as the host definition.
Re: HTTP WARNING: HTTP/1.1 400 Bad Request
Posted: Thu Apr 16, 2020 2:59 pm
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
Re: HTTP WARNING: HTTP/1.1 400 Bad Request
Posted: Thu Apr 16, 2020 4:24 pm
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$
}