Module: check_mk
Branch: master
Commit: f5a47739fd53934a42019bc00f2843c80a2112a3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f5a47739fd5393…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Sep 28 17:20:44 2016 +0200
store: Added general method to deal with .mk files containing python data structures
---
lib/store.py | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/lib/store.py b/lib/store.py
index dea4bce..bc92d2b 100644
--- a/lib/store.py
+++ b/lib/store.py
@@ -28,6 +28,7 @@
functionality is the locked file opening realized with the File() context
manager."""
+import ast
import fcntl
import os
import pprint
@@ -139,7 +140,8 @@ open = LockedOpenWithTempfile
# '----------------------------------------------------------------------'
# This function generalizes reading from a .mk configuration file. It is basically meant to
-# generalize the exception handling for all file IO.
+# generalize the exception handling for all file IO. This function handles all those files
+# that are read with execfile().
def load_mk_file(path, default=None, lock=False):
if default == None:
raise MKGeneralException(_("You need to provide a config dictionary to merge with the "
@@ -176,6 +178,32 @@ def save_mk_file(path, mk_content):
save_file(path, content)
+# Handle .mk files that are only holding a python data structure and often
+# directly read via file/open and then parsed using eval.
+# TODO: Consolidate with load_mk_file?
+def load_data_from_file(path, default=None, lock=False):
+ if lock:
+ aquire_lock(path)
+
+ try:
+ return ast.literal_eval(file(path).read())
+ except IOError, e:
+ if e.errno == 2: # IOError: [Errno 2] No such file or directory
+ return default
+ else:
+ raise
+
+ except Exception, e:
+ # TODO: How to handle debug mode or logging?
+ raise MKGeneralException(_("Cannot read file \"%s\": %s") % (path, e))
+
+
+# A simple wrapper for cases where you want to store a python data
+# structure that is then read by load_data_from_file() again
+def save_data_to_file(path, data):
+ save_file(path, "%r\n" % data)
+
+
# Saving assumes a locked destination file (usually done by loading code)
# Then the new file is written to a temporary file and moved to the target path
def save_file(path, content, mode=0660):
Module: check_mk
Branch: master
Commit: 17615d2d14d19451090c3e8223e59850e6354b2f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=17615d2d14d194…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Sep 29 12:05:33 2016 +0200
updated werk text
---
.werks/3905 | 5 ++++-
ChangeLog | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/.werks/3905 b/.werks/3905
index 4461fb2..1140bed 100644
--- a/.werks/3905
+++ b/.werks/3905
@@ -1,4 +1,4 @@
-Title: barracuda_mailqueues, nullmailer_mailq, postfix_mailq, qmail_stats: these checks now have items, postfix can now monitor multi directories
+Title: barracuda_mailqueues, nullmailer_mailq, postfix_mailq, qmail_stats: these checks now have items, postfix can now monitor multi directories (linux agent)
Level: 1
Component: checks
Compatible: incomp
@@ -6,6 +6,9 @@ Version: 1.4.0i1
Date: 1475141806
Class: feature
+If postfix is configured with multi directories then the linux agent provides information
+about deferred and active mail queue length of these directories.
+
Note: existing ruleset mailqueue length is now deprecated. These checks will
work further on but the related ruleset won't be applied any more except default levels.
Please use new service descriptions for these checks below global settings, rediscover the
diff --git a/ChangeLog b/ChangeLog
index 49bfa2e..58adf3b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -174,7 +174,7 @@
NOTE: Please refer to the migration notes!
* 3879 ipmi, ipmi_sensors: unified ipmi checks which now work the same way...
* 3747 epson_beamer_lamp: New check to monitor the lamp operation time of Epson beamers
- * 3905 barracuda_mailqueues, nullmailer_mailq, postfix_mailq, qmail_stats: these checks now have items, postfix can now monitor multi directories...
+ * 3905 barracuda_mailqueues, nullmailer_mailq, postfix_mailq, qmail_stats: these checks now have items, postfix can now monitor multi directories (linux agent)...
NOTE: Please refer to the migration notes!
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
Module: check_mk
Branch: master
Commit: 7b37d1c2cadcc366ad4e72dcf217df1f5b232ffc
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7b37d1c2cadcc3…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Sep 29 11:48:53 2016 +0200
3905 barracuda_mailqueues, nullmailer_mailq, postfix_mailq, qmail_stats: these checks now have items, postfix can now monitor multi directories
Note: existing ruleset mailqueue length is now deprecated. These checks will
work further on but the related ruleset won't be applied any more except default levels.
Please use new service descriptions for these checks below global settings, rediscover the
affected hosts and use new mail queue length ruleset.
---
.werks/3905 | 12 +++
ChangeLog | 2 +
agents/check_mk_agent.linux | 38 ++++++++-
checks/barracuda_mailqueues | 13 ++--
checks/nullmailer_mailq | 8 +-
checks/postfix_mailq | 121 +++++++++++++++++------------
checks/qmail_stats | 8 +-
modules/check_mk.py | 4 +
web/htdocs/wato.py | 4 +
web/plugins/wato/check_mk_configuration.py | 4 +
web/plugins/wato/check_parameters.py | 71 ++++++++++-------
11 files changed, 189 insertions(+), 96 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=7b37d1c2ca…
Module: check_mk
Branch: master
Commit: 818d011f421239a43179de21f08772f31f040208
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=818d011f421239…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Sep 28 21:44:18 2016 +0200
3738 FIX Fixed sporadic pending changes due to (not) changed contact groups
The LDAP connector sometimes creates pending changes because of changed
contact groups. But the groups have not really changed. Just the order
of the groups in the answer from the LDAP server has changed. This
has been fixed.
---
.werks/3738 | 13 +++++++++++++
ChangeLog | 1 +
web/plugins/userdb/ldap.py | 2 +-
3 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/3738 b/.werks/3738
new file mode 100644
index 0000000..ca53508
--- /dev/null
+++ b/.werks/3738
@@ -0,0 +1,13 @@
+Title: Fixed sporadic pending changes due to (not) changed contact groups
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1475091791
+
+The LDAP connector sometimes creates pending changes because of changed
+contact groups. But the groups have not really changed. Just the order
+of the groups in the answer from the LDAP server has changed. This
+has been fixed.
diff --git a/ChangeLog b/ChangeLog
index b1ac70e..e41c28c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -645,6 +645,7 @@
* 3844 FIX: Fixed validation of host IPv4, IPv6 and management host address attributes...
* 3845 FIX: Added missing validation of host attribute values to WATO Web API calls
* 3881 FIX: fixed automation call 'delete piggyback host'
+ * 3738 FIX: Fixed sporadic pending changes due to (not) changed contact groups...
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index 84a78ba..da505a1 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -1308,7 +1308,7 @@ def get_groups_of_user(connection, user_id, ldap_user, cg_names, nested, other_c
if user_cmp_val in group['members']:
group_cns.append(group['cn'])
- return group_cns
+ return sorted(group_cns)
group_membership_parameters = [