check_http - HTTP WARNING: HTTP/1.1 400 BAD REQUEST

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
sureshkraj2012
Posts: 65
Joined: Tue Aug 06, 2013 11:06 pm

check_http - HTTP WARNING: HTTP/1.1 400 BAD REQUEST

Post by sureshkraj2012 »

COMMAND: /usr/local/nagios/libexec/check_http -H 10.101.2.10 -p 7000 -v
OUTPUT: GET / HTTP/1.0
User-Agent: check_http/v2053 (nagios-plugins 1.4.13)
Connection: close
Host: 10.101.2.10:7000


http://10.101.2.10:7000/ is 214 characters
STATUS: HTTP/1.1 400 BAD REQUEST
**** HEADER ****
Date: Mon, 20 Jan 2014 02:26:37 GMT
Server: Apache/2.2.22 (Ubuntu)
Vary: Accept-Encoding
Content-Length: 15
Connection: close
Content-Type: text/html; charset=utf-8
**** CONTENT ****
Welcome to HomePage
HTTP WARNING: HTTP/1.1 400 BAD REQUEST


Any idea? How to fix this error?
sureshkraj2012
Posts: 65
Joined: Tue Aug 06, 2013 11:06 pm

Re: check_http - HTTP WARNING: HTTP/1.1 400 BAD REQUEST

Post by sureshkraj2012 »

Forgot to mention it, I even tried with -I option but no luck getting same output

COMMAND: /usr/local/nagios/libexec/check_http -I 10.101.2.10 -p 7000 -v
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: check_http - HTTP WARNING: HTTP/1.1 400 BAD REQUEST

Post by slansing »

Can you show the output of the following:

Code: Select all

nmap -p 7000 10.101.2.10
Are you able to navigate to that address, with that port normally?
sureshkraj2012
Posts: 65
Joined: Tue Aug 06, 2013 11:06 pm

Re: check_http - HTTP WARNING: HTTP/1.1 400 BAD REQUEST

Post by sureshkraj2012 »

Yeah. I can able to telnet to that port and navigate to the page without any issue
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: check_http - HTTP WARNING: HTTP/1.1 400 BAD REQUEST

Post by lmiltchev »

What happens when you add

Code: Select all

-k "Accept: text/html"
to the check command? Did this solve the problem?
Be sure to check out our Knowledgebase for helpful articles and solutions!
sureshkraj2012
Posts: 65
Joined: Tue Aug 06, 2013 11:06 pm

Re: check_http - HTTP WARNING: HTTP/1.1 400 BAD REQUEST

Post by sureshkraj2012 »

No luck, still seeing same response

COMMAND: /usr/local/nagios/libexec/check_http -I 10.101.2.10 -p 7000 -k "Accept: text/html" -v
OUTPUT: GET / HTTP/1.0
User-Agent: check_http/v2053 (nagios-plugins 1.4.13)
Connection: close
Accept: text/html


http://10.101.2.10:7000/ is 214 characters
STATUS: HTTP/1.1 400 BAD REQUEST
**** HEADER ****
Date: Wed, 22 Jan 2014 03:58:56 GMT
Server: Apache/2.2.22 (Ubuntu)
Vary: Accept-Encoding
Content-Length: 15
Connection: close
Content-Type: text/html; charset=utf-8
**** CONTENT ****
NodeID required
HTTP WARNING: HTTP/1.1 400 BAD REQUEST
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http - HTTP WARNING: HTTP/1.1 400 BAD REQUEST

Post by scottwilkerson »

how about running this from the CLI on the Nagios server

Code: Select all

curl -vvv http://10.101.2.10:7000/|head -50
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
sureshkraj2012
Posts: 65
Joined: Tue Aug 06, 2013 11:06 pm

Re: check_http - HTTP WARNING: HTTP/1.1 400 BAD REQUEST

Post by sureshkraj2012 »

Thank you, Scott
Will get back to you the results
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http - HTTP WARNING: HTTP/1.1 400 BAD REQUEST

Post by scottwilkerson »

Please do, I would like to see what a standard curl response to this URL is...

thanks
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
sureshkraj2012
Posts: 65
Joined: Tue Aug 06, 2013 11:06 pm

Re: check_http - HTTP WARNING: HTTP/1.1 400 BAD REQUEST

Post by sureshkraj2012 »

Sorry for the delay

Here is the output

curl -vvv http://10.101.2.10:7000/|head -50
* About to connect() to 10.101.2.10 port 7000 (#0)
* Trying 10.101.2.10... connected
* Connected to 10.101.2.10 (10.101.2.10) port 7000 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2
> Host: 10.101.2.10:7000
> Accept: */*
>
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0< HTTP/1.1 400 BAD REQUEST
< Date: Wed, 26 Feb 2014 14:15:27 GMT
< Server: Apache/2.2.22 (Ubuntu)
< Vary: Accept-Encoding
< Content-Length: 15
< Connection: close
< Content-Type: text/html; charset=utf-8
<
{ [data not shown]
0 15 0 15 0 0 2591 0 --:--:-- --:--:-- --:--:-- 3750* Closing connection #0
Locked