]> granicus.if.org Git - icinga2/commitdiff
ITL: Add more options to ldap CheckCommand
authorNiflou <dubuscyr@gmail.com>
Wed, 5 Apr 2017 12:50:08 +0000 (14:50 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Thu, 20 Apr 2017 10:14:56 +0000 (12:14 +0200)
Adding the -W and -C (warning entries and critical entries) options

fixes #5139

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

index 0bf0fac2907f826c2f361b894721c809ff1a13f6..7b0e7c86595722c992d8f2ac292827318adb7cb0 100644 (file)
@@ -673,22 +673,24 @@ This can be ensured by enabling `ldap_starttls` or `ldap_ssl`.
 
 Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters):
 
-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_attr      | **Optional.** LDAP attribute to search for (default: "(objectclass=*)"
-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 (LDAP v2 SSL method). This also sets the default port to 636.
-ldap_v2         | **Optional.** Use LDAP protocol version 2 (enabled by default).
-ldap_v3         | **Optional.** Use LDAP protocol version 3 (disabled by default)
-ldap_warning   | **Optional.** Response time to result in warning status (seconds).
-ldap_critical  | **Optional.** Response time to result in critical status (seconds).
-ldap_timeout   | **Optional.** Seconds before connection times out (default: 10).
-ldap_verbose   | **Optional.** Show details for command-line debugging (disabled by default)
+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_attr              | **Optional.** LDAP attribute to search for (default: "(objectclass=*)"
+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 (LDAP v2 SSL method). This also sets the default port to 636.
+ldap_v2                | **Optional.** Use LDAP protocol version 2 (enabled by default).
+ldap_v3                | **Optional.** Use LDAP protocol version 3 (disabled by default)
+ldap_warning           | **Optional.** Response time to result in warning status (seconds).
+ldap_critical          | **Optional.** Response time to result in critical status (seconds).
+ldap_warning_entries   | **Optional.** Number of found entries to result in warning status.
+ldap_critical_entries  | **Optional.** Number of found entries to result in critical status.
+ldap_timeout           | **Optional.** Seconds before connection times out (default: 10).
+ldap_verbose           | **Optional.** Show details for command-line debugging (disabled by default)
 
 ### <a id="plugin-check-command-load"></a> load
 
index a807bffdd2b379aab8df75f6f0f06634fb88a50f..6579f37d0f3fd0dd6d64a2a3cf42af2c9e26c2b2 100644 (file)
@@ -1867,6 +1867,14 @@ object CheckCommand "ldap" {
                        value = "$ldap_critical$"
                        description = "Response time to result in critical status (seconds)"
                }
+               "-W" = {
+                       value = "$ldap_warning_entries$"
+                       description = "Number of found entries to result in warning status (optional)"
+               }
+               "-C" = {
+                       value = "$ldap_critical_entries$"
+                       description = "Number of found entries to result in critical status (optional)"
+               }
                "-t" = {
                        value = "$ldap_timeout$"
                        description = "Seconds before connection times out (default: 10)"