mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #3341 from wiad/issue-3303
Support hostnames in rancid with or without domain suffix
This commit is contained in:
@@ -327,6 +327,16 @@ if (device_permitted($vars['device']) || $check_device == $vars['device']) {
|
|||||||
if (is_file($configs.$device['hostname'])) {
|
if (is_file($configs.$device['hostname'])) {
|
||||||
$device_config_file = $configs.$device['hostname'];
|
$device_config_file = $configs.$device['hostname'];
|
||||||
}
|
}
|
||||||
|
elseif (is_file($configs.strtok($device['hostname'], '.'))) { // Strip domain
|
||||||
|
$device_config_file = $configs.strtok($device['hostname'], '.');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (!empty($config['mydomain'])) { // Try with domain name if set
|
||||||
|
if (is_file($configs.$device['hostname'].'.'.$config['mydomain'])) {
|
||||||
|
$device_config_file = $configs.$device['hostname'].'.'.$config['mydomain'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} // end if
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($config['oxidized']['enabled'] === true && isset($config['oxidized']['url'])) {
|
if ($config['oxidized']['enabled'] === true && isset($config['oxidized']['url'])) {
|
||||||
|
Reference in New Issue
Block a user