Module: check_mk
Branch: master
Commit: c881346177dca64c5dee76cb9dcaa814c522cc43
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c881346177dca6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jan 27 11:48:12 2015 +0100
#1880 FIX inventory_processes rules can now be configured without setting levels
Since werk #1563 the levels configured in the rule {inventory_processes} are not
interpreted anymore. If you used this rule to configure process discovery, you
can now leave the last four elements (thresholds) of.
Note: If you use WATO for configuring process discovery, this change does not affect you.
To configure the thresholds, you need to use the {check_parameters} option like
shown in the example below:
F+:etc/check_mk/main.mk
# Old configuration style
inventory_processes += [
( ["sap", ], ALL_HOSTS, "SAP_ora_pmon_%s",
"~ora_pmon_([A-Z][A-Z,0-9]{2,3})$", GRAB_USER, 1, 1, 1, 1 ),
]
# new style configuration:
inventory_processes += [
( ["sap", ], ALL_HOSTS, "SAP_ora_pmon_%s",
"~ora_pmon_([A-Z][A-Z,0-9]{2,3})$", GRAB_USER),
check_parameters += [
( {'levels' : (1, 1, 1, 1)}, ALL_HOSTS, ['proc_SAP_ora_pmon_.*'] ),
]
F-:
---
.werks/1880 | 33 +++++++++++++++++++++++++++++++++
ChangeLog | 1 +
checks/ps.include | 5 +++--
3 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/.werks/1880 b/.werks/1880
new file mode 100644
index 0000000..184a01a
--- /dev/null
+++ b/.werks/1880
@@ -0,0 +1,33 @@
+Title: inventory_processes rules can now be configured without setting levels
+Level: 2
+Component: core
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1422355345
+
+Since werk #1563 the levels configured in the rule {inventory_processes} are not
+interpreted anymore. If you used this rule to configure process discovery, you
+can now leave the last four elements (thresholds) of.
+
+Note: If you use WATO for configuring process discovery, this change does not affect
you.
+
+To configure the thresholds, you need to use the {check_parameters} option like
+shown in the example below:
+
+F+:etc/check_mk/main.mk
+# Old configuration style
+inventory_processes += [
+ ( ["sap", ], ALL_HOSTS, "SAP_ora_pmon_%s",
"~ora_pmon_([A-Z][A-Z,0-9]{2,3})$", GRAB_USER, 1, 1, 1, 1 ),
+]
+
+# new style configuration:
+
+inventory_processes += [
+ ( ["sap", ], ALL_HOSTS, "SAP_ora_pmon_%s",
"~ora_pmon_([A-Z][A-Z,0-9]{2,3})$", GRAB_USER),
+
+check_parameters += [
+ ( {'levels' : (1, 1, 1, 1)}, ALL_HOSTS, ['proc_SAP_ora_pmon_.*'] ),
+]
+F-:
diff --git a/ChangeLog b/ChangeLog
index a5bf6ae..9fe032a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
* 1842 FIX: Rewrote implementation of service discovery (formerly inventory)...
* 1869 FIX: Deleting outdated persisted agent sections now
* 1919 FIX: cmk --snmpwalk: continue if one of the OIDs to walk fails
+ * 1880 FIX: inventory_processes rules can now be configured without setting
levels...
Checks & Agents:
* 1665 agent_netapp: New special agent for NetApp monitoring via Web-API...
diff --git a/checks/ps.include b/checks/ps.include
index 450e60d..732f12f 100644
--- a/checks/ps.include
+++ b/checks/ps.include
@@ -37,12 +37,13 @@ def inventory_ps_common(invdata, invrules, info):
for inv_entry in invdata:
# New in 1.1.7i1: inventory_processes may be prefixed with list of
# host names or tags + ALL_HOSTS
+ # New in 1.2.6b7: inventory_processes might have no levels specified
tags = None
- if len(inv_entry) == 8:
+ if len(inv_entry) in (4, 8):
tags = []
hostlist = inv_entry[0]
inv_entry = inv_entry[1:]
- elif len(inv_entry) == 9:
+ elif len(inv_entry) in (5, 9):
tags = inv_entry[0]
hostlist = inv_entry[1]
inv_entry = inv_entry[2:]