10 Replies Latest reply on Dec 6, 2017 10:04 AM by rschroeder

    Report on ports used and unused

    billconti

      I’ve been asked for a report on how many ports we have on our network and how many are used. Without going to each device and running a sh int status command I’m wondering if there are any forms anyone might have for NPM

        • Re: Report on ports used and unused
          cscoengineer

          Not for NPM.  Within NPM you specify which ports are monitored.  For example, on a 24 port access switch, we typically monitor the trunk ports.  That's just 2 ports on the switch.  By the way, you can designate the other ports as plugged/unplugged and get a capacity report that way, but this is not typically done.

           

          For knowing how many ports in the network are active, the User Device Tracker (UDT) module would be a better fit. The UDT module will monitor all ports on switch and keep track of MAC level information and will provide a port capacity report.

           

          I would recommend you install the evaluation version of UDT to see if it gets you the functionality you need.

           

          Thanks

          Amit

          • Re: Report on ports used and unused
            pparsaie

            Do you have NCM? I can see that if you do an SWQL query using NCM.Nodes and NCM.Interfaces you could pull a report by device name with a count on admin status Up/down/total per device.

              • Re: Report on ports used and unused
                rschroeder

                How does that scale to 1000 switches?   Or can you query all at once and see the output in one report?

                  • Re: Report on ports used and unused
                    pparsaie

                    This is something I pulled together real quick using SWQL to display "Device Name, Device IP, then "interface" by Admin Up/Down and Oper Status Up/Down along with Total available. I added a where statement to only return "physical interfaces" because I believe that's what the original intent was of the question on this string. So a device like a Cisco Catalyst 3560 w/ 48 ports would show as 52 interfaces (48 ports + 4 SFP). For scaling the way it's written right now it will return every device in NCM.Nodes. In some enviornments that could mean more than network devices.

                     

                    rschroeder this returned 1523 rows for me so scale wise it shouldn't be an issue. As long as all the devices you're looking for information on are managed/in NCM. To clarify this is NCM not NPM and it will return all ports/interfaces on the device even those not discovered by NPM/NCM. In my environment we only discover trunk ports and/or "important" ports so using NPM wouldn't return the same results as it would only be able to return discovered ports/interfaces.

                     

                    SELECT
                      NodeCaption AS [Device Name],
                      AgentIP AS [Device IP],
                           COUNT(
                                CASE WHEN n.Interfaces.AdminStatus = 'Up' 
                                THEN 1 ELSE NULL END
                                ) 
                                     AS [Admin Up],
                           COUNT(
                                CASE WHEN n.Interfaces.OperStatus = 'UP' 
                                THEN 1 ELSE NULL END
                                ) 
                                     AS [Oper Up],
                           COUNT(
                                CASE WHEN n.Interfaces.AdminStatus = 'Down' 
                                THEN 1 ELSE NULL END
                                ) 
                                     AS [Admin Down],
                           COUNT(
                                CASE WHEN n.Interfaces.OperStatus = 'Down' 
                                THEN 1 ELSE NULL END
                                ) 
                                     AS [Oper Down],
                           COUNT(
                                n.Interfaces.AdminStatus
                                ) 
                                     AS [Total] 
                    FROM 
                      NCM.Nodes n
                    WHERE
                      n.Interfaces.PhysicalInterface = 'Y'
                    GROUP BY
                      NodeCaption, AgentIP
                    ORDER BY
                      NodeCaption
                    

                     

                • Re: Report on ports used and unused
                  rschroeder

                  I use this method to discover ports that have not been used recently, and then I decide which can be unpatched and repurposed:

                   

                  How to create a report displaying the Last Time Data was Transmitted or Received on a Switch Port