mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Cleaning in function poll_device(#10015)
This commit is contained in:
committed by
PipoCanaja
parent
f30d5afa35
commit
311d24c3b3
@@ -243,12 +243,16 @@ function poll_device($device, $force_module = false)
|
||||
unset($array);
|
||||
|
||||
// Start counting device poll time
|
||||
echo 'Hostname: ' . $device['hostname'] . PHP_EOL;
|
||||
echo 'Device ID: ' . $device['device_id'] . PHP_EOL;
|
||||
echo 'OS: ' . $device['os'];
|
||||
echo 'Hostname: ' . $device['hostname'] . PHP_EOL;
|
||||
echo 'Device ID: ' . $device['device_id'] . PHP_EOL;
|
||||
echo 'OS: ' . $device['os'] . PHP_EOL;
|
||||
$ip = dnslookup($device);
|
||||
|
||||
$db_ip = isset($ip) ? inet_pton($ip) : null;
|
||||
$db_ip = null;
|
||||
if (!empty($ip)) {
|
||||
echo 'Resolved IP: '.$ip.PHP_EOL;
|
||||
$db_ip = inet_pton($ip);
|
||||
}
|
||||
|
||||
if (!empty($db_ip) && inet6_ntop($db_ip) != inet6_ntop($device['ip'])) {
|
||||
log_event('Device IP changed to ' . $ip, $device, 'system', 3);
|
||||
|
Reference in New Issue
Block a user