From b37fd5377322ea83de6e050fef2bebee0d91de92 Mon Sep 17 00:00:00 2001 From: Niflou Date: Wed, 5 Apr 2017 14:50:08 +0200 Subject: [PATCH] ITL: Add more options to ldap CheckCommand Adding the -W and -C (warning entries and critical entries) options fixes #5139 Signed-off-by: Michael Friedrich --- doc/10-icinga-template-library.md | 34 ++++++++++++++++--------------- itl/command-plugins.conf | 8 ++++++++ 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/doc/10-icinga-template-library.md b/doc/10-icinga-template-library.md index 0bf0fac29..7b0e7c865 100644 --- a/doc/10-icinga-template-library.md +++ b/doc/10-icinga-template-library.md @@ -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) ### load diff --git a/itl/command-plugins.conf b/itl/command-plugins.conf index a807bffdd..6579f37d0 100644 --- a/itl/command-plugins.conf +++ b/itl/command-plugins.conf @@ -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)"