[SNMP4J] index value greater than max java 32-bit integer

Mark Ellison ellison at ieee.org
Wed Mar 4 16:43:33 CET 2015


Syed,

The sysUpTime object is defined as a 32 bit quantity and increments once
every one-hundredth of a second.  The snmpEngineTime object, defined in the
SNMP-FRAMEWORK-MIB (rfc 3411), while a 32 bit quantity, increments once per
second.  Thus, rollover would occur somewhat less frequently.

When manipulating 64 bit integers in java, i have had good results using
the BigInteger class (see
http://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html).

Regards,

Mark

On Wed, Mar 4, 2015 at 3:39 AM, Frank Fock <fock at agentpp.com> wrote:

> Hi Syed,
>
> All value up to 2^32-1 are supported. In Java, the values will become
> negative above 2^31, but that has to be handled by your code.
> The string conversion should work as expected and also the OID.compareTo
> will work correctly.
>
> Best regards,
> Frank
>
> Am 04.03.2015 um 02:30 schrieb Ali, Syed F:
>
>  Hi Frank,
>>
>> Would snmp4j support issuing snmp get requests where one of the terms in
>> the OID is larger than a signed 32-bit integer? From looking at the
>> org.snmp4j.smi.OID class, each term in the OID has to fit into a primitive
>> int  supports only an array of int's.
>> If I had an ObjectID like 1.3.6.1.4.1.9.9.42.1.3.5.1.8.71105.
>> 2447483647, would snmp4j support querying such an object ?
>> Note that the value 2447483647 is greater than the signed 32-bit maximum
>> integer which is 2147483647.
>>
>> If this is not currently supported, are there plans to support this in a
>> future version of snmp4j?
>>
>> This occurs in the case of Cisco devices while monitoring response path
>> tests where the Cisco agent actually uses the sysUpTime from the device to
>> keep running "buckets" in which to store data within a given table. We
>> first perform getNext's to identify the 'current bucket'. Then we use that
>> bucket as part of creating the OID, and issue GET requests using this OID.
>> The current bucket is increased every hour, so that new data can be stored,
>> and old data can be purged, and hence sysUpTime is used to generate the
>> bucket. Since the value of sysUpTime is an unsigned integer (or in
>> TimeTicks), it can actually exceed 2,147,483,647 - it's theoretical max
>> limit is  4,294,967,294. So we notice this problem show up on devices that
>> have been running for greater than ~250 days.
>>
>> Thanks,
>> Syed F. Ali
>>
>> _______________________________________________
>> SNMP4J mailing list
>> SNMP4J at agentpp.org
>> https://oosnmp.net/mailman/listinfo/snmp4j
>>
>
> --
> ---
> AGENT++
> Maximilian-Kolbe-Str. 10
> 73257 Koengen, Germany
> https://agentpp.com
> Phone: +49 7024 8688230
> Fax:   +49 7024 8688231
>
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> https://oosnmp.net/mailman/listinfo/snmp4j
>



More information about the SNMP4J mailing list