Module: check_mk
Branch: master
Commit: 2cea91097cacfd8beaeacb011ec5444e255dc47f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2cea91097cacfd…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Mon Jan 25 13:25:15 2016 +0100
#2937 mrpe: check now supports service descriptions using percent-encoded characters
mrpe services can now contain any character using percent encoding. This is particularly
useful to
include spaces in the service description as that was previously impossible due to the way
mrpe.cfg
was parsed.
This change is incompatible as any %xx sequence will now be converted whereas it was
previously
included in the service description as unchanged.
---
.werks/2937 | 13 +++++++++++++
ChangeLog | 2 ++
checks/mrpe | 3 ++-
3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/2937 b/.werks/2937
new file mode 100644
index 0000000..278b61f
--- /dev/null
+++ b/.werks/2937
@@ -0,0 +1,13 @@
+Title: mrpe: check now supports service descriptions using percent-encoded characters
+Level: 1
+Component: checks
+Compatible: incomp
+Version: 1.2.7i4
+Date: 1453724472
+Class: feature
+
+mrpe services can now contain any character using percent encoding. This is particularly
useful to
+include spaces in the service description as that was previously impossible due to the
way mrpe.cfg
+was parsed.
+This change is incompatible as any %xx sequence will now be converted whereas it was
previously
+included in the service description as unchanged.
diff --git a/ChangeLog b/ChangeLog
index 44621a6..d5a1ac7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -94,6 +94,8 @@
* 1323 win_printers: Warning and Critical levels can now be set...
* 1324 New Check for Dell Equallogic SAN Devices
* 2892 qlogic_fcport: now supports QLogic FC Switch SANBox 5802 series
+ * 2937 mrpe: check now supports service descriptions using percent-encoded
characters...
+ NOTE: Please refer to the migration notes!
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/checks/mrpe b/checks/mrpe
index c4ab43c..9872b81 100644
--- a/checks/mrpe
+++ b/checks/mrpe
@@ -33,6 +33,7 @@ def inventory_mrpe(info):
item = line[1]
else:
item = line[0]
+ item = urllib.unquote(item)
items.append((item, None))
return items
@@ -56,7 +57,7 @@ def check_mrpe(item, params, info):
line = line[1:]
else:
check_name = None
- if line[0] == item:
+ if urllib.unquote(line[0]) == item:
try:
state = int(line[1])
except: