3 Replies Latest reply on Mar 25, 2019 2:12 PM by rschroeder

    Want to see your cisco CDP?


        • Re: Want to see your cisco CDP?

          It's a fun project to build and run a CDP Neighbor report and get the output into Excel format.  I just ran one earlier this week for a Manager, to show how many CDP relationships there are.  The number was 3744, and it was a user-friendly and tightly efficient page that showed every device and its relationships to all other CDP neighbors.


          Write me if you're interested in the Python scripting to generate the full network's list of all CDP neighbors/interfaces/relationships and I'll post it.




          Add CDP Neighbor as a Widget into all your NPM Node Views:


          Just add this Custom SWQL into a resource added onto your NPM page:

          First:  Edit a Node's NPM page.

          Next:  Add a new "Custom Query" Widget in the NPM page's view wherever you want.  Right column, left column, higher up or lower down.

          Finally:  Edit the Custom Query:  Name it "CDP Neighbors".   Paste the script below into the Query.  Submit it.


          SELECT I.InterfaceName AS [Local Interface], CDP.IPAddress AS [IP Address], DeviceId AS Device, DevicePort AS [Remote Interface], (SELECT N2.DetailsURL from Orion.Nodes N2 JOIN Orion.NodeIPAddresses NIP ON (N2.NodeID = NIP.NodeID) WHERE NIP.IPAddress = CDP.IPAddress) AS [_LinkFor_Device]

          FROM Orion.NodeCdpEntry CDP

          JOIN Orion.Nodes N ON (N.NodeID = CDP.NodeID)

          LEFT OUTER JOIN Orion.NPM.Interfaces I ON ((CDP.NodeID = I.NodeID) AND (CDP.IfIndex = I.Index))

          WHERE (CDP.NodeID = ${NodeID}) AND (N.IPAddress <> CDP.IPAddress)


          The process above works at 12.4 and later.



          The process below worked pre-12.4.


          The output looks like this (on a Distribution switch with several hundred CDP neighbors):




          A single, smaller Access Switch, with only fifteen AP's on it, and a couple of uplinks or downlinks, is a simpler view:





          Rick Schroeder

          • Re: Want to see your cisco CDP?

            Here's a fun script for getting this information: