Page 1 of 1

check_http - HTTP WARNING: HTTP/1.1 400 Bad Request

Posted: Tue Mar 01, 2016 9:48 am
by xxxvii
I've set up monitoring for a specific HTTPS website, but am getting the following warning on the Nagios web interface:
HTTP WARNING: HTTP/1.1 400 Bad Request - 513 bytes in 0.159 second response time

Here's what the service definition looks like:

Code: Select all

define service{
        use                     generic-service         ; Inherit default value$
        host_name               hostxyz
        service_description     HTTPS - Site X
        check_command           check_http! -H inter-w01-dev.ent.abc.com/applications/SiteX -S
        }
I should mention that I've ran curl on the URL (see code below) and it did successfully return the page source, so I'm unsure why I keep receiving the 400 Bad Request warning from within Nagios.

Code: Select all

curl https://inter-w01-dev.ent.abc.com/applications/SiteX 
Am I missing something?

Re: check_http - HTTP WARNING: HTTP/1.1 400 Bad Request

Posted: Tue Mar 01, 2016 10:17 am
by rhassing
Could you please provide your cpmmands.cfg (at least the chck_http config)?

Re: check_http - HTTP WARNING: HTTP/1.1 400 Bad Request

Posted: Tue Mar 01, 2016 10:22 am
by xxxvii

Code: Select all

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


Re: check_http - HTTP WARNING: HTTP/1.1 400 Bad Request

Posted: Tue Mar 01, 2016 2:44 pm
by rkennedy
What happens if you change it to check_command check_http!-H inter-w01-dev.ent.abc.com -u "/applications/SiteX" -S? The -u flag is for anything after your FQDN.

Also - can you post your host definition as well?

For reference, the -I in your check_http command may cause issues too -

Code: Select all

[root@suse11 libexec]# ./check_http -I 192.168.4.254 -H 192.168.4.254/nagiosxi/images/loginsplash.png
HTTP WARNING: HTTP/1.1 400 Bad Request - 519 bytes in 0.000 second response time |time=0.000280s;;;0.000000 size=519B;;;0

[root@suse11 libexec]# ./check_http -H 192.168.4.254 -u '/nagiosxi/images/loginsplash.png'
HTTP OK: HTTP/1.1 200 OK - 71078 bytes in 0.000 second response time |time=0.000459s;;;0.000000 size=71078B;;;0

[root@suse11 libexec]# ./check_http -I 192.168.4.254 -H 192.168.4.254 -u '/nagiosxi/images/loginsplash.png'
HTTP OK: HTTP/1.1 200 OK - 71078 bytes in 0.000 second response time |time=0.000414s;;;0.000000 size=71078B;;;0

Re: check_http - HTTP WARNING: HTTP/1.1 400 Bad Request

Posted: Wed Mar 02, 2016 8:08 am
by xxxvii
Separating the FQDN and the remainder of the URL did the trick. Thanks!

Re: check_http - HTTP WARNING: HTTP/1.1 400 Bad Request

Posted: Wed Mar 02, 2016 11:09 am
by bwallace
Thanks for that update and glad to hear it worked out. I'll lock this thread now but feel free to open another if you need assistance with anything else.