-
Bug
-
Resolution: Unresolved
-
Major
-
JBossAS-5.1.0.GA
-
None
Exporting SNMP float values does currently not work with snmp-adaptor.sar.
Detailed are described in this discussion: http://community.jboss.org/thread/150912
This bug can be fixed by the attached patch:
Due to the fact that there is not compatible type in org.opennms.protocols.snmp.*
Float is converted to String.
The attached patch is based on:
${code}
$ svn info
Path: .
URL: http://anonsvn.jboss.org/repos/jbossas/trunk
Repository Root: http://anonsvn.jboss.org/repos/jbossas
Repository UUID: 84be2c1e-ba19-0410-b317-a758671a6fc1
Revision: 104117
${code}
The patch:
${code}
ndex: varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/RequestHandlerImpl.java
===================================================================
— varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/RequestHandlerImpl.java (revision 104117)
+++ varia/src/main/java/org/jboss/jmx/adaptor/snmp/agent/RequestHandlerImpl.java (working copy)
@@ -483,12 +483,21 @@
- else if (val instanceof SnmpTimeTicks)
+ else if (val instanceof Float)
+ { + /* + * Due to the fact that there is not compatible type in org.opennms.protocols.snmp.* we convert + * Float to String + */ + String in = String.valueOf(val); + ssy = new SnmpOctetString(in.getBytes()); + }+ else if (val instanceof SnmpTimeTicks)
{ ssy = (SnmpTimeTicks)val; }else
- log.info("Unknown type for " + be);
+ log.info("Unknown type for " + be + "(Type was "val.getClass().getName()")");
}
catch (Exception e)
{
${code}