Module: check_mk
Branch: master
Commit: fc16adf894af51d67cd805b6cbcc415f2694e17f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fc16adf894af51…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri May 5 16:20:28 2017 +0200
4610 FIX Fixed error in graph displaying views with invalid perfdata strings
When a service had a performance data string set which was only containing
spaces or a single space this lead to an exception in the GUI.
Change-Id: I8943447b000fd824954dfd34d6891b2ee8ab4ffb
---
.werks/4610 | 11 +++++++++++
web/htdocs/metrics.py | 3 +++
2 files changed, 14 insertions(+)
diff --git a/.werks/4610 b/.werks/4610
new file mode 100644
index 0000000..77a637b
--- /dev/null
+++ b/.werks/4610
@@ -0,0 +1,11 @@
+Title: Fixed error in graph displaying views with invalid perfdata strings
+Level: 1
+Component: multisite
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1493993956
+Class: fix
+
+When a service had a performance data string set which was only containing
+spaces or a single space this lead to an exception in the GUI.
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index 0754e4b..8dcf078 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -414,6 +414,9 @@ def parse_perf_data(perf_data_string, check_command=None):
html.log("Failed to parse perfdata string: %s" % perf_data_string)
return [], check_command
+ if not parts:
+ return [], check_command
+
# Try if check command is appended to performance data
# in a PNP like style
if parts[-1].startswith("[") and parts[-1].endswith("]"):