Is it possible to read out the time a switch port has been in down state on Cisco switches e.g. 2960x.
Br
Frank
Network Engineering Stack Exchange is a question and answer site for network engineers. It only takes a minute to sign up.
Sign up to join this communityIs it possible to read out the time a switch port has been in down state on Cisco switches e.g. 2960x.
Br
Frank
You can query the switch via SNMP to read the ifLastChange field from the standard MIB-2, which gives you the value of the sysUpTime counter when the interface last changed state. You have to read the current sysUpTime value as well to make sense of it, of course, and I recall there are some caveats if that last change is too far in the past because the field is a 32 bit counter counting hundreth-of-a-second ticks.
I don't believe you can do the same directly from CLI, but you can implement object tracking on the interface state to get the same result.
From the CLI, the last input or output lines could be a rough indicator. Keep in mind, a quiet interface could be off by a lot.
If you are using other management engines, syslog will show interface state changes. SNMP traps/informs can also be setup to signal state changes.
Found this hanging without closure. Sorry.
Found the (for me at this point) best solution (though not perfect).
sh int | incl proto.*is down|Last in.*[5-9]w|Last in.*[1-9][0-9]w|Last in.*[1-9]y|Last in.*[1-9][0-9]y|output never
This shows me ports that hasn't been active for more than 5 weeks.
Thanks for all inputs.
Br
Frank