summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/gwlb.inc18
1 files changed, 13 insertions, 5 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 4da107a..09db94a 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -308,18 +308,24 @@ function return_gateway_groups_array() {
continue;
}
if (preg_match("/down/i", $status['status'])) {
- log_error("MONITOR: $gwname has high latency, removing from routing group");
+ $msg = "MONITOR: $gwname has high latency, removing from routing group";
+ log_error($msg);
+ notify_via_growl($msg);
} 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");
+ $msg = "MONITOR: $gwname has packet loss, removing from routing group";
+ log_error($msg);
+ notify_via_growl($msg);
} else {
$tiers[$tier][] = $gwname;
}
} 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");
+ $msg = "MONITOR: $gwname has high latency, removing from routing group";
+ log_error($msg);
+ notify_via_growl($msg);
} else {
$tiers[$tier][] = $gwname;
}
@@ -332,7 +338,9 @@ function return_gateway_groups_array() {
$tiers_count = count($tiers);
if($tiers_count == 0) {
/* Oh dear, we have no members! Engage Plan B */
- log_error("All gateways are unavailable, proceeding with configured XML settings!");
+ $msg = "All gateways are unavailable, proceeding with configured XML settings!";
+ log_error($msg);
+ notify_via_growl($msg);
foreach($group['item'] as $item) {
foreach($group['item'] as $item) {
$itemsplit = explode("|", $item);
@@ -471,4 +479,4 @@ function get_interface_gateway($interface) {
return $gw;
}
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud