Module: check_mk
Branch: master
Commit: 4d57ec38fa4a7246d741d41823f3e9726fef8cfe
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4d57ec38fa4a72…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Aug 17 15:30:59 2015 +0200
#2538 FIX Fix exception in PNP graph template where metric name contains colon (e.g.
omd_apache)
This problem only appeared with Nagios/Icinga as core.
---
.werks/2538 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/metrics.py | 2 +-
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/2538 b/.werks/2538
new file mode 100644
index 0000000..06304af
--- /dev/null
+++ b/.werks/2538
@@ -0,0 +1,10 @@
+Title: Fix exception in PNP graph template where metric name contains colon (e.g.
omd_apache)
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1439818166
+
+This problem only appeared with Nagios/Icinga as core.
diff --git a/ChangeLog b/ChangeLog
index 4482d11..7340fe6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -145,6 +145,7 @@
* 2470 FIX: Fixed exception in logwatch log list in rare cases...
* 2375 FIX: prediction preview: automatically select valid prediction period
* 2509 FIX: Logwatch: Fixed exception when deleting a specific logfile on multiple
hosts
+ * 2538 FIX: Fix exception in PNP graph template where metric name contains colon
(e.g. omd_apache)...
WATO:
* 2365 Removed old deprecated notification global options for plain emails...
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index f5b22ff..8aeb888 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -1121,7 +1121,7 @@ def render_graph_pnp(graph_template, translated_metrics):
# TODO: Die Breite des Titels intelligent berechnen. Bei legend =
"mirrored" muss man die
# Vefügbare Breite ermitteln und aufteilen auf alle Titel
right_pad = " " * (max_title_length - len(title))
- commands += "%s:%s%s%s:\"%s%s\"%s " % (draw_type,
metric_name, upside_down_suffix, color, title, right_pad, draw_stack)
+ commands += "%s:%s%s%s:\"%s%s\"%s " % (draw_type,
metric_name, upside_down_suffix, color, title.replace(":", "\\:"),
right_pad, draw_stack)
if line_type == "area":
commands += "LINE:%s%s%s " % (metric_name, upside_down_suffix,
render_color(darken_color(parse_color(color), 0.2)))