Re: selected period need to show in performance graph
Posted: Fri Mar 22, 2019 2:08 pm
dear tgriep
thanks for your great efforts but still there issue even in testing phase
more graphtemplate.php
$displayname1 = shell_exec( 'php /usr/local/nagios/share/pnp/templates/fetchdispname.php router2int2' );
$displayname2 = shell_exec( 'php /usr/local/nagios/share/pnp/templates/fetchdispname.php "router3int3"' );
$def[1] .= "COMMENT:\" DispName1 $displayname1 \\n\" ";
$def[1] .= "COMMENT:\" DispName2 $displayname2 \\n\" ";
passed the static parameters for testing purpose with Quotes and without Quotes, from CLI its okay but in real scenario unable to match even I tried with == or === (logical AND)
working fine from CLI with quotes
php /usr/local/nagios/share/pnp/templates/fetchdispname.php "router3int3"
diSPNameTHreerouter3int3
working fine from CLI without quotes
php /usr/local/nagios/share/pnp/templates/fetchdispname.php router2int2
dispname2router2int2
more fetchdispname.php
<?php
$from_mrtg=$argv[1];
$MeraSaya="SorrY";
$Hlines = file('hostservice.txt');
foreach ($Hlines as $Kline) {
$Yparts = explode(' ', $Kline);
if ($Yparts[0]==$from_mrtg) {
$MeraSaya=substr($Yparts[1], 0, -1);
}
}
print($MeraSaya.$from_mrtg);
?>
more hostservice.txt
router1int1 dispname1
router2int2 dispname2
router3int3 diSPNameTHree
but on the graph showing as below
DispName1 SorrYrouter2int2
DispName2 SorrYrouter3int3
regards
sorry for trouble
thanks for your great efforts but still there issue even in testing phase
more graphtemplate.php
$displayname1 = shell_exec( 'php /usr/local/nagios/share/pnp/templates/fetchdispname.php router2int2' );
$displayname2 = shell_exec( 'php /usr/local/nagios/share/pnp/templates/fetchdispname.php "router3int3"' );
$def[1] .= "COMMENT:\" DispName1 $displayname1 \\n\" ";
$def[1] .= "COMMENT:\" DispName2 $displayname2 \\n\" ";
passed the static parameters for testing purpose with Quotes and without Quotes, from CLI its okay but in real scenario unable to match even I tried with == or === (logical AND)
working fine from CLI with quotes
php /usr/local/nagios/share/pnp/templates/fetchdispname.php "router3int3"
diSPNameTHreerouter3int3
working fine from CLI without quotes
php /usr/local/nagios/share/pnp/templates/fetchdispname.php router2int2
dispname2router2int2
more fetchdispname.php
<?php
$from_mrtg=$argv[1];
$MeraSaya="SorrY";
$Hlines = file('hostservice.txt');
foreach ($Hlines as $Kline) {
$Yparts = explode(' ', $Kline);
if ($Yparts[0]==$from_mrtg) {
$MeraSaya=substr($Yparts[1], 0, -1);
}
}
print($MeraSaya.$from_mrtg);
?>
more hostservice.txt
router1int1 dispname1
router2int2 dispname2
router3int3 diSPNameTHree
but on the graph showing as below
DispName1 SorrYrouter2int2
DispName2 SorrYrouter3int3
regards
sorry for trouble