[checkmk-commits] Check_MK Git: check_mk: fixed broken default.php template

Andreas Boesl ab at mathias-kettner.de
Fri Feb 6 14:57:08 CET 2015


Module: check_mk
Branch: master
Commit: abb5096a5e2e57f09242cbcc43da9839eccce793
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=abb5096a5e2e57f09242cbcc43da9839eccce793

Author: Andreas Boesl <ab at mathias-kettner.de>
Date:   Fri Feb  6 14:57:02 2015 +0100

fixed broken default.php template

---

 pnp-templates/default.php |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/pnp-templates/default.php b/pnp-templates/default.php
index 09cb5d8..cf99bcf 100644
--- a/pnp-templates/default.php
+++ b/pnp-templates/default.php
@@ -28,15 +28,18 @@ $fd = @fopen($url . "pnp_template.py"
                   . "&service="       . urlencode($servicedesc)
                   . "&perfdata="      . urlencode($NAGIOS_PERFDATA)
                   . "&check_command=" . urlencode($NAGIOS_CHECK_COMMAND), "r");
+
+$use_legacy_template = True;
 if ($fd) {
     while (!feof($fd)) {
+        $use_legacy_template = False;
         $opt[] = trim(fgets($fd));
         $def[] = trim(fgets($fd));
     }
 }
-else
-{
 
+if ($use_legacy_template)
+{
     $_WARNRULE = '#FFFF00';
     $_CRITRULE = '#FF0000';
     $_AREA     = '#256aef';
@@ -93,7 +96,7 @@ else
                     $vlabel = $VAL['UNIT'];
             }
 
-            $opt[$KEY] = '--vertical-label "' . $titel . $vlabel . '" --title "' . $this->MACRO['DISP_HOSTNAME'] . ' / ' . $this->MACRO['DISP_SERVICEDESC'] . '"' . $upper . $lower;
+            $opt[$KEY] = '--vertical-label "' . $vlabel . '" --title "' . $this->MACRO['DISP_HOSTNAME'] . ' / ' . $this->MACRO['DISP_SERVICEDESC'] . '"' . $upper . $lower;
             $ds_name[$KEY] = $VAL['LABEL'];
             $def[$KEY]  = rrd::def     ("var1", $VAL['RRDFILE'], $VAL['DS'], "AVERAGE");
             $def[$KEY] .= rrd::gradient("var1", "3152A5", "BDC6DE", rrd::cut($VAL['NAME'],16), 20);



More information about the checkmk-commits mailing list