#48 Node Monitor supports matching on OUI

This commit is contained in:
Oliver Gorwits
2018-03-10 09:26:00 +00:00
parent acd4ea79e0
commit dd44877059
10 changed files with 37 additions and 12 deletions

View File

@@ -12,6 +12,8 @@ __PACKAGE__->table("node_monitor");
__PACKAGE__->add_columns(
"mac",
{ data_type => "macaddr", is_nullable => 0 },
"matchoui",
{ data_type => "boolean", is_nullable => 1 },
"active",
{ data_type => "boolean", is_nullable => 1 },
"why",

View File

@@ -16,7 +16,7 @@ SELECT nm.why, nm.cc, trim(trailing '.' from trim(trailing '0123456789' from dat
d.name, d.location,
dp.name AS portname
FROM node_monitor nm, node n, device d, device_port dp
WHERE nm.mac = n.mac
WHERE ((nm.mac = n.mac) OR (nm.matchoui AND (substring(nm.mac::text from 1 for 8) = n.oui)))
AND nm.active
AND nm.cc IS NOT NULL
AND d.ip = n.switch