Hey folks,
Hoping y'all can help me out a bit here - I'm a bit of a novice when it comes to databases, and I'm hitting some snags with a business request that's come in. We're looking to create a report that outputs sums of interfaces in a given VLAN, per node, grouped by their container. I can get somewhere with SWQL to at least output all the interfaces we're interested in, but it appears that I might need subqueries in order to accomplish this, and I'm a bit out of my depth.
I can at least output the interfaces we care about in SWQL with the below query:
SELECT TOP 1000 c.Container.Name, n.NodeID, n.Caption, m.Interface.Caption, m.VlanID
FROM Orion.NodePortInterfaceMap AS m
LEFT JOIN Orion.nodes AS n ON m.NodeID = n.NodeID
LEFT JOIN Orion.ContainerMembers AS c ON m.NodeID=c.MemberPrimaryID
WHERE m.Interface.InterfaceType != 53 AND m.Interface.AdminStatus = 1
GROUP BY c.Container.Name
This does seem to spit out the list of interfaces per node with their corresponding VLAN ID, I'm just missing the piece to actually add 'em up with COUNT and group them correctly. Grateful for any and all advice!