Revision d8f89cce
Added by Renato Botelho over 9 years ago
src/etc/inc/gwlb.inc | ||
---|---|---|
326 | 326 |
} else if ($r['alarm_on'] == 1) { |
327 | 327 |
$r['status'] = "down"; |
328 | 328 |
} else if (isset($gw)) { |
329 |
$dpinger_defaults = return_dpinger_defaults(); |
|
329 | 330 |
if (isset($gw['latencylow']) && |
330 |
is_numeric($gw['latencylow']) && |
|
331 |
($r['latency_avg'] > $gw['latencylow'])) { |
|
331 |
is_numeric($gw['latencylow'])) { |
|
332 |
$latencylow = $gw['latencylow']; |
|
333 |
} else { |
|
334 |
$latencylow = $dpinger_defaults['latencylow']; |
|
335 |
} |
|
336 |
|
|
337 |
if ($r['latency_avg'] > $latencylow) { |
|
332 | 338 |
$r['status'] = "delay"; |
333 |
} else if (isset($gw['losslow']) && |
|
334 |
is_numeric($gw['losslow']) && |
|
335 |
($r['loss'] > $gw['losslow'])) { |
|
336 |
$r['status'] = "loss"; |
|
339 |
} else { |
|
340 |
if (isset($gw['losslow']) && |
|
341 |
is_numeric($gw['losslow'])) { |
|
342 |
$losslow = $gw['losslow']; |
|
343 |
} else { |
|
344 |
$losslow = $dpinger_defaults['losslow']; |
|
345 |
} |
|
346 |
|
|
347 |
if ($r['loss'] > $losslow) { |
|
348 |
$r['status'] = "loss"; |
|
349 |
} |
|
337 | 350 |
} |
338 | 351 |
} |
339 | 352 |
|
Also available in: Unified diff
Use default values for latencylow and losslow when they are not defined by user. Reported by grandrivers at https://forum.pfsense.org/index.php?topic=103818.msg579069#msg579069