Database->query('SELECT `NetworkInterface`.`Id`, '. '`NetworkInterface`.`LocalIP` '. 'FROM `NetworkInterface` '. 'WHERE (`NetworkInterface`.`Enabled`=1) AND (`NetworkInterface`.`LocalIP` !="")'); while ($DbRow = $DbResult->fetch_assoc()) { $Hosts[] = $DbRow['LocalIP']; $HostInterface[$DbRow['LocalIP']] = $DbRow['Id']; } exec('fping -e -r '.$RetryLimit.' -t '.$Timeout.' -a '.implode(' ', $Hosts).' 2>/dev/null', $Output); $Queries = array(); foreach ($Output as $Index => $Line) { $IP = substr($Line, 0, strPos($Line, ' ')); $Line = substr($Line, strpos($Line, '(') + 1); $Value = substr($Line, 0, strpos($Line, ' ')); $Queries[] = $this->Database->GetInsert('NetworkInterfaceLatency', array('Interface' => $HostInterface[$IP], 'Value' => $Value, 'Time' => TimeToMysqlDateTime($Time))); } $this->Database->Transaction($Queries); } function Run(): void { RepeatFunction(10 * 60, array($this, 'PingHosts')); } }