Fixes #536. More fixes and optimizations on the various functions and status pages used for gateways [groups].

This commit is contained in:
Ermal 2010-05-18 17:33:57 +00:00
parent fe22a89b4e
commit 01207fd848
2 changed files with 11 additions and 12 deletions

View File

@ -151,15 +151,14 @@ EOD;
if((is_numeric($gateway['attribute'])) && is_ipaddr($gwref['monitor'])) {
$gateway['monitor'] = $gwref['monitor'];
} else {
if(($gateway['gateway'] == "dynamic") && ($gateway['monitor'])) {
if ($gateway['gateway'] == "dynamic") {
$gateway['monitor'] = "127.0.0.{$i}";
$i++;
}
if(!is_ipaddr($gateway['monitor'])) {
if (!is_ipaddr($gateway['monitor']))
$gateway['monitor'] = $gateway['gateway'];
}
}
$apingercfg .= "target \"{$gateway['monitor']}\" {\n";
$apingercfg .= " description \"{$gateway['name']}\"\n";
$alarms = "";

View File

@ -74,9 +74,9 @@ $counter = 1;
<table border="0" cellpadding="0" cellspacing="2">
<?php
$monitor = $gateway['monitor'];
if(empty($monitor)) {
$monitor = $gateway['gateway'];
}
if(empty($monitor)) {
$monitor = $gateway['gateway'];
}
switch($gateways_status[$monitor]['status']) {
case "None":
$online = "Online";
@ -94,11 +94,11 @@ $counter = 1;
$online = "Warning, Packetloss";
$bgcolor = "khaki";
break;
default:
$online = "Gathering data";
}
echo "<tr><td bgcolor=\"$bgcolor\" > $online </td>";
$counter++;
default:
$online = "Gathering data";
}
echo "<tr><td bgcolor=\"$bgcolor\" > $online </td>";
$counter++;
?>
</table>
</td>