Module: check_mk
Branch: master
Commit: fa30ad14678ec668e44caf1c1c9b549372d49b14
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fa30ad14678ec6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Mar 12 16:16:20 2015 +0100
default.php: Fix problem with too long filename, add graph titles
---
pnp-templates/default.php | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/pnp-templates/default.php b/pnp-templates/default.php
index 9c5bf89..3c67728 100644
--- a/pnp-templates/default.php
+++ b/pnp-templates/default.php
@@ -25,7 +25,7 @@ sort($perf_vars);
$id_string = $NAGIOS_CHECK_COMMAND . ":" . implode(",", $perf_vars);
# Get current state of previously cached template data for this ID
-$template_cache_path = $template_cache_dir . "/" . $id_string;
+$template_cache_path = $template_cache_dir . "/" . md5($id_string);
if (file_exists($template_cache_path)) {
$age = time() - filemtime($template_cache_path);
if ($age < 60 * 10)
@@ -60,9 +60,11 @@ if ($cache_state == "uptodate") {
$rrdbase = substr($NAGIOS_XMLFILE, 0, strlen($NAGIOS_XMLFILE) - 4);
$fd = fopen($template_cache_path, "r");
while (!feof($fd)) {
+ $dsname_line = trim(fgets($fd));
$option_line = trim(fgets($fd));
$graph_line = str_replace('$RRDBASE$', $rrdbase, fgets($fd));
- if ($option_line && $graph_line) {
+ if ($dsname_line && $option_line && $graph_line) {
+ $ds_name[] = $dsname_line;
$opt[] = $option_line;
$def[] = $graph_line;
}