How can I generate a report from NPM to show each server connected to which port in switches ?
Have you tried Network Topology Manager? I think that may be what you need.
Without NTM module, I would do something like this (thanks Karlo.Zatylny)
SELECT * FROM NodeCiscoCdpEntries WHERE NodeID = <your node id here where you are expecting the connection>
SELECT * FROM NodeL2Connections WHERE NodeID = <NodeID>
SELECT * FROM NodeLldpEntries WHERE NodeID = <NodeID>
Further reading: https://thwack.solarwinds.com/thread/107279
Perhaps you could add a where clause to this: https://thwack.solarwinds.com/thread/107279
You could do a Custom SWQL report with a query like this:
SELECT sn.DisplayName AS SrcDisplayName, t.SrcInterfaceID, t.DestInterfaceID, dn.DisplayName AS DestDisplayName, t.LayerType
FROM Orion.TopologyConnections t
JOIN Orion.Nodes sn on sn.NodeID = t.SrcNodeID
JOIN Orion.Nodes dn on dn.NodeID = t.DestNodeID
WHERE t.DestType NOT LIKE 'Orion.ShadowNodes' AND t.SrcType NOT LIKE 'Orion.ShadowNodes'
This way you are using the calculated topology data similar to the topology connections resource on your node details page. Probably want to JOIN the interfaces table as well and ORDER BY something useful, but this can get you started.
KZ