Index: varia/src/main/org/jboss/jmx/adaptor/snmp/system/MIB2SystemGroupServiceMBean.java =================================================================== --- varia/src/main/org/jboss/jmx/adaptor/snmp/system/MIB2SystemGroupServiceMBean.java (revision 92546) +++ varia/src/main/org/jboss/jmx/adaptor/snmp/system/MIB2SystemGroupServiceMBean.java (working copy) @@ -26,6 +26,7 @@ import org.jboss.mx.util.ObjectNameFactory; import org.jboss.system.ServiceMBean; import org.opennms.protocols.snmp.SnmpObjectId; +import org.opennms.protocols.snmp.SnmpTimeTicks; /** * MIB2SystemGroupService MBean interface @@ -53,7 +54,7 @@ SnmpObjectId getSysObjectId(); /** The uptime of the system (system.3) */ - long getSysUpTime(); + SnmpTimeTicks getSysUpTime(); /** The system contact person (system.4) */ void setSysContact(String sysContact); Index: varia/src/main/org/jboss/jmx/adaptor/snmp/system/MIB2SystemGroupService.java =================================================================== --- varia/src/main/org/jboss/jmx/adaptor/snmp/system/MIB2SystemGroupService.java (revision 92546) +++ varia/src/main/org/jboss/jmx/adaptor/snmp/system/MIB2SystemGroupService.java (working copy) @@ -28,6 +28,7 @@ import org.jboss.system.server.ServerConfigLocator; import org.jboss.system.server.ServerInfoMBean; import org.opennms.protocols.snmp.SnmpObjectId; +import org.opennms.protocols.snmp.SnmpTimeTicks; /** * An MBean service that defines the MIB-2 system group an agent @@ -120,14 +121,14 @@ * The system uptime in hundreth of a second (TimeTicks) * @jmx:managed-attribute */ - public long getSysUpTime() + public SnmpTimeTicks getSysUpTime() { if (snmpAgent !=null) { try { Long upTime = (Long)server.getAttribute(snmpAgent, "Uptime"); - return upTime.longValue() / 10; + return new SnmpTimeTicks(upTime.longValue() / 10); } catch (Exception e) { @@ -135,7 +136,7 @@ } } // fallback - return System.currentTimeMillis() / 10; + return new SnmpTimeTicks(System.currentTimeMillis() / 10); } /** Index: varia/src/main/org/jboss/jmx/adaptor/snmp/agent/RequestHandlerImpl.java =================================================================== --- varia/src/main/org/jboss/jmx/adaptor/snmp/agent/RequestHandlerImpl.java (revision 92546) +++ varia/src/main/org/jboss/jmx/adaptor/snmp/agent/RequestHandlerImpl.java (working copy) @@ -41,16 +41,7 @@ import org.jboss.xb.binding.ObjectModelFactory; import org.jboss.xb.binding.Unmarshaller; import org.jboss.xb.binding.UnmarshallerFactory; -import org.opennms.protocols.snmp.SnmpAgentSession; -import org.opennms.protocols.snmp.SnmpInt32; -import org.opennms.protocols.snmp.SnmpNull; -import org.opennms.protocols.snmp.SnmpObjectId; -import org.opennms.protocols.snmp.SnmpOctetString; -import org.opennms.protocols.snmp.SnmpPduPacket; -import org.opennms.protocols.snmp.SnmpPduRequest; -import org.opennms.protocols.snmp.SnmpSyntax; -import org.opennms.protocols.snmp.SnmpUInt32; -import org.opennms.protocols.snmp.SnmpVarBind; +import org.opennms.protocols.snmp.*; /** * Implement RequestHandler with mapping of snmp get/set requests @@ -492,6 +483,10 @@ { ssy = (SnmpObjectId)val; } + else if (val instanceof SnmpTimeTicks) + { + ssy = (SnmpTimeTicks)val; + } else log.info("Unknown type for " + be); }