mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 00:24:21 +02:00
Added the lookup of IP if device hostname is a hostname
This commit is contained in:
@@ -138,6 +138,14 @@ function poll_device($device, $options) {
|
||||
$device_start = microtime(true);
|
||||
// Start counting device poll time
|
||||
echo $device['hostname'].' '.$device['device_id'].' '.$device['os'].' ';
|
||||
$ip = dnslookup($device);
|
||||
|
||||
if (!empty($ip) && $ip != inet6_ntop($device['ip'])) {
|
||||
log_event('Device IP changed to '.$ip, $device, 'system');
|
||||
$db_ip = inet_pton($ip);
|
||||
dbUpdate(array('ip' => $db_ip), 'devices', 'device_id=?', array($device['device_id']));
|
||||
}
|
||||
|
||||
if ($config['os'][$device['os']]['group']) {
|
||||
$device['os_group'] = $config['os'][$device['os']]['group'];
|
||||
echo '('.$device['os_group'].')';
|
||||
|
||||
Reference in New Issue
Block a user