Module: check_mk
Branch: master
Commit: e2322350b0245792aa0d6b117c0b6a9f2ec28ebd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e2322350b02457…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Aug 10 10:42:55 2015 +0200
#1277 check_ldap: It is now possible to specify a alternative Hostname
This is usefull if u want to check LDAPS servers to prevent certificate problems.
---
.werks/1277 | 10 ++++++++++
ChangeLog | 1 +
checks/check_ldap | 10 ++++++++--
web/plugins/wato/active_checks.py | 9 +++++++++
4 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/.werks/1277 b/.werks/1277
new file mode 100644
index 0000000..4312aed
--- /dev/null
+++ b/.werks/1277
@@ -0,0 +1,10 @@
+Title: check_ldap: It is now possible to specify a alternative Hostname
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1439196083
+Class: feature
+
+This is usefull if u want to check LDAPS servers to prevent certificate problems.
+
diff --git a/ChangeLog b/ChangeLog
index 28d9282..5d8811f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -39,6 +39,7 @@
* 2515 juniper_trpz_aps: check is now cluster-aware...
* 2417 winperf_phydisk: can now work in a cluster environment
* 2523 ipmi: new wato rule to set ignored sensors and activate/deactivate
summarizing
+ * 1277 check_ldap: It is now possible to specify a alternative Hostname...
* 2315 FIX: windows agent: BOM replacement, fixed incorrect byte offset...
* 2316 FIX: windows agent: fix garbled output of cached agent plugins...
* 2358 FIX: check_mk_agent.solaris: more correct computation of zfs used space...
diff --git a/checks/check_ldap b/checks/check_ldap
index 1ea4e06..346a489 100644
--- a/checks/check_ldap
+++ b/checks/check_ldap
@@ -26,7 +26,13 @@
def check_ldap_arguments(params):
name, basedn, settings = params
- args = ' -b %s' % quote_shell_string(basedn)
+
+ if "hostname" in settings:
+ args = ' -H %s' % quote_shell_string(settings["hostname"])
+ else:
+ args = ' -H $HOSTADDRESS'
+
+ args += ' -b %s' % quote_shell_string(basedn)
if "response_time" in settings:
args += ' -w %f -c %f' % (
@@ -66,7 +72,7 @@ def check_ldap_desc(params):
return "LDAP %s" % params[0]
active_check_info['ldap'] = {
- "command_line" : '$USER1$/check_ldap -H $HOSTADDRESS$
$ARG1$',
+ "command_line" : '$USER1$/check_ldap $ARG1$',
"argument_function" : check_ldap_arguments,
"service_description" : check_ldap_desc,
"has_perfdata" : True,
diff --git a/web/plugins/wato/active_checks.py b/web/plugins/wato/active_checks.py
index 309245b..7769008 100644
--- a/web/plugins/wato/active_checks.py
+++ b/web/plugins/wato/active_checks.py
@@ -1074,6 +1074,15 @@ register_rule(group,
help = _("Use LDAPS (LDAP SSLv2 method). This sets the
default port number to 636"))
),
+ ( "hostname",
+ TextAscii(
+ title = _("Alternative Hostname"),
+ help = _("Use a alternative field as Hostname in case of
SSL Certificate Problems (eg. the Hostalias )"),
+ size = 40,
+ allow_empty = False,
+ default_value = "$HOSTALIAS$",
+ )
+ ),
( "version",
DropdownChoice(
title = _("LDAP Version"),