summaryrefslogtreecommitdiffstats
path: root/usr/local/www/includes/functions.inc.php
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-09-09 21:25:49 +0000
committerErmal <eri@pfsense.org>2010-09-09 21:25:49 +0000
commit68f291ffe2e8e6e5d9470076365fd1127e7f3655 (patch)
tree307627a01569bddb17905ee3b9aced0a372fccc9 /usr/local/www/includes/functions.inc.php
parent3d471a14d42f9a17b06eeac2708c29f959ca98d8 (diff)
downloadpfsense-68f291ffe2e8e6e5d9470076365fd1127e7f3655.zip
pfsense-68f291ffe2e8e6e5d9470076365fd1127e7f3655.tar.gz
Ticket #876. Show all gateways even though apinger is not monitoring them, for various reasons, this removes user confusion in the status pages.
Diffstat (limited to 'usr/local/www/includes/functions.inc.php')
-rw-r--r--usr/local/www/includes/functions.inc.php22
1 files changed, 15 insertions, 7 deletions
diff --git a/usr/local/www/includes/functions.inc.php b/usr/local/www/includes/functions.inc.php
index 677c2fd..8eff06a 100644
--- a/usr/local/www/includes/functions.inc.php
+++ b/usr/local/www/includes/functions.inc.php
@@ -24,19 +24,22 @@ function get_stats() {
}
function get_gatewaystats() {
+ $a_gateways = return_gateways_array();
$gateways_status = array();
- $gateways_status = return_gateways_status();
+ $gateways_status = return_gateways_status(true);
$data = "";
$isfirst = true;
- foreach($gateways_status as $gw) {
+ foreach($a_gateways as $gname => $gw) {
if(!$isfirst)
$data .= ",";
$isfirst = false;
$data .= $gw['name'] . ",";
- $data .= lookup_gateway_ip_by_name($gw['name']) . ",";
- $data .= $gw['delay'] . ",";
- $data .= $gw['loss'] . ",";
- switch(strtolower($gw['status'])) {
+ $data .= lookup_gateway_ip_by_name($gname) . ",";
+ if ($gateways_status[$gname]) {
+ $gws = $gateways_status[$gname];
+ $data .= $gws['delay'] . ",";
+ $data .= $gws['loss'] . ",";
+ switch(strtolower($gws['status'])) {
case "none":
$online = "Online";
$bgcolor = "lightgreen";
@@ -55,6 +58,11 @@ function get_gatewaystats() {
break;
default:
$online = "Gathering data";
+ break;
+ }
+ } else {
+ $online = "Unknown";
+ $bgcolor = "lightgray";
}
$data .= "<table><tr><td bgcolor=\"$bgcolor\" > $online </td></td></tr></table>";
}
@@ -257,4 +265,4 @@ function get_interfacestatus() {
return $data;
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud