Nagios – https active service fails (error while receiving)

nagios

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.

Best Answer

You may not be able to see anything else wrong, but I can:

[me@risby]$ openssl s_client -connect www.c-onDocFlow.de:443
CONNECTED(00000003)
[...]
Certificate chain
 0 s:/OU=Domain Control Validated/OU=PositiveSSL/CN=www.dbregio-nwn.de
   i:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2
 1 s:/C=GB/ST=Greater Manchester/L=Salford/O=COMODO CA Limited/CN=PositiveSSL CA 2
   i:/C=SE/O=AddTrust AB/OU=AddTrust External TTP Network/CN=AddTrust External CA Root
---
[much certificate stuff deleted]
---
GET /
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>503 Service Temporarily Unavailable</title>
</head><body>
<h1>Service Temporarily Unavailable</h1>
<p>The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.</p>
</body></html>

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.