Closed gallak closed 1 year ago
Hi @gallak
You can select type ethernetCsmacd
from Netdisco database but it won't get all physical ports on all devices because some devices return empty type or other value for physical ports. In Netdisco we take the reverse approach to filter out things which are not physical then we are left with the best list.
In SQL this looks like: https://github.com/netdisco/netdisco/blob/master/lib/App/Netdisco/DB/Result/Virtual/DevicePortSpeed.pm#L17-L20
WHERE port !~* 'vlan'
AND (descr IS NULL OR descr !~* 'vlan')
AND (type IS NULL OR type !~* '^(53|ieee8023adLag|propVirtual|l2vlan|l3ipvlan|135|136|137)\$')
AND (is_master = 'false' OR slave_of IS NOT NULL)
which in pseudocode means:
ports where the name does not contain text "vlan"
and the port description is empty or does not contain text "vlan"
and the port type is empty or not any of these: (53|ieee8023adLag|propVirtual|l2vlan|l3ipvlan|135|136|137)
and the port is not link aggregate master or is a member of an aggregate set
I hope this helps!
Thanks Oliver, i'll make m'y code more flexible thanks to the regexp. New release soon,I need to rewrite some other part (I take care about the "card" level)
device filtering is now an option inside fusion (regexp on device type)
All fetched port aren't physical port, we need to filter only port with type ethernetCsmacd