Merge pull request #3066 from phil-davis/notifychannelupdown

This commit is contained in:
Renato Botelho 2016-08-04 18:33:06 -03:00
commit c22ddfe797

View File

@ -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;