summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2009-03-13 22:00:58 +0100
committerSeth Mos <seth.mos@xs4all.nl>2009-03-13 22:00:58 +0100
commit37c98ef9d565b908e20aee4c106819c65499b841 (patch)
treec13e5730d867cdf1df5bf54c69d3aa3cb3868a85 /etc
parent6c5334c716facdb4c72f36c66307c18622d17222 (diff)
downloadpfsense-37c98ef9d565b908e20aee4c106819c65499b841.zip
pfsense-37c98ef9d565b908e20aee4c106819c65499b841.tar.gz
Add code to the backend so that apinger will use the configured high and low watermarks for latency and packetloss.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/gwlb.inc17
1 files changed, 13 insertions, 4 deletions
diff --git a/etc/inc/gwlb.inc b/etc/inc/gwlb.inc
index 4a75419..3c5e141 100644
--- a/etc/inc/gwlb.inc
+++ b/etc/inc/gwlb.inc
@@ -41,6 +41,15 @@ function setup_gateways_monitor() {
global $g;
$gateways_arr = return_gateways_array();
+ if (!is_array($config['gateways']['settings'])) {
+ $a_settings['latencylow'] = "10";
+ $a_settings['latencyhigh'] = "20";
+ $a_settings['losslow'] = "100";
+ $a_settings['losshigh'] = "500";
+ }
+
+ $a_settings = &$config['gateways']['settings'];
+
/* kill apinger process */
if(is_process_running("apinger"))
mwexec("/usr/bin/killall apinger", true);
@@ -92,16 +101,16 @@ alarm down "down" {
## This alarm will be fired when responses are delayed more than 200ms
## it will be canceled, when the delay drops below 100ms
alarm delay "delay" {
- delay_low 200ms
- delay_high 500ms
+ delay_low {$a_settings['latencylow']}ms
+ delay_high {$a_settings['latencyhigh']}ms
}
## "Loss" alarm definition.
## This alarm will be fired when packet loss goes over 20%
## it will be canceled, when the loss drops below 10%
alarm loss "loss" {
- percent_low 10
- percent_high 20
+ percent_low {$a_settings['losslow']}
+ percent_high {$a_settings['losshigh']}
}
target default {
OpenPOWER on IntegriCloud