summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorEirik Oeverby <ltning@anduin.net>2010-08-14 20:09:20 +0200
committerEirik Oeverby <ltning@anduin.net>2010-08-14 20:09:20 +0200
commite6a8a6267c53ec2e4909841267405751934fac63 (patch)
tree4008973e578a8d22eba3aaee136f3f11d3f238d6 /usr
parent03e9ceab443bd4c8747d7bb3264b21d9f4bf48e6 (diff)
downloadpfsense-e6a8a6267c53ec2e4909841267405751934fac63.zip
pfsense-e6a8a6267c53ec2e4909841267405751934fac63.tar.gz
Made LB pool and server status pages somewhat more meaningful
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/status_lb_pool.php15
-rwxr-xr-xusr/local/www/status_lb_vs.php22
2 files changed, 25 insertions, 12 deletions
diff --git a/usr/local/www/status_lb_pool.php b/usr/local/www/status_lb_pool.php
index 7417ac2..e812fca 100755
--- a/usr/local/www/status_lb_pool.php
+++ b/usr/local/www/status_lb_pool.php
@@ -71,6 +71,7 @@ foreach( (array) $relayctl as $line) {
break;
case "host":
$curhost=trim($t[2]);
+ $relay_hosts[$curpool][$curhost]['avail']=trim($t[3]);
$relay_hosts[$curpool][$curhost]['state']=trim($t[4]);
break;
}
@@ -141,7 +142,7 @@ if ($_POST) {
<tr>
<td width="10%" class="listhdrr"><?=gettext("Name");?></td>
<td width="10%" class="listhdrr"><?=gettext("Mode");?></td>
- <td width="10%" class="listhdrr"><?=gettext("Servers");?></td>
+ <td width="20%" class="listhdrr"><?=gettext("Servers");?></td>
<td width="10%" class="listhdrr"><?=gettext("Monitor");?></td>
<td width="30%" class="listhdr"><?=gettext("Description");?></td>
</tr>
@@ -164,18 +165,20 @@ if ($_POST) {
}
?>
</td>
- <td class="listr" align="center" >
- <table border="0" cellpadding="0" cellspacing="2">
+ <td class="listr" align="center">
+ <table border="0" cellpadding="2" cellspacing="0">
<?php
$pool_hosts=array();
foreach ((array) $pool['servers'] as $server) {
$svr['ip']['addr']=$server;
$svr['ip']['state']=$relay_hosts[$pool['name'].":".$pool['port']][$server]['state'];
+ $svr['ip']['avail']=$relay_hosts[$pool['name'].":".$pool['port']][$server]['avail'];
$pool_hosts[]=$svr;
}
foreach ((array) $pool['serversdisabled'] as $server) {
$svr['ip']['addr']="$server";
$svr['ip']['state']='disabled';
+ $svr['ip']['avail']='disabled';
$pool_hosts[]=$svr;
}
asort($pool_hosts);
@@ -204,7 +207,11 @@ if ($_POST) {
echo "<td><input type='radio' name='{$pool['name']}' value='{$server['ip']['addr']}' {$checked}></td>\n";
break;
}
- echo "<td bgcolor={$bgcolor}> {$server['ip']['addr']}:{$pool['port']} </td></tr>";
+ echo "<td bgcolor={$bgcolor}> {$server['ip']['addr']}:{$pool['port']} </td><td bgcolor={$bgcolor}>";
+# echo "<td bgcolor={$bgcolor}> {$server['ip']['addr']}:{$pool['port']} ";
+ if($server['ip']['avail'])
+ echo " ({$server['ip']['avail']}) ";
+ echo "</td></tr>";
}
}
?>
diff --git a/usr/local/www/status_lb_vs.php b/usr/local/www/status_lb_vs.php
index 91e89dd..220b2c1 100755
--- a/usr/local/www/status_lb_vs.php
+++ b/usr/local/www/status_lb_vs.php
@@ -130,9 +130,9 @@ include("head.inc");
<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10%" class="listhdrr"><?=gettext("Name"); ?></td>
- <td width="10%" class="listhdrr"><?=gettext("Port"); ?></td>
+ <td width="20%" class="listhdrr"><?=gettext("Address"); ?></td>
<td width="10%" class="listhdrr"><?=gettext("Servers"); ?></td>
- <td width="30%" class="listhdrr"><?=gettext("Status"); ?></td>
+ <td width="20%" class="listhdrr"><?=gettext("Status"); ?></td>
<td width="30%" class="listhdr"><?=gettext("Description"); ?></td>
</tr>
<?php $i = 0; foreach ($a_vs as $vsent): ?>
@@ -141,7 +141,7 @@ include("head.inc");
<?=$vsent['name'];?>
</td>
<td class="listr" align="center" >
- <?=$vsent['port'];?>
+ <?=$vsent['ipaddr']." : ".$vsent['port'];?>
<br />
</td>
<td class="listr" align="center" >
@@ -158,19 +158,25 @@ include("head.inc");
</table>
</td>
<?php
- switch ($rdr_a[$vsent['name']]['status']) {
+ switch (trim($rdr_a[$vsent['name']]['status'])) {
case 'active':
$bgcolor = "lightgreen";
+ $rdr_a[$vsent['name']]['status'] = "Active";
break;
- default:
+ case 'down':
$bgcolor = "lightcoral";
+ $rdr_a[$vsent['name']]['status'] = "Down";
+ break;
+ default:
+ $bgcolor = "lightgray";
+ $rdr_a[$vsent['name']]['status'] = 'Unknown - relayd not running?';
}
?>
- <td class="listr" bgcolor="<?=$bgcolor?>">
- <?=$rdr_a[$vsent['name']]['status']?>
+ <td class="listr">
+ <table border="0" cellpadding="3" cellspacing="2"><tr><td bgcolor="<?=$bgcolor?>"> <?=$rdr_a[$vsent['name']]['status']?> </td></tr></table>
</td>
<td class="listbg" >
- <?=$vipent['desc'];?>
+ <?=$vsent['desc'];?>
</td>
</tr>
<?php $i++; endforeach; ?>
OpenPOWER on IntegriCloud