diff --git a/Netdisco/Changes b/Netdisco/Changes index 8d114239..2393576b 100644 --- a/Netdisco/Changes +++ b/Netdisco/Changes @@ -15,6 +15,8 @@ * Fix for node search on some formats of IPv6 addr being seen as MAC * [#190] Ignore entries in the discover form that don't look like IP/hostname * Delete all job queue entries (regardless of status) when deleting device + * [#15] Undiscovered Neighbor report JOIN fixed, and updated to include + the ports where Macsuck saw the MAC address of a known Device 2.029014 - 2014-11-19 diff --git a/Netdisco/lib/App/Netdisco/DB/Result/Virtual/UndiscoveredNeighbors.pm b/Netdisco/lib/App/Netdisco/DB/Result/Virtual/UndiscoveredNeighbors.pm index 94d14c18..427e716d 100644 --- a/Netdisco/lib/App/Netdisco/DB/Result/Virtual/UndiscoveredNeighbors.pm +++ b/Netdisco/lib/App/Netdisco/DB/Result/Virtual/UndiscoveredNeighbors.pm @@ -22,14 +22,17 @@ __PACKAGE__->result_source_instance->view_definition(<<'ENDSQL'); a.log, a.finished FROM device_port p - JOIN device d ON d.ip = p.ip - JOIN ADMIN a ON p.remote_ip = a.device - WHERE p.remote_ip NOT IN - (SELECT ALIAS - FROM device_ip) - AND a.action = 'discover' - ORDER BY p.remote_ip, - a.finished DESC + JOIN device d + ON d.ip = p.ip + LEFT JOIN admin a + ON (p.remote_ip = a.device AND a.action = 'discover') + WHERE + (p.remote_ip NOT IN (SELECT alias FROM device_ip)) + OR + ((p.remote_ip IS NULL) AND p.is_uplink) + ORDER BY + p.remote_ip ASC, + a.finished DESC ENDSQL __PACKAGE__->add_columns( diff --git a/Netdisco/share/views/ajax/admintask/undiscoveredneighbors.tt b/Netdisco/share/views/ajax/admintask/undiscoveredneighbors.tt index 204b04f8..5bcfb7af 100644 --- a/Netdisco/share/views/ajax/admintask/undiscoveredneighbors.tt +++ b/Netdisco/share/views/ajax/admintask/undiscoveredneighbors.tt @@ -1,7 +1,7 @@
| Device Location Triggering Last Discovery Attempt |
+ Observing Device | Undiscovered Neighbor | Last Discovery Attempt | Last Discovery Log | @@ -12,11 +12,18 @@
|---|---|---|---|---|
| [% row.dns || row.name || row.ip | html_entity %] ( [% row.port | html_entity %] ) | -- [% row.remote_ip | html_entity %] - ([% row.remote_port | html_entity %]) - [% ' id: '_ row.remote_id IF row.remote_id %] - [% ' type: '_ row.remote_type IF row.remote_type %] | +
+ [% IF row.remote_ip %]
+
+ [% row.remote_ip | html_entity %]
+ ([% row.remote_port | html_entity %])
+ [% ' ' IF row.remote_id or row.remote_type %] + [% ' id: '_ row.remote_id IF row.remote_id %] + [% ' type: '_ row.remote_type IF row.remote_type %] + [% ELSE %] + Known Device's MAC Address seen on this Port during Macsuck + [% END %] + |
[% row.finished | html_entity %] | [% row.log | html_entity %] |