Page 1 of 1

Invalid HTTP response received from host on port 443

Posted: Mon Nov 06, 2017 2:06 pm
by techopscds
Hi Team,

We have multiple sites using HTTP and recently we had to redirect few sites to HTTPS. After redirect we see the status information as
HTTP CRITICAL - Invalid HTTP response received from host: HTTP/1.1 301 Moved Permanently
, which seems to be correct. I would like to change the code in such a way that icinga checks only https across all the sites. Here are the changes I have made:

In
/etc/icinga/commands.cfg

Code: Select all

define command {
        command_name    check_https_200
        command_line    $USER1$/check_http -I $HOSTADDRESS$ -H $ARG1$ -e "HTTPS/1.1 200" -S
}
For host across all the sites:
#check for $website - HTTP response (code/time) public host
define service {
use generic-service
host_name $hostingMachine
service_description $website
check_command check_https_200!$website
}

Now I see this status
HTTP CRITICAL - Invalid HTTP response received from host on port 443: HTTP/1.1 200 OK
. When I run the command in
/usr/lib/nagios/plugins/
, it works perfectly fine.
./check_http -H site.du -p 443 -S
HTTP OK: HTTP/1.1 200 OK - 31826 bytes in 0.557 second response time |time=0.556850s;;;0.000000 size=31826B;;;0

Any help would be highly appreciated. Thank you!

Re: Invalid HTTP response received from host on port 443

Posted: Mon Nov 06, 2017 2:11 pm
by tmcdonald
techopscds wrote:I would like to change the code in such a way that icinga checks only https across all the sites.
You will need to contact Icinga for support with their software.

Re: Invalid HTTP response received from host on port 443

Posted: Mon Nov 06, 2017 2:36 pm
by techopscds
@tmcdonald, Will do. Thanks!