]> granicus.if.org Git - icinga2/commitdiff
ITL: Add "ldap" CheckCommand
authorÉlie Bouttier <elie@bouttier.eu>
Sat, 25 Apr 2015 04:13:27 +0000 (06:13 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Wed, 8 Jul 2015 07:45:10 +0000 (09:45 +0200)
refs #9172

Signed-off-by: Michael Friedrich <michael.friedrich@gmail.com>
doc/7-icinga-template-library.md
itl/command-plugins.conf

index 8c818032c1a599d39d2c9c666116f3f861a207e8..2191a79f9bbfc4cb32e7eec5741e93f41db07e7d 100644 (file)
@@ -437,6 +437,24 @@ imap_address    | **Optional.** The host's address. Defaults to "$address$" if t
 imap_port       | **Optional.** The port that should be checked. Defaults to 143.
 
 
+## <a id="plugin-check-command-ldap"></a> ldap
+
+Check command object for the `check_ldap` plugin.
+
+Custom Attributes:
+
+Name            | Description
+----------------|--------------
+ldap_address    | **Optional.** Host name, IP Address, or unix socket (must be an absolute path). Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise.
+ldap_port       | **Optional.** Port number. Defaults to 389.
+ldap_base       | **Required.** LDAP base (eg. ou=myunit,o=myorg,c=at).
+ldap_bind       | **Optional.** LDAP bind DN (if required).
+ldap_pass       | **Optional.** LDAP password (if required).
+ldap_starttls   | **Optional.** Use STARTSSL mechanism introduced in protocol version 3.
+ldap_ssl        | **Optional.** Use LDAPS. This also sets the default port to 636.
+ldap_v3         | **Optional.** Use LDAP protocol version 3 (default protocol version: 2)
+
+
 ## <a id="plugin-check-command-load"></a> load
 
 Check command object for the `check_load` plugin.
index 21b924b482f9e96d6892711fbfd7156e7ced204f..1b9563f536c868bfb9141c5475941e5cc05d0937 100644 (file)
@@ -1334,6 +1334,38 @@ object CheckCommand "icmp" {
        vars.icmp_cpl = 15
 }
 
+object CheckCommand "ldap" {
+    import "plugin-check-command"
+    import "ipv4-or-ipv6"
+
+       command = [
+               PluginDir + "/check_ldap",
+               "-H", "$ldap_address$",
+               "-b", "$ldap_base$"
+       ]
+
+       arguments = {
+               "-p" = "$ldap_port$"
+               "-a" = "$ldap_attr$"
+               "-D" = "$ldap_bind$"
+               "-P" = "$ldap_pass$"
+               "-T" = {
+                       set_if = "$ldap_starttls$"
+                       description = "Use STARTTLS mechanism"
+               }
+               "-S" = {
+                       set_if = "$ldap_ssl$"
+                       description = "Use LDAPS. This also sets the default port to 636"
+               }
+               "-3" = {
+                       set_if = "$ldap_v3$"
+                       description = "Use LDAP protocol version 3"
+               }
+       }
+
+    vars.ldap_address = "$check_address$"
+}
+
 /* Contrib plugins */
 object CheckCommand "running_kernel" {
        import "plugin-check-command"