diff options
author | Seth Mos <seth.mos@xs4all.nl> | 2009-05-28 00:01:24 +0200 |
---|---|---|
committer | Seth Mos <seth.mos@xs4all.nl> | 2009-05-28 00:01:24 +0200 |
commit | 857ce5f3486bfaea8e5ca34878ff169324238e99 (patch) | |
tree | 2a2adf2edd2a64f39575d98620d7cc225c23dd5c /etc/inc/gwlb.inc | |
parent | 5cd26039aa138dad6b3e8cdfd22b16dc1818c8a6 (diff) | |
download | pfsense-857ce5f3486bfaea8e5ca34878ff169324238e99.zip pfsense-857ce5f3486bfaea8e5ca34878ff169324238e99.tar.gz |
Fix the function that checks if a link is to be included or excluded.
Multiple alarms can be returned which requires different parsing.
Scott will test this
Diffstat (limited to 'etc/inc/gwlb.inc')
-rw-r--r-- | etc/inc/gwlb.inc | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc index e6fb8b1..7329658 100644 --- a/etc/inc/gwlb.inc +++ b/etc/inc/gwlb.inc @@ -307,27 +307,25 @@ function return_gateway_groups_array() { if(($status['name'] != $gwname)) { continue; } - switch($status['status']) { - case "None": - /* Online add member */ + if (preg_match("/down/i", $status['status'])) { + log_error("MONITOR: $gwname has high latency, removing from routing group"); + } elseif (preg_match("/loss/i", $status['status'])) { + if (strstr($group['trigger'], "loss")) { + /* packet loss */ + log_error("MONITOR: $gwname has packet loss, removing from routing group"); + } else { $tiers[$tier][] = $gwname; - break; - case "delay": - if(strstr($group['trigger'] , "latency")) { - /* high latency */ - log_error("MONITOR: $gwname has high latency, removing from routing group"); - } else { - $tiers[$tier][] = $gwname; - } - break; - case "loss": - if(strstr($group['trigger'], "loss")) { - /* packet loss */ - log_error("MONITOR: $gwname has packet loss, removing from routing group"); - } else { - $tiers[$tier][] = $gwname; - } - break; + } + } elseif (preg_match("/delay/i", $status['status'])) { + if (strstr($group['trigger'] , "latency")) { + /* high latency */ + log_error("MONITOR: $gwname has high latency, removing from routing group"); + } else { + $tiers[$tier][] = $gwname; + } + } elseif (preg_match("/none/i", $status['status'])) { + /* Online add member */ + $tiers[$tier][] = $gwname; } } } |