summaryrefslogtreecommitdiffstats
path: root/src/etc
diff options
context:
space:
mode:
authorjazzl0ver <jazzl0ver@users.noreply.github.com>2016-04-06 14:06:52 +0300
committerjazzl0ver <jazzl0ver@users.noreply.github.com>2016-04-06 14:06:52 +0300
commit02697cb42f76c55f326a864ebc9f8e7c7eea3fd4 (patch)
tree30b86c48056fa433a3cdcb14f10707a3bcee88e2 /src/etc
parent43cbe85544cf045db6e9f14b0ade547b239cbece (diff)
downloadpfsense-02697cb42f76c55f326a864ebc9f8e7c7eea3fd4.zip
pfsense-02697cb42f76c55f326a864ebc9f8e7c7eea3fd4.tar.gz
notify by email and in syslog when a channel goes up or down
Diffstat (limited to 'src/etc')
-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 e712319..134690d 100644
--- a/src/etc/inc/gwlb.inc
+++ b/src/etc/inc/gwlb.inc
@@ -937,15 +937,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