mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Allow the hostname to resolve to the sysName, ie Dynamic DNS (#8810)
This commit is contained in:
committed by
Neil Lathwood
parent
8c610326e3
commit
ab5d17d715
@@ -1203,6 +1203,11 @@ function format_hostname($device, $hostname = '')
|
||||
$hostname = $device['sysName'];
|
||||
}
|
||||
}
|
||||
if ($config['force_hostname_to_sysname'] === true && !empty($device['sysName'])) {
|
||||
if (filter_var($hostname, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) == false && filter_var($hostname, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) == false) {
|
||||
$hostname = $device['sysName'];
|
||||
}
|
||||
}
|
||||
return $hostname;
|
||||
}//end format_hostname
|
||||
|
||||
|
Reference in New Issue
Block a user