Give apinger the new srcip dircetive so it does not struggle anymore with the routing table.

This commit is contained in:
Ermal 2010-06-14 19:26:32 +00:00
parent ea5f6c955b
commit 2f92b34db0

View File

@ -162,6 +162,10 @@ EOD;
$apingercfg .= "target \"{$gateway['monitor']}\" {\n";
$apingercfg .= " description \"{$gateway['name']}\"\n";
$gwifip = find_interface_ip($gateway['interface']);
if (!is_ipaddr($gwifip))
continue; //Skip this target
$apingercfg .= " srcip \"{$gwifip}\"\n";
$alarms = "";
$override = false;
if (!empty($gwref['lowloss'])) {
@ -217,9 +221,7 @@ EOD;
* route as this will break the routing table */
continue;
} else {
if (!empty($gateway_status[$gateway['monitor']]) && $gateway_status[$gateway['monitor']]['status'] == "down")
; /* This check makes sure that we do not delete previous routes. */
else if ($gateway['gateway'] != "dynamic" && is_ipaddr($gateway['gateway'])) {
if ($gateway['gateway'] != "dynamic" && is_ipaddr($gateway['gateway'])) {
mwexec("/sbin/route delete -host " . escapeshellarg($gateway['monitor']));
mwexec("/sbin/route add -host " . escapeshellarg($gateway['monitor']) .
" " . escapeshellarg($gateway['gateway']));
@ -393,7 +395,7 @@ function return_gateway_groups_array() {
} else {
$tiers[$tier][] = $gwname;
}
} elseif (stristr($status['status'], "none")) {
} elseif ($status['status'] == "none")) {
/* Online add member */
$tiers[$tier][] = $gwname;
}