Improvement for matching LLDP neighbors with known hosts. (#11445)

* Minor addition to find_device_id, such that we match LLDP hosts presenting with FQDN with devices where $hostname + $config['mydomain'] is a match.
This yields clickable links in the neighbor overview.

* Modified to comply with comments in code review
This commit is contained in:
Dag Bakke
2020-05-15 05:25:41 +02:00
committed by GitHub
parent 1366bdebaf
commit 98d0f5bc1b

View File

@@ -1369,6 +1369,10 @@ function find_device_id($name = '', $ip = '', $mac_address = '')
if ($mydomain = Config::get('mydomain')) {
$where[] = '`hostname`=?';
$params[] = "$name.$mydomain";
$where[] = 'concat(`hostname`, \'.\', ?) =?';
$params[] = "$mydomain";
$params[] = "$name";
}
}