Like many others I can see how to display ports that have no traffic flowing through them and go through and disable them but we have hundreds of cisco switches.

I like the idea of being able to see ports that have not seen activity in the last 6 weeks like I found here:

show int | i proto.*notconnect|proto.administratively down|Last in. [6-9]w|Last in.* [0-9][0-9]w|[0-9]y|disabled|Last input never, output never, output hang never

but I have not been able to make this work.

sh int count | i 0 + 0 + 0 works quiet well for identifying the ports.

Found here:

How can I see which switchports are not in use?

Is there a way to maybe use like port security or anything to turn ports off that have not see traffic for 90 days?

  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer.
    – Ron Maupin
    Aug 15, 2017 at 1:06

1 Answer 1


15.1T introduced show interface history. This might work for you.

The ports go into down state for both status and protocol by default when no endpoint NIC is connected (link down). You could syslog these events to a server and roll some script to correlate down vs up dates per port.

Cisco EEM could be utilized to automatically disable a port once it goes down, but I don't think this would be a good idea as it would be difficult to administer/manage. Look at 802.1X Port-Based Authentication if security is the concern.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.