summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-08-04 18:33:06 -0300
committerRenato Botelho <renato@netgate.com>2016-08-04 18:33:06 -0300
commitc22ddfe7972f70b791e08a67dd97c2583cf44b26 (patch)
tree8407fc8131d61e5d75ee36b5766e00acb36fc35b
parenta035b77c6aead547c1601e9d6067087571a8cf78 (diff)
parent197cd6c0f8d5c8d58314bf26614acf947428b547 (diff)
downloadpfsense-c22ddfe7972f70b791e08a67dd97c2583cf44b26.zip
pfsense-c22ddfe7972f70b791e08a67dd97c2583cf44b26.tar.gz
Merge pull request #3066 from phil-davis/notifychannelupdown
-rw-r--r--src/etc/inc/gwlb.inc18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/etc/inc/gwlb.inc b/src/etc/inc/gwlb.inc
index fd399f8..1d14c30 100644
--- a/src/etc/inc/gwlb.inc
+++ b/src/etc/inc/gwlb.inc
@@ -955,15 +955,27 @@ function return_gateway_groups_array() {
$gwdown = true;
}
if ($gwdown == true) {
- log_error($msg);
- notify_via_growl($msg);
- notify_via_smtp($msg);
+ if (!file_exists("/tmp/.down.$gwname")) {
+ $msg .= "\n".implode("|", $status);
+ touch("/tmp/.down.$gwname");
+ log_error($msg);
+ notify_via_growl($msg);
+ notify_via_smtp($msg);
+ }
} else {
/* Online add member */
if (!is_array($tiers[$tier])) {
$tiers[$tier] = array();
}
$tiers[$tier][] = $gwname;
+ if (file_exists("/tmp/.down.$gwname")) {
+ $msg = "MONITOR: {$gwname} is available now, adding to routing group";
+ $msg .= "\n".implode("|", $status);
+ log_error($msg);
+ notify_via_growl($msg);
+ notify_via_smtp($msg);
+ unlink("/tmp/.down.$gwname");
+ }
}
} else if (isset($gateways_arr[$gwname]['monitor_disable'])) {
$tiers[$tier][] = $gwname;
OpenPOWER on IntegriCloud