--- gwlb.inc.org 2012-12-27 17:58:42.000000000 +0400 +++ gwlb.inc 2013-02-25 16:38:49.000000000 +0400 @@ -472,12 +472,25 @@ $gwdown = true; } if ($gwdown == true) { - log_error($msg); - notify_via_growl($msg); - notify_via_smtp($msg); - } else + 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 */ $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;