From 98d0f5bc1beb67e2d57491c3c3d63182c8e0e0a2 Mon Sep 17 00:00:00 2001 From: Dag Bakke Date: Fri, 15 May 2020 05:25:41 +0200 Subject: [PATCH] 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 --- includes/discovery/functions.inc.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/includes/discovery/functions.inc.php b/includes/discovery/functions.inc.php index b51df0a6ce..45aaa42799 100644 --- a/includes/discovery/functions.inc.php +++ b/includes/discovery/functions.inc.php @@ -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"; } }