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
@@ -284,6 +284,10 @@ Enable or disable the sysDescr output for a device.
|
||||
$config['force_ip_to_sysname'] = false;
|
||||
```
|
||||
When using IP addresses as a hostname you can instead represent the devices on the WebUI by its SNMP sysName resulting in an easier to read overview of your network. This would apply on networks where you don't have DNS records for most of your devices.
|
||||
```php
|
||||
$config['force_hostname_to_sysname'] = false;
|
||||
```
|
||||
When using a dynamic DNS hostname or one that does not resolve, this option would allow you to make use of the SNMP sysName instead as the preferred reference to the device.
|
||||
|
||||
```php
|
||||
$config['device_traffic_iftype'][] = '/loopback/';
|
||||
|
@@ -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
|
||||
|
||||
|
@@ -845,7 +845,8 @@ $config['dateformat']['mysql']['time'] = '%H:%i:%s';
|
||||
|
||||
$config['enable_clear_discovery'] = 1;
|
||||
// Set this to 0 if you want to disable the web option to rediscover devices
|
||||
$config['force_ip_to_sysname'] = false;// Set to true if you want to use sysName in place of IPs
|
||||
$config['force_ip_to_sysname'] = false;// Set to true if you want to use sysName in place of IPs
|
||||
$config['force_hostname_to_sysname'] = false;// Set to true if you want to use sysNAme in place of a hostname, ie Dynamic DNS
|
||||
|
||||
// Allow duplicate devices by sysName
|
||||
$config['allow_duplicate_sysName'] = false;// Set to true if you want to allow duplicate sysName's
|
||||
|
Reference in New Issue
Block a user