Module: check_mk
Branch: master
Commit: d487ff0933b1340631ca6a566b822a0f949627fc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d487ff0933b134…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jun 3 15:39:59 2015 +0200
additional fixes for default pnp template handling
---
pnp-templates/default.php | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/pnp-templates/default.php b/pnp-templates/default.php
index 8a7e4bc..48d7ef1 100644
--- a/pnp-templates/default.php
+++ b/pnp-templates/default.php
@@ -50,17 +50,15 @@ if ($cache_state != "uptodate")
$data .= fread($fd, 4096);
}
fclose($fd);
- if ($data) {
- $fd = fopen($template_cache_path, "w");
- fwrite($fd, $data);
- fclose($fd);
- $cache_state = "uptodate";
- }
+ $fd = fopen($template_cache_path, "w");
+ fwrite($fd, $data);
+ fclose($fd);
+ $cache_state = "uptodate";
}
}
# Now read template information from cache file, if present
-if ($cache_state == "uptodate") {
+if (($cache_state == "uptodate" || $cache_state == "stale")
&& filesize($template_cache_path) > 0) {
$rrdbase = substr($NAGIOS_XMLFILE, 0, strlen($NAGIOS_XMLFILE) - 4);
$fd = fopen($template_cache_path, "r");
while (!feof($fd)) {