check_http - 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.
Locked
xxxvii
Posts: 6
Joined: Tue Mar 01, 2016 9:33 am

check_http - HTTP WARNING: HTTP/1.1 400 Bad Request

Post 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?
User avatar
rhassing
Posts: 416
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

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

Post by rhassing »

Could you please provide your cpmmands.cfg (at least the chck_http config)?
Rob Hassing
Image
xxxvii
Posts: 6
Joined: Tue Mar 01, 2016 9:33 am

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

Post by xxxvii »

Code: Select all

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

rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

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

Post 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
Former Nagios Employee
xxxvii
Posts: 6
Joined: Tue Mar 01, 2016 9:33 am

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

Post by xxxvii »

Separating the FQDN and the remainder of the URL did the trick. Thanks!
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

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

Post 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.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked