<?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);} ?>
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"