Module: check_mk
Branch: master
Commit: 06e0db9a84610123af4f95c709943051ec73adac
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=06e0db9a846101…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Nov 10 15:49:43 2015 +0100
Process perfdata even when one value failed to be parsed, skip only the affected value
---
web/htdocs/metrics.py | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index 98b2a84..2f9595d 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -306,9 +306,9 @@ def parse_perf_data(perf_data_string, check_command=None):
return x in [ '0', '1', '2', '3', '4',
'5', '6', '7', '8', '9' ]
# Parse performance data, at least try
- try:
- perf_data = []
- for part in parts:
+ perf_data = []
+ for part in parts:
+ try:
varname, values = part.split("=", 1)
varname = varname.replace("\"",
"").replace("\'", "")
value_parts = values.split(";")
@@ -325,10 +325,10 @@ def parse_perf_data(perf_data_string, check_command=None):
unit_name = value_text[i:]
value = value_text[:i]
perf_data.append((varname, value, unit_name, warn, crit, min, max))
- except:
- if config.debug:
- raise
- perf_data = None
+ except:
+ if config.debug:
+ raise
+ perf_data = None
return perf_data, check_command