Module: check_mk
Branch: master
Commit: 85cf4188d5574d572b75d40e67419020d82e4349
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=85cf4188d5574d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Oct 7 13:19:56 2015 +0200
#2620 FIX Fixed issue loading correct graph templates when HTTP is disabled on system
apache level
---
.werks/2620 | 9 +++++++++
ChangeLog | 1 +
pnp-templates/default.php | 12 +++++++++++-
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/.werks/2620 b/.werks/2620
new file mode 100644
index 0000000..ce0b1cf
--- /dev/null
+++ b/.werks/2620
@@ -0,0 +1,9 @@
+Title: Fixed issue loading correct graph templates when HTTP is disabled on system apache
level
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.7i3
+Date: 1444216764
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 0b167f2..20f768d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -267,6 +267,7 @@
* 2615 FIX: Fixed bug in legacy dashboard conversion when having users not permitted
to access embedded views...
* 2429 FIX: check_mk-netapp_api_disk.summary.php: fixed broken php-template
* 2618 FIX: Fixed "move folder" popup being positioned out of screen on the
right
+ * 2620 FIX: Fixed issue loading correct graph templates when HTTP is disabled on
system apache level
WATO:
* 2365 Removed old deprecated notification global options for plain emails...
diff --git a/pnp-templates/default.php b/pnp-templates/default.php
index 48d7ef1..2e0609b 100644
--- a/pnp-templates/default.php
+++ b/pnp-templates/default.php
@@ -2,9 +2,19 @@
# Fetch dynamic PNP template from Check_MK's new metrics system
+function get_apache_port() {
+ $path = getenv("OMD_ROOT") . "/etc/omd/site.conf";
+ foreach (file($path) as $line) {
+ if (strpos($line, "CONFIG_APACHE_TCP_PORT") === 0) {
+ list($key, $val) = explode("=", $line);
+ return trim($val, "'\n\r");
+ }
+ }
+}
+
$omd_site = getenv("OMD_SITE");
if ($omd_site) {
- $url = "http://localhost/$omd_site/check_mk/";
+ $url =
"http://localhost:".get_apache_port()."/$omd_site/check_mk/";
$template_cache_dir = getenv("OMD_ROOT") .
"/var/check_mk/pnp_template_cache";
}
else {