I've noticed that the timetick value for system uptime (OID 184.108.40.206.220.127.116.11.0) is a 32-bit value so once the system has been up for 1 year, 132 days, 2 hours, 27 minutes and 52.96 seconds the value will roll to 0 again. This is a problem because if I want to calculate the time an interface has been in its current state (which is stored in another OID 18.104.22.168.22.214.171.124.1.9 as the current sysUptime when the interface entered its current ifOperStatus) then the number becomes negative when the sysUpTime value rolls to 0. For example, suppose a switch port ifOperStatus goes to 'up' 45 seconds after the switch initializes. The ifLastChange value would be somewhere around 4500. 45 seconds later, the timetick value in 126.96.36.199.188.8.131.52.0 (sysUptime) would be 9000 and if I subtracted 4500 from 9000 I'd get 4500 which would represent the fact that the port has been 'up' for 45 seconds. If the switch remains up for a really long time (longer than 1 year, 132 days....) and that sysUptime value rolls to zero then 0 - 4500 becomes -4500 when I try to calculate sysUptime - ifLastChange. HOWEVER, I've noticed that the "show version" command will report the accurate system uptime regardless of the number of seconds the switch has been up. So my question is this: is there another OID I can look at that will tell me how many times the sysUptime value has rolled back to 0? The switch must be aware of it somehow because the uptime reported by 'show version' does report the correct time. Or, is there a different OID that tracks system uptime that's greater than a 32-bit value?
Yes, you have the snmpEngineTime / .184.108.40.206.220.127.116.11.1.3 option on IOS 12.0(3)T or later, as explained in this post: