Module: check_mk
Branch: master
Commit: c33cfee0c458b4d92b4ba95cad9910c205911403
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c33cfee0c458b4…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Thu Mar 17 09:39:24 2016 +0100
3236 FIX Fixed host page of pnp4nagios
Fixed PHP error when opening host page of pnp4nagios, the error was:
"cannot redeclare replace_cmk_expression()..."
---
.werks/3236 | 13 +++++++++++++
ChangeLog | 1 +
pnp-templates/default.php | 24 +++++++++++++-----------
3 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/.werks/3236 b/.werks/3236
new file mode 100644
index 0000000..e688ff3
--- /dev/null
+++ b/.werks/3236
@@ -0,0 +1,13 @@
+Title: Fixed host page of pnp4nagios
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1458203813
+
+Fixed PHP error when opening host page of pnp4nagios, the error was:
+
+ "cannot redeclare replace_cmk_expression()..."
+
diff --git a/ChangeLog b/ChangeLog
index ff54d15..fb13c64 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -107,6 +107,7 @@
* 3285 FIX: Fixed exception when editing large bookmark lists
* 3287 FIX: Fixed broken crash reporting (Submission of crashes did not work)
* 3290 FIX: Fixed broken event quick delete icon when used in dashlets
+ * 3236 FIX: Fixed host page of pnp4nagios...
WATO:
* 3244 WATO BI Module: swap order of aggregation function and child node
selection...
diff --git a/pnp-templates/default.php b/pnp-templates/default.php
index af16c6e..66a909f 100644
--- a/pnp-templates/default.php
+++ b/pnp-templates/default.php
@@ -79,18 +79,20 @@ if ($cache_state != "uptodate")
}
}
-function replace_cmk_expression($NAME, $MIN, $MAX, $WARN, $CRIT, $text)
-{
- # Replace expressions in the title. This not a full implementation of
- # the complete RPN expression syntax of Check_MK - but sufficient for
- # all used cases.
- foreach ($NAME as $i => $n) {
- $text = str_replace("%($n:min@count)", "$MIN[$i]", $text);
- $text = str_replace("%($n:max@count)", "$MAX[$i]", $text);
- $text = str_replace("%($n:warn@count)", "$WARN[$i]", $text);
- $text = str_replace("%($n:crit@count)", "$CRIT[$i]", $text);
+if (!function_exists("replace_cmk_expression")) {
+ function replace_cmk_expression($NAME, $MIN, $MAX, $WARN, $CRIT, $text)
+ {
+ # Replace expressions in the title. This not a full implementation of
+ # the complete RPN expression syntax of Check_MK - but sufficient for
+ # all used cases.
+ foreach ($NAME as $i => $n) {
+ $text = str_replace("%($n:min@count)", "$MIN[$i]",
$text);
+ $text = str_replace("%($n:max@count)", "$MAX[$i]",
$text);
+ $text = str_replace("%($n:warn@count)", "$WARN[$i]",
$text);
+ $text = str_replace("%($n:crit@count)", "$CRIT[$i]",
$text);
+ }
+ return $text;
}
- return $text;
}
# Now read template information from cache file, if present