Module: check_mk
Branch: master
Commit: 39cf631b455b93ed49bc849142fbceef0ebc0827
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=39cf631b455b93…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Nov 13 12:07:04 2013 +0100
FIX ps: Remove exceeding [ and ] in service description when using process inventory
When using the process inventory with regular expressions that contain
groups, like <tt>"/sbin/getty .* (tty.)"</tt>, the matched group is
inserted as
a replacement for <tt>%s</tt> in the service description. The bug resulted
in additional brackets. It was <tt>"[tty2]"</tt> instead of just
<tt>"tty2"</tt>.
This has been fixed.
---
.werks/3 | 12 ++++++++++++
ChangeLog | 1 +
checks/ps | 2 +-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/3 b/.werks/3
new file mode 100644
index 0000000..c23d3d6
--- /dev/null
+++ b/.werks/3
@@ -0,0 +1,12 @@
+Title: ps: Remove exceeding [ and ] in service description when using process inventory
+Level: 1
+Component: checks
+Version: 1.2.3i7
+Date: 1384340695
+Class: fix
+
+When using the process inventory with regular expressions that contain
+groups, like <tt>"/sbin/getty .* (tty.)"</tt>, the matched group is
inserted as
+a replacement for <tt>%s</tt> in the service description. The bug resulted
+in additional brackets. It was <tt>"[tty2]"</tt> instead of just
<tt>"tty2"</tt>.
+This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index 8b6a0d4..7d95ed1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,7 @@
* 0065 FIX: veeam_client: check behaviour improved when backup is in progress
* 0066 FIX: veeam_jobs: check behaviour improved when backup is in progress
* 0209 FIX: Cleaned up bad code in fileinfo.groups check
+ * 0003 FIX: ps: Remove exceeding [ and ] in service description when using process
inventory...
Multisite:
* 0001 New filters for selecting several host/service-groups at once...
diff --git a/checks/ps b/checks/ps
index cac2e52..6aed87a 100644
--- a/checks/ps
+++ b/checks/ps
@@ -201,7 +201,7 @@ def inventory_ps_common(invdata, info, handle_perfdata = False):
# It is allowed (1.1.4) that the pattern contains more subexpressions
then the
# service description. In that case only the first subexpressions are
used as
# item.
- i_servicedesc = i_servicedesc % (matches[:num_perc_s])
+ i_servicedesc = i_servicedesc % tuple(matches[:num_perc_s])
# Problem here: We need to instantiate all subexpressions
# with their actual values of the found process.