[SNMP4J] time ticks from long

Jose Ignacio jicenteno.listas at gmail.com
Mon Sep 25 14:14:32 CEST 2006


Hello, I'm trying to use time ticks for sysUpTime:

long sysUpTime = System.currentTimeMillis() - SNMPAgent.getStartTime();
TimeTicks tt = new TimeTicks();
tt.fromMilliseconds(sysUpTime)
pdu.add(new VariableBinding(SnmpConstants.sysUpTime, tt));

But it return:

java.lang.IllegalArgumentException: Argument must be an unsigned 32bit value
    at org.snmp4j.smi.UnsignedInteger32.setValue(UnsignedInteger32.java:148)
    at org.snmp4j.smi.TimeTicks.fromMilliseconds(TimeTicks.java:151)
    at com.telventi.framework.snmp.trap.TrapSender.sendV2(TrapSender.java
:196)
    at com.telventi.framework.snmp.tiagent.mib.TiSnmpTrap.send(
TiSnmpTrap.java:109)
    at com.telventi.framework.test.TiSnmpTrapTest.main(TiSnmpTrapTest.java
:53)

also:

long sysUpTime = System.currentTimeMillis() - SNMPAgent.getStartTime();
pdu.add(new VariableBinding(SnmpConstants.sysUpTime, new
TimeTicks(sysUpTime/100)));

But it return a similar exception (IllegalArgumentException)

What's wrong?



More information about the SNMP4J mailing list