Module: check_mk
Branch: master
Commit: a239d76eb76a2f415f1fb4e2469a1a4fe6074ca5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a239d76eb76a2f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Apr 8 17:44:00 2015 +0200
#2192 FIX check_notify_count": Fix exception in PNP template in case of explit email
addresses
When you use an explicit email address as a target destination (via the rule
based notification) then RRD Tool would be unhappy because of the @ in the
variable name. This has been fixed.
---
.werks/2192 | 12 ++++++++++++
ChangeLog | 1 +
pnp-templates/check_mk_active-notify_count.php | 9 ++++++---
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/.werks/2192 b/.werks/2192
new file mode 100644
index 0000000..6e08e33
--- /dev/null
+++ b/.werks/2192
@@ -0,0 +1,12 @@
+Title: check_notify_count": Fix exception in PNP template in case of explit email
addresses
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1428507779
+
+When you use an explicit email address as a target destination (via the rule
+based notification) then RRD Tool would be unhappy because of the @ in the
+variable name. This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index b87c608..54ff2fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -311,6 +311,7 @@
* 1954 FIX: fileinfo / fileinfo.groups: Fixed discovery function for fileinfo groups
and equalize agent output of fileinfo agents...
* 2111 FIX: hitachi_hnas_volume: fix for cases when size information of volumes is
not available
* 2190 FIX: jolokia_metrics.gc: Fixed exception in check if no warn/crit levels are
defined
+ * 2192 FIX: check_notify_count": Fix exception in PNP template in case of explit
email addresses...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/pnp-templates/check_mk_active-notify_count.php
b/pnp-templates/check_mk_active-notify_count.php
index be989ad..aed1397 100644
--- a/pnp-templates/check_mk_active-notify_count.php
+++ b/pnp-templates/check_mk_active-notify_count.php
@@ -33,12 +33,15 @@ $minutes = $parts[1];
$opt[1] = "--vertical-label 'Notifications' -l0 --title \"$title (in
last $minutes min)\" ";
$def[1] = "";
+$nr = 0;
foreach ($DS AS $i => $ds_val) {
$contact_name = substr($NAME[$i], 0, strpos($NAME[$i], '_'));
- $def[1] .= "DEF:$contact_name=".$RRDFILE[$i].":$ds_val:MAX " ;
+ $varname = "notto$nr";
+ $def[1] .= "DEF:$varname=".$RRDFILE[$i].":$ds_val:MAX " ;
- $def[1] .= "LINE1:$contact_name#".$line_colors[$i %
8].":\"".sprintf("%-20s", $contact_name)."\" ";
- $def[1] .= "GPRINT:$contact_name:MAX:\"%3.lf\\n\" ";
+ $def[1] .= "LINE1:$varname#".$line_colors[$i %
8].":\"".sprintf("%-20s", $contact_name)."\" ";
+ $def[1] .= "GPRINT:$varname:MAX:\"%3.lf\\n\" ";
+ $nr += 1;
}
?>