[#15] Undiscovered Neighbor report JOIN fixed, and updated to include

the ports where Macsuck saw the MAC address of a known Device
This commit is contained in:
Oliver Gorwits
2015-01-01 18:38:39 +00:00
parent af24ecf57d
commit af16e1f4f9
4 changed files with 27 additions and 15 deletions

View File

@@ -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(