Module: check_mk
Branch: master
Commit: 0cefe2253790bcf8d5702e52d78bc9a67d76f5b8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0cefe2253790bc…
Author: Marcel Schulte <ms(a)mathias-kettner.de>
Date: Wed Mar 15 16:36:06 2017 +0100
8668 FIX ipmi: fixed handling of units containing spaces
Fixed ipmi check in case agent provides units like "Degrees C", containing
spaces. Those units cause issues with RRD creation.
Spaces are now replaces by underscores.
Change-Id: I0e5ad1a990ce50f8f00a0ab7c7d93639a84e2403
(cherry picked from commit 34214c5d08b5e11c58cf90abb9e3732d13d58046)
---
.werks/8668 | 11 +++++++++++
checks/ipmi | 2 ++
2 files changed, 13 insertions(+)
diff --git a/.werks/8668 b/.werks/8668
new file mode 100644
index 0000000..409a183
--- /dev/null
+++ b/.werks/8668
@@ -0,0 +1,11 @@
+Title: ipmi: fixed handling of units containing spaces
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.4.0b4
+Date: 1489591985
+Class: fix
+
+Fixed ipmi check in case agent provides units like "Degrees C", containing
spaces. Those units cause issues with RRD creation.
+Spaces are now replaces by underscores.
diff --git a/checks/ipmi b/checks/ipmi
index f18f2ac..a3952cd 100644
--- a/checks/ipmi
+++ b/checks/ipmi
@@ -185,6 +185,8 @@ def parse_ipmi(info):
if parsed[name]["unit"] in [ "unspecified",
"" ]:
parsed[name]["unit"] = None
+ elif parsed[name]["unit"] != None:
+ parsed[name]["unit"] =
parsed[name]["unit"].replace(" ", "_")
return parsed