[c-nsp] "snmpEngineTime" seems to wrap with "sysUpTime" in old IOS release

Martin T m4rtntns at gmail.com
Thu Apr 6 12:01:34 EDT 2017


Hi,

if someone is interested in debugging a SNMP agent related issue on
more than a decade old switch, then I have a WS-C2924-XL with IOS
12.0(5)WC14 with an uptime of more than 6 years, but with
"snmpEngineTime" of 280 days. In fact, both "sysUpTime"(unit is
centiseconds) and "snmpEngineTime"(unit is seconds) share the same
value:

$ for oid in sysUpTime snmpEngineTime; do snmpget -Ov -v 2c -c public
switch "$oid".0; done
Timeticks: (2427033709) 280 days, 21:45:37.09
INTEGER: 24270337 seconds
$

My first thought was that maybe the SNMP agent has (re-)initialized
itself, but this does not seem to be true, because "snmpEngineBoots"
counter is 1. Last SNMP related change in this switch was 932 days
ago, but for testing purposes, I disabled SNMP agent(no snmp-server)
and the re-enabled it, but this did not have any effect on "sysUpTime"
and "snmpEngineTime" values.

How to explain this behavior? Is it likely some kind of SNMP agent
crash 280 days ago which caused both "sysUpTime" and "snmpEngineTime"
counters to start from zero? Or is it simply a buggy "snmpEngineTime"
implementation which wraps with the "sysUpTime" because to be more
precise, then according to "sh ver" switch has been up for 6 years, 11
weeks, 2 days and 8 hours which is roughly 196243200 seconds so it
could have wrapped four times and now the counter is ~24444512 seconds
which is roughly 280 days:

$ wrap_s=$(( 2**32 ))
$ echo $(( 196243200 / ${wrap_s:0:-2} ))
4
$ echo $(( 196243200 % ${wrap_s:0:-2} ))
24444512
$


thanks,
Martin


More information about the cisco-nsp mailing list