diff options
-rw-r--r-- | src/etc/inc/gwlb.inc | 18 |
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; |