I want to check the availability of a SSL Web site (https) with nagios.
I have add a command to the command.cfg:
define command{
command_name check_http_myserver_Demo
command_line $USER1$/check_http -H www.mydomain.de -u /Demo -p 443 -S
}
Then I have add also a service in the localhost.cfg:
define service {
use local-service
host_name myServer
service_description HTTP myserver Response Check
check_command check_http_myserver_Demo
max_check_attempts 2
normal_check_interval 5
retry_check_interval 1
notification_interval 240
notification_period 24x7
notification_options w,u,c,r
}
If I check the configuration file with "nagios -v nagios.cfg" I'm getting no errors.
The nagios server check of this service is negativ and says "HTTP CRITICAL - Fehler beim Empfangen" (it's german; my translation: "error while receiving"). But the service is definitive available. I can open a browser and can open the URL without problems.
Any ideas?
EDIT:
If I run the check manually I get:
/usr/lib64/nagios/plugins/check_http -v -H www.c-onDocFlow.de -u / -S
GET / HTTP/1.1
User-Agent: check_http/v1.4.15 (nagios-plugins 1.4.15)
Connection: close
Host: www.c-onDocFlow.de
HTTP CRITICAL - Fehler beim Empfangen
Without "-S" it runs ok. Also if I take a other https side (of a other domain) it's ok. May be something is with the certificate wrong, but I cannot see any problem.
You may not be able to see anything else wrong, but I can:
You say you can get the root page from the webserver with a browser no problem ("the service is definitive available"); is it from the NAGIOS server that you succeed in doing that, and could we see some evidence? At the moment, it looks like NAGIOS is quite rightly telling you that the server's not giving out any content at all.
Heres how to fix this!
You have to edit the /usr/local/nagios/etc/objects/commands.cfg and change the https arument "-I" to "-H"
This will tell it to lookup hostname instead of an dip-address specified in your http_check block in server config: /usr/local/nagios/etc/servers/yourserver.cfg
from:
To: