From 7466c2eb30242d7cd5624fa9fab83aa4c3f4e2e4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Wed, 18 Jul 2018 00:01:05 +0200 Subject: [PATCH] system: remove unused action_disable setting --- src/etc/inc/gwlb.inc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/etc/inc/gwlb.inc b/src/etc/inc/gwlb.inc index 776c7d77f..c2ff972a1 100644 --- a/src/etc/inc/gwlb.inc +++ b/src/etc/inc/gwlb.inc @@ -432,10 +432,8 @@ EOD; /* status socket */ $params .= exec_safe('-u %s ', "/var/run/dpinger_{$name}.sock"); - if (empty($gateway['action_disable'])) { - /* command to run on alarm */ - $params .= '-C /usr/local/etc/rc.monitor '; - } + /* command to run on alarm */ + $params .= '-C /usr/local/etc/rc.monitor '; $params .= exec_safe( '-d %s ', @@ -539,7 +537,7 @@ function return_gateways_status($byname = false) $gateways_arr = return_gateways_array(); foreach ($dpinger_gws as $gwname => $gwdata) { - $dpinger_status = get_dpinger_status($gwname, $gateways_arr[$gwname]['action_disable']); + $dpinger_status = get_dpinger_status($gwname); if ($dpinger_status === false) { continue; } @@ -1211,7 +1209,7 @@ function running_dpinger_processes() return $result; } -function get_dpinger_status($gwname, $detailed = false) +function get_dpinger_status($gwname) { $running_processes = running_dpinger_processes(); @@ -1275,9 +1273,9 @@ function get_dpinger_status($gwname, $detailed = false) } if ($r['latency_avg'] > $settings['latencyhigh']) { - $r['status'] = $detailed ? 'delay' : 'down'; + $r['status'] = 'down'; } elseif ($r['loss'] > $settings['losshigh']) { - $r['status'] = $detailed ? 'loss' : 'down'; + $r['status'] = 'down'; } elseif ($r['latency_avg'] > $settings['latencylow']) { $r['status'] = 'delay'; } elseif ($r['loss'] > $settings['losslow']) {