Module: check_mk
Branch: master
Commit: 3756327332c3985c43517d3fbb8ff5791b6b1b07
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3756327332c398…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Mar 21 15:07:52 2016 +0100
Speedup interactive graph zooming/panning in case of multi-language environment
---
web/htdocs/modules.py | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/web/htdocs/modules.py b/web/htdocs/modules.py
index 1b8e064..6096433 100644
--- a/web/htdocs/modules.py
+++ b/web/htdocs/modules.py
@@ -96,11 +96,26 @@ def init_modules():
modules += [ globals()[m] for m in set(imports()).difference(module_names_prev) ]
+g_all_modules_loaded = False
+
# Call the load_plugins() function in all modules
def load_all_plugins():
+ global g_all_modules_loaded
+
+ # CLEANUP: Move this to the pagehandlers if this concept works out.
+ if html.myfile == "ajax_graph" and g_all_modules_loaded:
+ only_modules = ["metrics"]
+ else:
+ only_modules = None
+
+ g_all_modules_loaded = True
+
+
need_plugins_reload = local_web_plugins_have_changed()
for module in modules:
+ if only_modules != None and get_module_name(module) not in only_modules:
+ continue
try:
module.load_plugins # just check if this function exists
except AttributeError:
Module: check_mk
Branch: master
Commit: 755a99f7621e78e2af7a9440f9c06bd74c350470
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=755a99f7621e78…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Mar 21 13:30:28 2016 +0100
3301 FIX mrpe: Fixed exception "urllib not defined" when using Nagios as core
---
.werks/3301 | 10 ++++++++++
ChangeLog | 1 +
checks/mrpe | 2 ++
3 files changed, 13 insertions(+)
diff --git a/.werks/3301 b/.werks/3301
new file mode 100644
index 0000000..652b58c
--- /dev/null
+++ b/.werks/3301
@@ -0,0 +1,10 @@
+Title: mrpe: Fixed exception "urllib not defined" when using Nagios as core
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1458563402
+
+
diff --git a/ChangeLog b/ChangeLog
index 5536aff..1407d2b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -94,6 +94,7 @@
* 3298 FIX: winperf_processor.util: Fixed exception when CPU counters were not matched
* 3299 FIX: mssql_backup: Fixed exception in case of invalid agent output
* 3300 FIX: zfsget: Fixed excluding snapshots from zfsget section
+ * 3301 FIX: mrpe: Fixed exception "urllib not defined" when using Nagios as core
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/mrpe b/checks/mrpe
index d9232f3..118fbeb 100644
--- a/checks/mrpe
+++ b/checks/mrpe
@@ -25,6 +25,7 @@
# Boston, MA 02110-1301 USA.
def inventory_mrpe(info):
+ import urllib
items = []
for line in info:
# New Linux agent sends (check_name) in first column. Stay
@@ -45,6 +46,7 @@ def mrpe_parse_perfdata(perfinfo):
def check_mrpe(item, params, info):
+ import urllib
# This check is cluster-aware. An item might be found
# more than once. In that case we use the best of the
# multiple statuses.
Module: check_mk
Branch: master
Commit: 83e3030ea6cde23722213419065cd1d7d1867694
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=83e3030ea6cde2…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Mar 21 12:49:16 2016 +0100
New helper function generic_host_extra_conf
---
modules/check_mk.py | 51 ++++++++++++++++++++++++++++++++++++---------------
1 file changed, 36 insertions(+), 15 deletions(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 280ea23..3287a46 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -709,20 +709,10 @@ def convert_host_ruleset(ruleset):
sys.stderr.write('WARNING: deprecated entry [ "" ] in host configuration list\n')
for rule in ruleset:
- rule, rule_options = get_rule_options(rule)
+ item, tags, hostlist, rule_options = parse_host_rule(rule)
if rule_options.get("disabled"):
continue
- num_elements = len(rule)
- if num_elements == 2:
- item, hostlist = rule
- tags = []
- elif num_elements == 3:
- item, tags, hostlist = rule
- else:
- raise MKGeneralException("Invalid entry '%r' in host configuration list: must "
- "have 2 or 3 entries" % (rule,))
-
# Directly compute set of all matching hosts here, this
# will avoid recomputation later
new_rules.append((item, all_matching_hosts(tags, hostlist, with_foreign_hosts=True)))
@@ -739,14 +729,45 @@ def host_extra_conf(hostname, ruleset):
entries = []
for item, hostname_list in ruleset:
- # Hack for the agent bakery: The hostname may be "True" which is used
- # for the generic agent. When the hostname is True it should match
- # without conditions.
- if hostname == True or hostname in hostname_list:
+ if hostname in hostname_list:
entries.append(item)
return entries
+def parse_host_rule(rule):
+ rule, rule_options = get_rule_options(rule)
+
+ num_elements = len(rule)
+ if num_elements == 2:
+ item, hostlist = rule
+ tags = []
+ elif num_elements == 3:
+ item, tags, hostlist = rule
+ else:
+ raise MKGeneralException("Invalid entry '%r' in host configuration list: must "
+ "have 2 or 3 entries" % (rule,))
+
+ return item, tags, hostlist, rule_options
+
+
+# Needed for agent bakery: Compute ruleset for "generic" host. This
+# fictious host has no name and no tags. It matches all rules that
+# do not require specific hosts or tags. But it matches rules that
+# e.g. except specific hosts or tags (is not, has not set)
+def generic_host_extra_conf(ruleset):
+ entries = []
+
+ for rule in ruleset:
+ item, tags, hostlist, rule_options = parse_host_rule(rule)
+ if tags and not hosttags_match_taglist([], tags):
+ continue
+ if not in_extraconf_hostlist(hostlist, ""):
+ continue
+
+ entries.append(item)
+ return entries
+
+
def host_extra_conf_merged(hostname, conf):
rule_dict = {}
for rule in host_extra_conf(hostname, conf):