summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/filter.inc5
-rw-r--r--etc/inc/gwlb.inc19
2 files changed, 4 insertions, 20 deletions
diff --git a/etc/inc/filter.inc b/etc/inc/filter.inc
index ee9317e..0d4e9a1 100644
--- a/etc/inc/filter.inc
+++ b/etc/inc/filter.inc
@@ -140,8 +140,9 @@ function filter_configure() {
touch($g['tmp_path'] . "/filter_dirty");
}
-function delete_states_for_down_gateways() {
+function filter_delete_states_for_down_gateways() {
global $config;
+
$a_gateways = return_gateways_status();
foreach ($a_gateways as $gateway) {
if ($gateway['status'] == "down") {
@@ -369,7 +370,7 @@ function filter_configure_sync() {
echo ".";
update_filter_reload_status("Processing down interface states");
- delete_states_for_down_gateways();
+ filter_delete_states_for_down_gateways();
update_filter_reload_status("Running plugins");
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 846d33d..70bfd52 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -243,9 +243,7 @@ EOD;
/* return the status of the apinger targets as a array */
function return_gateways_status() {
- global $config;
- global $g;
- $gateways_arr = return_gateways_array();
+ global $config, $g;
$apingerstatus = array();
if (file_exists("{$g['tmp_path']}/apinger.status")) {
@@ -253,21 +251,6 @@ function return_gateways_status() {
}
$status = array();
- $i = 2;
- /* assign a dummy IP address for dynamic interfaces in case we need it */
- $monitor = array();
- foreach($gateways_arr as $name => $gateway) {
- if($gateway['monitor'] == "dynamic") {
- $gateway['monitor'] = "127.0.0.{$i}";
- $i++;
- }
- $status[$gateway['monitor']]['monitor'] = $gateway['monitor'];
- $status[$gateway['monitor']]['interface'] = $gateway['interface'];
- $status[$gateway['monitor']]['gateway'] = $gateway['gateway'];
- $status[$gateway['monitor']]['name'] = $gateway['name'];
- $status[$gateway['monitor']]['status'] = "down";
-
- }
foreach($apingerstatus as $line) {
$info = explode("|", $line);
$target = $info[0];
OpenPOWER on IntegriCloud