Project

General

Profile

Feature #2839 ยป notification_up_down.patch

Alex Kolesnik, 02/25/2013 06:55 AM

View differences:

gwlb.inc 2013-02-25 16:38:49.000000000 +0400
472 472
                                               $gwdown = true;
473 473
                                       }
474 474
                                       if ($gwdown == true) {
475
                                               log_error($msg);
476
                                               notify_via_growl($msg);
477
                                               notify_via_smtp($msg);
478
                                       } else
475
                                               if (!file_exists("/tmp/.down.$gwname")) {
476
                                                       $msg .= "\n".implode("|", $status);
477
                                                       touch("/tmp/.down.$gwname");
478
                                                       log_error($msg);
479
                                                       notify_via_growl($msg);
480
                                                       notify_via_smtp($msg);
481
                                               }
482
                                       } else {
479 483
                                               /* Online add member */
480 484
                                               $tiers[$tier][] = $gwname;
485
                                               if (file_exists("/tmp/.down.$gwname")) {
486
                                                       $msg = "MONITOR: {$gwname} is available now, adding to routing group";
487
                                                       $msg .= "\n".implode("|", $status);
488
                                                       log_error($msg);
489
                                                       notify_via_growl($msg);
490
                                                       notify_via_smtp($msg);
491
                                                       unlink("/tmp/.down.$gwname");
492
                                               }
493
                                       }
481 494
                               } else if (isset($gateways_arr[$gwname]['monitor_disable']))
482 495
                                       $tiers[$tier][] = $gwname;
    (1-1/1)