Revision 37c98ef9
Added by Seth Mos over 16 years ago
etc/inc/gwlb.inc | ||
---|---|---|
41 | 41 |
global $g; |
42 | 42 |
$gateways_arr = return_gateways_array(); |
43 | 43 |
|
44 |
if (!is_array($config['gateways']['settings'])) { |
|
45 |
$a_settings['latencylow'] = "10"; |
|
46 |
$a_settings['latencyhigh'] = "20"; |
|
47 |
$a_settings['losslow'] = "100"; |
|
48 |
$a_settings['losshigh'] = "500"; |
|
49 |
} |
|
50 |
|
|
51 |
$a_settings = &$config['gateways']['settings']; |
|
52 |
|
|
44 | 53 |
/* kill apinger process */ |
45 | 54 |
if(is_process_running("apinger")) |
46 | 55 |
mwexec("/usr/bin/killall apinger", true); |
... | ... | |
92 | 101 |
## This alarm will be fired when responses are delayed more than 200ms |
93 | 102 |
## it will be canceled, when the delay drops below 100ms |
94 | 103 |
alarm delay "delay" { |
95 |
delay_low 200ms
|
|
96 |
delay_high 500ms
|
|
104 |
delay_low {$a_settings['latencylow']}ms
|
|
105 |
delay_high {$a_settings['latencyhigh']}ms
|
|
97 | 106 |
} |
98 | 107 |
|
99 | 108 |
## "Loss" alarm definition. |
100 | 109 |
## This alarm will be fired when packet loss goes over 20% |
101 | 110 |
## it will be canceled, when the loss drops below 10% |
102 | 111 |
alarm loss "loss" { |
103 |
percent_low 10
|
|
104 |
percent_high 20
|
|
112 |
percent_low {$a_settings['losslow']}
|
|
113 |
percent_high {$a_settings['losshigh']}
|
|
105 | 114 |
} |
106 | 115 |
|
107 | 116 |
target default { |
Also available in: Unified diff
Add code to the backend so that apinger will use the configured high and low watermarks for latency and packetloss.