0

Is it possible to read out the time a switch port has been in down state on Cisco switches e.g. 2960x.

Br

Frank

  • 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 14 '17 at 1:25
3

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.

| improve this answer | |
0

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.

| improve this answer | |
0

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

| improve this answer | |
  • 1
    If this is your question, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. – Ron Maupin Mar 16 '18 at 21:25
  • So sorry. I can't seem to find how to accept as answer. Feel so stupid. And thanks for the edit. I guess you added the text box for me. Very nice of you. – Frank Mar 20 '18 at 19:52
  • You need to use the user ID with which you created the question. Only the user that created the question can accept the answer. – Ron Maupin Mar 20 '18 at 19:55
  • As I understand it, you can merge users if you ended up with several, which happens because of the various SE sites. – Ron Maupin Mar 20 '18 at 19:56
  • Ahh, good point. I do see the difference in user profiles now. Didn't notice that before. I'll look in to it. Thankz for pointing that out. – Frank Mar 24 '18 at 23:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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