Page 1 of 2

check_http - HTTP WARNING: HTTP/1.1 400 BAD REQUEST

Posted: Sun Jan 19, 2014 9:30 pm
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?

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

Posted: Sun Jan 19, 2014 9:32 pm
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

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

Posted: Mon Jan 20, 2014 11:09 am
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?

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

Posted: Tue Jan 21, 2014 12:16 am
by sureshkraj2012
Yeah. I can able to telnet to that port and navigate to the page without any issue

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

Posted: Tue Jan 21, 2014 3:54 pm
by lmiltchev
What happens when you add

Code: Select all

-k "Accept: text/html"
to the check command? Did this solve the problem?

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

Posted: Tue Jan 21, 2014 11:01 pm
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

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

Posted: Wed Jan 22, 2014 8:27 am
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

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

Posted: Mon Jan 27, 2014 8:52 pm
by sureshkraj2012
Thank you, Scott
Will get back to you the results

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

Posted: Mon Jan 27, 2014 9:33 pm
by scottwilkerson
Please do, I would like to see what a standard curl response to this URL is...

thanks

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

Posted: Wed Feb 26, 2014 9:18 am
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