Project

General

Profile

Bug #6142

Validate and adjust apinger to dpinger parameters on upgrade

Added by Phillip Davis about 2 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
Normal
Category:
Gateway monitoring
Target version:
Start date:
04/13/2016
Due date:
% Done:

100%

Affected Version:
2.3
Affected Architecture:

Description

There are some problems reported with old apinger parameters not converting to dpinger parameters on upgrade from 2.2.* to 2.3
Review upgrade_config.inc upgrade_130_to_131() which attempts to do it, and fix as needed.
Forum: https://forum.pfsense.org/index.php?topic=109706.msg611062#msg611062

Associated revisions

Revision 21300959
Added by Phillip Davis about 2 years ago

Fix #6142 validate and adjust dpinger params on upgrade

1) The previous "down" value was being converted to msec and put into
"loss_interval". It should go into "time_period".
2) loss_interval must always be at least latencyhigh - make it so if
latencyhigh is big.
3) alert_interval must always be at least probe interval - make it so if
the probe interval is high.
4) The time_period for averaging the results must be at least 2 probe
intervals plus loss_interval (ensuring there should always be 2 probe
results by the time_period expiry) - make it so.

These various conditions taken from the validation code in
system_gateways_edit.php

Note: I have explicitly put the necessary default dpinger parameter
values here, rather than calling return_dpinger_defaults() because at
this point in any future conversion we want to use these particular
numbers, not what the defaults happen to be in pfSense 2.4 or 3.0 or...

Revision e2ddef9e
Added by Phillip Davis about 2 years ago

Fix #6142 validate and adjust dpinger params on upgrade

1) The previous "down" value was being converted to msec and put into
"loss_interval". It should go into "time_period".
2) loss_interval must always be at least latencyhigh - make it so if
latencyhigh is big.
3) alert_interval must always be at least probe interval - make it so if
the probe interval is high.
4) The time_period for averaging the results must be at least 2 probe
intervals plus loss_interval (ensuring there should always be 2 probe
results by the time_period expiry) - make it so.

These various conditions taken from the validation code in
system_gateways_edit.php

Note: I have explicitly put the necessary default dpinger parameter
values here, rather than calling return_dpinger_defaults() because at
this point in any future conversion we want to use these particular
numbers, not what the defaults happen to be in pfSense 2.4 or 3.0 or...

Revision 5e367fdd
Added by Phillip Davis about 2 years ago

Fix #6142 validate and adjust dpinger params on upgrade

1) The previous "down" value was being converted to msec and put into
"loss_interval". It should go into "time_period".
2) loss_interval must always be at least latencyhigh - make it so if
latencyhigh is big.
3) alert_interval must always be at least probe interval - make it so if
the probe interval is high.
4) The time_period for averaging the results must be at least 2 probe
intervals plus loss_interval (ensuring there should always be 2 probe
results by the time_period expiry) - make it so.

These various conditions taken from the validation code in
system_gateways_edit.php

Note: I have explicitly put the necessary default dpinger parameter
values here, rather than calling return_dpinger_defaults() because at
this point in any future conversion we want to use these particular
numbers, not what the defaults happen to be in pfSense 2.4 or 3.0 or...

Revision 1d616571
Added by Chris Buechler about 2 years ago

Don't foreach unless it's an array. Ticket #6142

Revision 13dab353
Added by Chris Buechler about 2 years ago

Don't foreach unless it's an array. Ticket #6142

Revision be09e9e8
Added by Phillip Davis about 2 years ago

Don't foreach unless it's an array. Ticket #6142

Similar thing to https://github.com/pfsense/pfsense/commit/13dab3538fe8b6c1688142c89a017520ad0aaac6 should be done here in upgrade_130_to_131()

Revision a39e519b
Added by Phillip Davis about 2 years ago

Don't foreach unless it's an array. Ticket #6142

Similar thing to https://github.com/pfsense/pfsense/commit/13dab3538fe8b6c1688142c89a017520ad0aaac6 should be done here in upgrade_130_to_131()

History

#1 Updated by Phillip Davis about 2 years ago

Part 1 of the fix: https://github.com/pfsense/pfsense/pull/2869
That will fix the upgrade_130_to_131() step, but will only be effective for people upgrading after 2.3.1 is released.

I also have code for an upgrade_150_to_151() step that I can submit (once you are happy with part 1), which will do a validation check on existing dpinger parameters. That will be good for people upgrading from 2.3 to 2.3.1 - it can fix any remaining dodgy dpinger advanced parameter settings.

#2 Updated by Jim Thompson about 2 years ago

  • Assignee set to Renato Botelho

#3 Updated by Phillip Davis about 2 years ago

  • Status changed from New to Feedback
  • % Done changed from 0 to 100

#4 Updated by Phillip Davis about 2 years ago

Pull request https://github.com/pfsense/pfsense/pull/2872
Adds checks upgrade_150_to_151() that will double-check dpinger parameters and correct when a system currently on 2.3 with dodgy dpinger parameters is upgraded to 2.3.1
This should be the last piece of this puzzle.

#5 Updated by Chris Buechler about 2 years ago

  • Status changed from Feedback to Resolved

all works. Thanks Phil!

Also available in: Atom PDF