Module: check_mk
Branch: master
Commit: e8482ab901e7e475b2fd50e8d42f569bc04ba68e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e8482ab901e7e4…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Apr 5 11:11:39 2016 +0200
fixed recently introduced nagios pnp graph bug
---
web/htdocs/metrics.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index a6403d8..d92b21c 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -1177,7 +1177,10 @@ def render_graph_pnp(graph_template, translated_metrics):
# TODO: beware of division by zero. All metrics are set to 1 here.
value, unit, color = evaluate(metric_name, translated_metrics)
- expression, explicit_unit_name = metric_name.split("@", 1) #
isolate expression
+ if "@" in metric_name:
+ expression, explicit_unit_name = metric_name.rsplit("@", 1) #
isolate expression
+ else:
+ expression = metric_name
# Choose a unique name for the derived variable and compute it
commands += "CDEF:DERIVED%d=%s " % (nr , expression)