Module: check_mk
Branch: master
Commit: 53822cbd262fcefe48d434fc7d18e6030bcaa6e3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=53822cbd262fce…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Mar 18 10:32:11 2015 +0100
#2149 FIX LDAP: The diagnostic log has been changed to use a fixed path
The LDAP diagnostic log, which should only be enabled for debugging purposes,
has been changed from a free configurable path to a fixed path. In your
OMD sites it will now always be located within <tt>var/log/ldap.log</tt>.
---
.werks/2149 | 12 ++++++++++++
ChangeLog | 1 +
web/plugins/config/builtin.py | 2 +-
web/plugins/userdb/ldap.py | 6 +++---
web/plugins/wato/check_mk_configuration.py | 18 ++++++++----------
5 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/.werks/2149 b/.werks/2149
new file mode 100644
index 0000000..7890d07
--- /dev/null
+++ b/.werks/2149
@@ -0,0 +1,12 @@
+Title: LDAP: The diagnostic log has been changed to use a fixed path
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1426671051
+
+The LDAP diagnostic log, which should only be enabled for debugging purposes,
+has been changed from a free configurable path to a fixed path. In your
+OMD sites it will now always be located within <tt>var/log/ldap.log</tt>.
diff --git a/ChangeLog b/ChangeLog
index 2f4ddf7..fa90d59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -360,6 +360,7 @@
* 2045 FIX: Avoid fetching SNMP data when showing service list in WATO - unless Full
Scan is pressed
* 2047 FIX: Allow overriding existing WATO rules by own files in local/ hierarchy...
* 2146 FIX: In distributed environments user notification rules trigger a profile
synchronisation now...
+ * 2149 FIX: LDAP: The diagnostic log has been changed to use a fixed path...
Notifications:
* 1662 notification plugin spectrum: finalized script. now able to handle host
notications
diff --git a/web/plugins/config/builtin.py b/web/plugins/config/builtin.py
index 01cb9f2..ff72a15 100644
--- a/web/plugins/config/builtin.py
+++ b/web/plugins/config/builtin.py
@@ -236,7 +236,7 @@ ldap_groupspec = {
}
ldap_active_plugins = {'email': {}, 'alias': {}, 'auth_expire':
{}}
ldap_cache_livetime = 300
-ldap_debug_log = None
+ldap_debug_log = False
default_user_profile = {
'roles': ['user'],
}
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index fd506d7..14c6558 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -125,11 +125,11 @@ ldap_umlaut_translation = {
# '----------------------------------------------------------------------'
def ldap_log(s):
- if config.ldap_debug_log is not None:
+ if config.ldap_debug_log:
if type(s) == unicode:
s = s.encode('utf-8')
- file(ldap_replace_macros(config.ldap_debug_log), "a").write('%s
%s\n' %
- (time.strftime('%Y-%m-%d %H:%M:%S'),
s))
+ log_file = defaults.log_dir + '/ldap.log'
+ file(log_file, "a").write('%s %s\n' %
(time.strftime('%Y-%m-%d %H:%M:%S'), s))
class MKLDAPException(MKGeneralException):
pass
diff --git a/web/plugins/wato/check_mk_configuration.py
b/web/plugins/wato/check_mk_configuration.py
index 60c4a61..2573f38 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -939,16 +939,14 @@ register_configvar(group,
register_configvar(group,
"ldap_debug_log",
- Optional(
- Filename(
- label = _("Absolute path to log file"),
- default = defaults.var_dir + '/web/ldap-debug.log',
- trans_func = userdb.ldap_replace_macros,
- ),
- title = _("LDAP connection diagnostics"),
- label = _("Activate logging of LDAP transactions into a logfile"),
- help = _("If this option is used and set to a filename, Check_MK will
create a logfile "
- "containing details about connecting to LDAP and the single
transactions.")),
+ Checkbox(
+ title = _("LDAP connection diagnostics"),
+ label = _("Activate logging of LDAP transactions"),
+ help = _("If this option is enabled, Check_MK will create a log file in
"
+ "<tt>var/log/ldap.log</tt> within your site in OMD
environments. "
+ "You should enable this option only for debugging."),
+ default_value = False
+ ),
domain = "multisite",
in_global_settings = False,
)