[icinga-checkins] icinga.org: icinga2/next: Add "ssl" CheckCommand

git at icinga.org git at icinga.org
Mon Jun 16 08:57:49 CEST 2014


Module: icinga2
Branch: next
Commit: dedb16b2c8281d5daf4707e6cc8d410bad185e9e
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=dedb16b2c8281d5daf4707e6cc8d410bad185e9e

Author: Gerd von Egidy <gerd at egidy.de>
Date:   Sun Jun 15 23:58:46 2014 +0200

Add "ssl" CheckCommand

Refs #6487

---

 doc/6-configuring-icinga-2.md |   14 ++++++++++++++
 itl/command-plugins.conf      |   19 +++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/doc/6-configuring-icinga-2.md b/doc/6-configuring-icinga-2.md
index f9b331e..16a0ac4 100644
--- a/doc/6-configuring-icinga-2.md
+++ b/doc/6-configuring-icinga-2.md
@@ -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.
diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf
index bc1ccdb..e1ee1ae 100644
--- a/itl/command-plugins.conf
+++ b/itl/command-plugins.conf
@@ -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"
 



More information about the icinga-checkins mailing list