]> granicus.if.org Git - icinga2/commitdiff
Add "ssl" CheckCommand
authorGerd von Egidy <gerd@egidy.de>
Sun, 15 Jun 2014 21:58:46 +0000 (23:58 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Mon, 16 Jun 2014 06:49:52 +0000 (08:49 +0200)
Refs #6487

doc/6-configuring-icinga-2.md
itl/command-plugins.conf

index f9b331ebfa389e74d98f29bac445498ac40cdd77..16a0ac4de403ed1f40d3946367ce5723740bd450 100644 (file)
@@ -1834,6 +1834,20 @@ Name            | Description
 tcp_address     | **Optional.** The host's address. Defaults to "$address$".
 tcp_port        | **Required.** The port that should be checked.
 
+#### <a id="plugin-check-command-ssl"></a> ssl
+
+Check command object for the `check_tcp` plugin, using ssl-related options.
+
+Custom Attributes:
+
+Name                          | Description
+------------------------------|--------------
+ssl_address                   | **Optional.** The host's address. Defaults to "$address$".
+ssl_port                      | **Required.** The port that should be checked.
+ssl_timeout                   | **Optional.** Timeout in seconds for the connect and handshake. The plugin default is 10 seconds.
+ssl_cert_valid_days_warn      | **Optional.** Warning threshold for days before the certificate will expire. When used, ssl_cert_valid_days_critical must also be set.
+ssl_cert_valid_days_critical  | **Optional.** Critical threshold for days before the certificate will expire. When used, ssl_cert_valid_days_warn must also be set.
+
 #### <a id="plugin-check-command-udp"></a> udp
 
 Check command object for the `check_udp` plugin.
index bc1ccdb3f5acb75589d3fdf0f43c3bf29db46436..e1ee1ae4ec2318a984aa3162d945fe2608e1c5e9 100644 (file)
@@ -96,6 +96,25 @@ object CheckCommand "tcp" {
        vars.tcp_address = "$address$"
 }
 
+object CheckCommand "ssl" {
+       import "plugin-check-command"
+
+       command = PluginDir + "/check_tcp"
+
+       arguments = {
+               "-H" = "$ssl_address$"
+               "-p" = "$ssl_port$"
+               "--ssl" = { }
+               "--timeout" = "$ssl_timeout$"
+               "-D" = {
+                       set_if = len("$ssl_cert_valid_days_warn$") > 0 && len("$ssl_cert_valid_days_critical$") > 0
+                       value = "$ssl_cert_valid_days_warn$,$ssl_cert_valid_days_critical$"
+               }
+       }
+
+       vars.ssl_address = "$address$"
+}
+
 object CheckCommand "udp" {
        import "plugin-check-command"