[SNMP4J] SNMP4J PDUv1 Trap setting SysUpTime throws an Exception

Rory Marquis roridge at hotmail.com
Tue Jan 9 11:16:28 CET 2007


Hello

I posed this question last year, but don't appear to have gotten a reply. 
I'd really like to know the answer if anyone knows because I am looking to 
implement a solution. Please?

I have been creating v1 Traps today, and have noticed that when I set the
sysUpTime timestamp in the PDUv1, it allows a long value as the argument but
then sets the value into a TimeTicks object, which inherits the
UnsignedInteger32.

This becomes an issue when the server has been up for more than 248 days
(measured in TimeTicks).

I was wondering, is this an oversight, or a feature?

Code when run, throws an IllegalArgumentException:

    PDUv1 pdu = new PDUv1();
    long sysUpTime = 100*60*60*24*249;  //248 days max
    pdu.setTimestamp(sysUpTime);

    Exception in thread "main" java.lang.IllegalArgumentException:
   Argument must be an unsigned 32bit value


Thanks in advance
Rory

_________________________________________________________________
MSN Hotmail is evolving – check out the new Windows Live Mail 
http://ideas.live.com




More information about the SNMP4J mailing list