Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-7960

snmp-adaptor.sar: Exporting float jmx attributes does not work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • No Release
    • JBossAS-5.1.0.GA
    • JMX
    • None

    Description

      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 @@

      { ssy = (SnmpObjectId)val; }
      • 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}

      Attachments

        Activity

          People

            dandread1@redhat.com Dimitrios Andreadis
            mschoechlin_jira Marc Schoechlin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: