mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Configurable device display name (#13528)
* Configurable device display name You can just set the display name in device settings. It also accepts simple template format with the variables: hostname, sysName, sysName_fallback, ip Default controlled by device_display_default, (set from old force_hostname_to_sysname and force_ip_to_sysname settings * remove second argument to format_hostname() * Style fixes * Update schema * update phpstan baseline * Improved settings strings (and add for translation)
This commit is contained in:
@@ -446,6 +446,18 @@ class Config
|
||||
self::deprecatedVariable('poller_modules.cisco-sla', 'poller_modules.slas');
|
||||
self::deprecatedVariable('oxidized.group', 'oxidized.maps.group');
|
||||
|
||||
// migrate device display
|
||||
if (! self::has('device_display_default')) {
|
||||
$display_value = '{{ $hostname }}';
|
||||
if (self::get('force_hostname_to_sysname')) {
|
||||
$display_value = '{{ $sysName }}';
|
||||
} elseif (self::get('force_ip_to_sysname')) {
|
||||
$display_value = '{{ $sysName_fallback }}';
|
||||
}
|
||||
|
||||
self::persist('device_display_default', $display_value);
|
||||
}
|
||||
|
||||
$persist = Eloquent::isConnected();
|
||||
// make sure we have full path to binaries in case PATH isn't set
|
||||
foreach (['fping', 'fping6', 'snmpgetnext', 'rrdtool', 'traceroute', 'traceroute6'] as $bin) {
|
||||
|
Reference in New Issue
Block a user