On Fri, Feb 10, 2012 at 3:53 PM, Doug Manley <[email protected]> wrote:

> After weeks of testing, we concluded this:
> 1. It had something to do with net-snmp; the memory was not getting
> clobbered by anything else.
> 2. It had something to do with the fact that we would send out a
> msgAuthoritativeEngineTime with values like "43,033,091" from time to
> time (plus or minus a million, say).
>

That's interesting feedback, and it's unfortunate that this wasn't reported
before. As far as I can see at least on Linux clock_t is a synonym for long
while the current SNMPv3 implementation assumes that it has the size of an
int (see also the use of UINT_MAX in snmpv3_local_snmpEngineTime(). I'm
afraid that might cause trouble on systems where sizeof(int) !=
sizeof(long).

In any case, I patched my net-snmp to always leave SNMP_USE_TIMES
> undefined, and I am 99% certain that my change will fix the crazy
> issues that I've been seeing.  I'd be interested to see how this patch
> performs in my situation.
>

The proposed patch modifies the SNMPv3 code such that uptime is computed as
follows:

    netsnmp_get_monotonic_clock(&now);
    return calculate_sectime_diff(&now, &snmpv3starttime);

The calculate_sectime_diff() function computes the time difference in
seconds as an u_int, which will be a 32-bit or 64-bit number depending on
the number of bits the compiler stores in an int. This behavior should be
the same as the existing behavior - at least on systems where
sizeof(clock_t) == sizeof(int). However, I found this in RFC 3414 (
http://tools.ietf.org/html/rfc3414):

   When an SNMP engine is first installed, it sets its local values of
   snmpEngineBoots and snmpEngineTime to zero.  If snmpEngineTime ever
   reaches its maximum value (2147483647), then snmpEngineBoots is
   incremented as if the SNMP engine has re-booted and snmpEngineTime is
   reset to zero and starts incrementing again.

I'll see what needs to be changed in the patch to make it compliant with
RFC 3414.

Bart.
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to