cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
885
Views
0
Helpful
1
Replies

Shutting all non-trunk switch ports inactive > 14 days

Westy_87
Level 1
Level 1

Hi There.

 

We have decided to shut all non-trunk switch ports that have been inactive for over 14 days. Our environment includes roughly 250 switches (well more, but only see 250 as a lot are stacked) ranging from 2960/g/s/x/cx's, 3750's, 9200/9300's and some nexus switches. Using my NMS I can see I have roughly 2200 interfaces that will need to be shut down. Obviously far too many to do manually.

 

I have been looking at the tm_suspend_ports.tcl event manager process and modifying it to not include trunk ports. One question I have with this though, does this only work when event manager sees the interface go down? I.e. will it work for ports that were already down before the script was implemented?

 

If it has to see the interface go down, then I will need to somehow do an initial shut of all ports that meet the requirements. I was leaning towards ansible for this (we already have it setup in our environment). I used NeDi (our NMS) to run a query for the ports that need to be shut and I can export this as csv. I was thinking of trying to parse these to ansible and running an ansible script to shut those interfaces. I haven't done much programming since I quit my computer science degree 15 years ago though, so not sure how I'd go with that.

 

Alternatively, we have an SNMP Write community that could potentially be utilised? Again though, the programming to ensure it only shuts the correct port may be the hard part.

 

Any tips on best path to take?

1 Reply 1

balaji.bandi
Hall of Fame
Hall of Fame

before you shutdown any ports, i would do some ground work to collect the data from exting switches, how are the trends.

 

you can view information show interface gi x/x when was the last time data input (example)  - based on this, you do out of the box script to shutdown the port.

 

Last input 24w1d, output 24w1d, output hang never

BB

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

How to Ask The Cisco Community for Help

Review Cisco Networking for a $25 gift card