I would like to find a SWQL query for the Node Details view that will show the switch and port that a node is connected to. Does anyone have such a thing?
Hi patriot,
I have 2 options for you, but these are made with some assumptions of your environment.
If these assumptions are correct, then you can use this SWQL query in a classic widget to show CDP neighbors.
SELECT n.CiscoCdp.Interfaces.InterfaceName as [Local Interface] ,n.CiscoCdp.Interfaces.InterfaceAlias as [Local Interface Name] ,n.CiscoCdp.RemoteDevice as [Remote EndPoint] ,n.CiscoCdp.RemotePort as [Remote Port] ,n.CiscoCdp.RemoteIPAddress as [Remote IP] ,TOSTRING(TOLOCAL(n.CiscoCdp.LastDiscovery)) as [Discovery by SolarWinds] FROM NCM.Nodes n where n.CoreNodeID =${nodeid} WITH NOLOCK
This is what my widget looks like on my classic Node Details page.
To cover all of my bases, I added a LLDP neighbor directly under CDP widget. There's the SWQL query for the LLDP widget.
SELECT n.DisplayName as [Local Name] ,n.MachineType as [Local Machine Type] ,n.Interfaces.IfName as [Local Interface] ,n.Interfaces.Alias as [Local Interface Name] ,l.RemoteIpAddress as [Remote IP] ,l.RemotePortDescription as [Remote Interface] ,l.RemoteSystemName as [Remote LLDP Name] From Orion.Nodes n join Orion.NodeLldpEntry l on n.NodeID = l.NodeID WHERE 1=1 AND n.NodeID=${nodeid} and n.Interfaces.Index = l.LocalPortNumber
Hopefully one of these will work for you.