We have multiple sites using HTTP and recently we had to redirect few sites to HTTPS. After redirect we see the status information as
, 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:HTTP CRITICAL - Invalid HTTP response received from host: HTTP/1.1 301 Moved Permanently
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
}
#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
. When I run the command inHTTP CRITICAL - Invalid HTTP response received from host on port 443: HTTP/1.1 200 OK
, it works perfectly fine./usr/lib/nagios/plugins/
./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!