summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2010-05-06 22:50:05 +0000
committerErmal <eri@pfsense.org>2010-05-06 22:50:34 +0000
commit75466131f5b78618311d9d23f137eb926b87dd94 (patch)
treeffe17585ffb7e82862127c9760fc740c4f14ac01 /etc
parent10d171f24991d31bf870cd2aff65ac8f27293b03 (diff)
downloadpfsense-75466131f5b78618311d9d23f137eb926b87dd94.zip
pfsense-75466131f5b78618311d9d23f137eb926b87dd94.tar.gz
Catch up with latest apinger changes to make easier to extract the status of gateways.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/gwlb.inc33
1 files changed, 7 insertions, 26 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 3506869..41020d2 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -222,32 +222,13 @@ function return_gateways_status() {
}
foreach($apingerstatus as $line) {
- $fields = explode(":", $line);
- switch($fields[0]) {
- case "Target":
- $target = trim($fields[1]);
- break;
- case "Description":
- if($target)
- $status[$target]['name'] = trim($fields[1]);
- break;
- case "Last reply received":
- if($target)
- $status[$target]['lastcheck'] = trim($fields[1]) .":". trim($fields[2]) .":". trim($fields[3]);
- break;
- case "Average delay":
- if($target)
- $status[$target]['delay'] = trim($fields[1]);
- break;
- case "Average packet loss":
- if($target)
- $status[$target]['loss'] = trim($fields[1]);
- break;
- case "Active alarms":
- if($target)
- $status[$target]['status'] = trim($fields[1]);
- break;
- }
+ $info = explode("|", $line);
+ $target = $info[0];
+ $status[$target]['name'] = $info[1];
+ $status[$target]['lastcheck'] = $info[4] ? date('r', $info[4]) : date('r');
+ $status[$target]['delay'] = $info[5];
+ $status[$target]['loss'] = $info[6];
+ $status[$target]['status'] = trim($info[7]);
}
return($status);
}
OpenPOWER on IntegriCloud