[SOLVED] Switch apinger to dpinger possible?

Started by ittchmh, January 26, 2016, 06:32:15 PM

Previous topic - Next topic
January 26, 2016, 06:32:15 PM Last Edit: January 28, 2016, 06:28:55 PM by ittchmh
I have same issue in OPNSense like in pfSense
Issue and potiential fix for apinger monitoring of IPv6 GIF interfaces



After apinger restart all ok



Currently I have other issues in pfSense with apinger, I fixed it like this
pfsense 2.1-release - Gateway aPinger broken?

<?phprequire_once("/etc/inc/service-utils.inc");require_once("/etc/inc/globals.inc");require_once("/etc/inc/gwlb.inc");$log_file = "/var/log/apinger.log";$log_date = date('d/m/Y H:i:s', time());$counter = 0;$a_gateways = return_gateways_array();$gateways_status = array();$gateways_status = return_gateways_status(true);foreach ($a_gateways as $gname => $gateway) {	if ($gateways_status[$gname]) {		$str_data = $gateways_status[$gname]['delay'];		$pos = substr($str_data,0,strpos($str_data, "ms"));		if (floatval($pos) > 500 ) {			$counter++;					}		}	}if ($counter > 0) {		service_control_restart(apinger,restartservice);	$log_data = 'Counter = '.$counter. ' date: '.$log_date. ' | service restarted!'. PHP_EOL;	file_put_contents($log_file, $log_data, FILE_APPEND);} ?>




OPNSense running as guest on Hyper-V host

We're watching the dpinger efforts (and have helped in the beginning with the FreeBSD porting), but we have no immediate plans.

Does calling /status_services.php?mode=restartservice&service=apinger not suffice in your scenario, or is this a cron job?

Hyper-V is quite fragile when it comes to clocks and NTP, the suggestion from the pfSense forum sounds interesting... have you ever tried to "disarm" NTP by providing an invalid server?

System: Settings: General: NTP server: "no"

This is cron job

If at least one gw has ping > 500 service restarted

After yestarday I think that all the problems linked to time issues

Quote from: franco on January 27, 2016, 10:24:30 AM
Hyper-V is quite fragile when it comes to clocks and NTP, the suggestion from the pfSense forum sounds interesting... have you ever tried to "disarm" NTP by providing an invalid server?

System: Settings: General: NTP server: "no"
I will try this.

Rising Probe Interval to 10 sec of GW also helped

on pfSense same Probe Interval but I have many issues with apinger on different Hyper-V hosts

I will try to rise Probe Interval there...

sorry for my English

No need to be sorry, looking forward to your feedback :)

Hi!

Problem with apinger only on VMs!
To eliminate this issue only one time provider must be enabled!
On Hyper-V VM


Or ntpd inside VM Guest

If Hyper-V host time wrong even few seconds, guest VM updating time from NTP server, after that VM Integration service adjusting guest VM clock immediately to Hyper-V time value.


And this breaking apinger

I've started some cleanups over at:

https://github.com/opnsense/apinger

What I can see is that gettimeofday() is used for measurements. We need to switch to a monotonic time source in order to fix that. 8)

This was fixed a few days ago in our apinger repository:

https://github.com/opnsense/apinger/commit/9a330e42b79f9bf4fcb6b3b34560194e87206575

Been running this for a few days without an issue, we may as well push this with 16.1.13 next week. :)