summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.homeunix.net>2009-07-09 23:06:33 -0400
committerScott Ullrich <sullrich@pfsense.homeunix.net>2009-07-09 23:06:33 -0400
commit9f1d61d377e6b842d37718df95e2f051dd76759c (patch)
tree35ed6b71ae86221e4f3d871ff2a96317870e66ee /etc
parentb321355341e2617a8cebb226a5f45bf6a8fb0b8c (diff)
downloadpfsense-9f1d61d377e6b842d37718df95e2f051dd76759c.zip
pfsense-9f1d61d377e6b842d37718df95e2f051dd76759c.tar.gz
Send gateway notifications to GROWL
Diffstat (limited to 'etc')
-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