Module: check_mk
Branch: master
Commit: 5bc78ca54cc87ab5c52c792e75f9bf550fbe6b3b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5bc78ca54cc87a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Aug 27 10:51:13 2015 +0200
#2543 FIX Fixed usage of icons/actions configured directly with process rules
---
.werks/2543 | 9 +++++++++
ChangeLog | 1 +
checks/ps.include | 17 +++++++++++------
3 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/.werks/2543 b/.werks/2543
new file mode 100644
index 0000000..141ec63
--- /dev/null
+++ b/.werks/2543
@@ -0,0 +1,9 @@
+Title: Fixed usage of icons/actions configured directly with process rules
+Level: 1
+Component: core
+Compatible: compat
+Version: 1.2.7i3
+Date: 1440665444
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index b55dbc7..1b34bfd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
* 2502 FIX: Fixed removing autochecks when a host is configured to be ping only...
* 2526 FIX: Fixed crash in filesystem checks in case mountpoint contains non-ascii characters
* 2540 FIX: Process piggy backed data even if host is set to "No Agent"...
+ * 2543 FIX: Fixed usage of icons/actions configured directly with process rules
Checks & Agents:
* 2312 New checks for EMC VPLEX: emc_vplex_cpu, emc_vplex_director_stats, emc_vplex_if, emc_vplex_volumes...
diff --git a/checks/ps.include b/checks/ps.include
index 9c29195..e73e000 100644
--- a/checks/ps.include
+++ b/checks/ps.include
@@ -61,7 +61,7 @@ def inventory_ps_common(invdata, invrules, info):
inv_entry += ([],)
default_levels = inv_entry[3:7]
- entries.append(inv_entry[:3] + ({ "levels" : default_levels },))
+ entries.append(inv_entry[:3] + [None] + ({ "levels" : default_levels },))
# Handle new WATO style inventory rules
for rule in invrules:
@@ -78,9 +78,9 @@ def inventory_ps_common(invdata, invrules, info):
v = rule[0]
- entries.append((v['descr'], v.get('match'), v.get('user'), v.get('default_params', v)))
+ entries.append((v['descr'], v.get('match'), v.get('user'), v.get('icon'), v.get('default_params', v)))
- for servicedesc, pattern, userspec, default_params in entries:
+ for servicedesc, pattern, userspec, icon, default_params in entries:
num_perc_s = servicedesc.count("%s")
for line in info:
# First entry in line is the node name or None for non-clusters
@@ -113,17 +113,22 @@ def inventory_ps_common(invdata, invrules, info):
# Problem here: We need to instantiate all subexpressions
# with their actual values of the found process.
i_pattern = instantiate_regex_pattern(pattern, matches)
- inv_keys = {
+
+ inv_params = {
"process" : i_pattern,
"user" : i_userspec,
}
+
+ if icon:
+ inv_params["icon"] = icon
+
# default_params is either a clean dict with optional parameters to set as default
# or - from version 1.2.4 - the dict from the rule itself. In the later case
# we need o remove the keys that do not specify default parameters
for key, value in default_params.items():
if key not in ( "descr", "match", "user", "perfdata" ):
- inv_keys.setdefault(key, value)
- inv = ( i_servicedesc, inv_keys )
+ inv_params.setdefault(key, value)
+ inv = ( i_servicedesc, inv_params )
if inv not in inventory:
inventory.append(inv)
Module: check_mk
Branch: master
Commit: f5126dd2e47e0b166804fe428ddb1ee3ed67b821
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f5126dd2e47e0b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Aug 27 10:35:35 2015 +0200
Fixed exception in ps check when counters are cleared after short rewrite of counter handling
---
modules/check_mk_base.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 2e4e8e3..cd6b67c 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1092,13 +1092,14 @@ def last_counter_wrap():
# Deletes counters from g_item_state matching the given pattern and are older_than x seconds.
# This is a neccessary cleanup just used by ps.include. Not nice.
-def clear_counters(prefix, older_than):
+def clear_counters(check_type_prefix, older_than):
global g_item_state
counters_to_delete = []
now = time.time()
for name, (timestamp, value) in g_item_state.items():
- if name.startswith(prefix):
+ joined_name = type(name) == tuple and name[0] or name
+ if joined_name.startswith(check_type_prefix):
if now > timestamp + older_than:
counters_to_delete.append(name)