cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8428
Views
0
Helpful
5
Replies

Finding Unused Switchports

crt1990
Level 1
Level 1

Hello,

 

   I have a Cisco C2960X and I'm trying to figure out which ports have no devices connected to them so that I can free up space for other devices. When this switch was installed, the installer connected every port on the patch panel to a port on the switch, so I can't tell which ports actually have a device on the other end of the patch panel or are just empty and should be disconnected. It would take way too long to trace every wire on the patch panel to check if anything's connected on the other end. My initial strategy was just to run the 'show int counter' command to find ports that have no packets entering or exiting them and remove them from the switch. The problem is as I began removing the cables from these ports, I started getting calls from users saying they couldn't access the network. I have two questions: why would the command show that there are no packets entering or exiting these ports when in fact there are and second, is there a better approach that I could take to do this? I appreciate the help!  

1 Accepted Solution

Accepted Solutions

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

Just use the interface stats. We talked about some good show+regex combos in this post:

 

https://community.cisco.com/t5/switching/find-unused-ports-script/m-p/4011271

 

...obviously if the switch is periodically rebooted using this method isn't such a great idea as the interface stats are not truly representative.

 

cheers,

Seb.

View solution in original post

5 Replies 5

cmarva
Level 4
Level 4

you can secure shell into the switch, and issue the command "sho interface counters"

 

anything with 0 input packets would be a candidate to disconnect. The only caveat is switch uptime. If it has a relatively short uptime, then you'd want to wait a week or so. But if the switch uptime is 3 months and you have ports with 0 input packets, then it should be safe to disconnect and reuse.

Seb Rupik
VIP Alumni
VIP Alumni

Hi there,

Just use the interface stats. We talked about some good show+regex combos in this post:

 

https://community.cisco.com/t5/switching/find-unused-ports-script/m-p/4011271

 

...obviously if the switch is periodically rebooted using this method isn't such a great idea as the interface stats are not truly representative.

 

cheers,

Seb.

yes, you can only generate unused ports if the switch at least up for 30days, otherwise some of the statistics may go wrong.

 

I do out of the box with Perl script on Linux and post them to web page another team to download the report.

 

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

   Thank you for that! It seems to be just what I'm looking for. My last reboot was on Jan 17 (12 days ago) so I guess I'll wait before running the script and using that data. I'm just kind of perplexed because if the port isn't being used at all, why would I need to wait 2+ weeks to run this command? It seems to me that I would only need to wait maybe a week max for the statistics to be accurate if the ports are truly not being used.

You can adjust the regex to fit whatever threshold you require. But the higher the threshold (ie the longer the switchport has had no input) the more sure you can be that it is not used as opposed to someone taking a two week holiday.