From: Élie Bouttier Date: Sat, 25 Apr 2015 04:13:27 +0000 (+0200) Subject: ITL: Add "ldap" CheckCommand X-Git-Tag: v2.3.6~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=949e626b73470706c1309e091d8e0971c9633a29;p=icinga2 ITL: Add "ldap" CheckCommand refs #9172 Signed-off-by: Michael Friedrich --- diff --git a/doc/7-icinga-template-library.md b/doc/7-icinga-template-library.md index 8c818032c..2191a79f9 100644 --- a/doc/7-icinga-template-library.md +++ b/doc/7-icinga-template-library.md @@ -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. +## 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) + + ## load Check command object for the `check_load` plugin. diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index 21b924b48..1b9563f53 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -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"