How long has port not been used

Unanswered Question
Aug 21st, 2007
User Badges:

We have numerous Cisco switches and we want to find out which ports in these haven?t been used for say 2 weeks.

Does anyone know of a way to get this information?


  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Edison Ortiz Tue, 08/21/2007 - 18:02
User Badges:
  • Super Bronze, 10000 points or more
  • Hall of Fame,

    Founding Member

The best I can suggest is clearing all counters today and come back in two weeks. If no activity has been reported in the ports, then you can assume they've been inactive for that long.

You can also check when was the last time the counters were cleared by typing 'show interface' and go from there. For instance, if the last time the counters were cleared was a month ago and the port shows 0 input/output packets, that port can be 'admin shutdown' if that's what you are after.

dave.keith Wed, 08/22/2007 - 13:23
User Badges:
  • Bronze, 100 points or more

It is quite straightforwand using SNMP. First, check the sysuptime. Then check the ifOperStatus to see what ports are down. Then check the ifLastChange to see what the uptime was when these ports went down. Of course the time that the ports have been down is the difference between the sysUpTime and the ifLastChange.


David Stanford Thu, 08/23/2007 - 06:53
User Badges:
  • Cisco Employee,

Just keep in mind when doing this that sysUpTime can wrap at 497 days. So keep this in mind when doing any calculations for ifLastChange.

hobbe Thu, 08/23/2007 - 09:36
User Badges:
  • Gold, 750 points or more

If you have snmp you can watch the iflastchange wich will tell you what you want.

If not then try the show logging command

If you are in luck you will find some up and downs there.

show controllers will give you any ports that have never been used.

Same with show interfaces it will also give you non used interfaces.

then you can reset counters and check what you get there.

good luck


This Discussion