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

Martin T m4rtntns at gmail.com
Fri Apr 7 06:07:44 EDT 2017


I'm amazed how inconsistent and buggy the implementation of
"snmpEngineTime" and "snmpEngineBoots" are. I simply wanted to write a
test which checks if "sysUpTime" has wrapped. I wanted to compare it
with "snmpEngineTime", but this does not work because in some
occasions "snmpEngineTime" wraps with "sysUpTime"(CSCeh49492). I could
live with this if only "snmpEngineTime" wrap causes "snmpEngineBoots"
to increment, but it is not the case. In addition, on some IOS
versions "snmpEngineTime" wrap does not cause "snmpEngineBoots" to
increment. Last but not least, some older IOS versions even don't
return "snmpEngineTime" and "snmpEngineBoots" values over SNMP. For
example 12.0(28d).

In short, I see no reliable way to find device uptime over SNMP if
script needs to work with older IOS versions.

On Thu, Apr 6, 2017 at 10:23 PM, Adam Atkinson <ghira at mistral.co.uk> wrote:
> On 06/04/17 17:01, Martin T wrote:
>>
>> 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:
>
>
> It wraps at about 497 days.
>
> 4*497+280 = 2268 days
>
> 6 years 11 weeks and 0.78 of a day
>
> close enough to the uptime you mention. Probably if I used an exact value
> instead of 497 I'd be closer
>
>
> _______________________________________________
> cisco-nsp mailing list  cisco-nsp at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-nsp
> archive at http://puck.nether.net/pipermail/cisco-nsp/


More information about the cisco-nsp mailing list