Invalid HTTP response received from host on port 443

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
techopscds
Posts: 2
Joined: Mon Nov 06, 2017 10:41 am

Invalid HTTP response received from host on port 443

Post 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!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Invalid HTTP response received from host on port 443

Post 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.
Former Nagios employee
techopscds
Posts: 2
Joined: Mon Nov 06, 2017 10:41 am

Re: Invalid HTTP response received from host on port 443

Post by techopscds »

@tmcdonald, Will do. Thanks!
Locked