Module: check_mk
Branch: master
Commit: 6e8c3859a8440f58c6220c6c0703e657ad2b3f88
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6e8c3859a8440f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 13 15:09:28 2015 +0100
Consolidated pnp_cleanup calls
---
web/htdocs/metrics.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index 7ef039d..1274ab6 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -314,7 +314,8 @@ def parse_perf_data(perf_data_string, check_command=None):
for part in parts:
try:
varname, values = part.split("=", 1)
- varname = varname.replace("\"",
"").replace("\'", "")
+ varname = pnp_cleanup(varname.replace("\"",
"").replace("\'", ""))
+
value_parts = values.split(";")
while len(value_parts) < 5:
value_parts.append(None)
@@ -328,6 +329,7 @@ def parse_perf_data(perf_data_string, check_command=None):
i += 1
unit_name = value_text[i:]
value = value_text[:i]
+
perf_data.append((varname, value, unit_name, warn, crit, min, max))
except:
if config.debug:
@@ -1032,7 +1034,7 @@ def render_graph_pnp(graph_template, translated_metrics):
# Define one RRD variable for each of the available metrics.
# Note: We need to use the original name, not the translated one.
for var_name, metrics in translated_metrics.items():
- rrd = "$RRDBASE$_" + pnp_cleanup(metrics["orig_name"]) +
".rrd"
+ rrd = "$RRDBASE$_" + metrics["orig_name"] + ".rrd"
scale = metrics["scale"]
unit = metrics["unit"]
render_scale = unit.get("render_scale", 1)