3 Replies Latest reply on May 27, 2010 9:51 AM by Alexander Kudryavtsev

    Exporting JMX to SNMP using snmp-adaptor.sar

    Marc Schoechlin Newbie

      I am exporting float values as jmx atttributes using spring 3.0 in the following way:

       

      @ManagedResource(objectName = "foobar:name=XYZVerarbeitung", description = "Kenndaten der XYZ Verarbeitung", 
        currencyTimeLimit = 15, persistPolicy = "OnUpdate", persistPeriod = 200, 
        persistLocation = "Loader", persistName = "XYZBAR")
      public class QueueNachrichtMdp implements MessageListener {
      ....
      ....
          @ManagedAttribute(description = "Anzahl der verarbeiteten Datensaetze", currencyTimeLimit = 5)
          public long getMessageCount() {
              return anzahlBearbeiteterMessages;
          }
          @ManagedAttribute(description = "Durchschnittliche Laufzeit einer Datensatzverarbeitung", 
            currencyTimeLimit = 5)
          public float getDatensatzLaufzeit() {
              if (anzahlBearbeiteterMessages == 0) {
                  return 0;
              } else {
                  return summeMessageLaufzeiten / anzahlBearbeiteterMessages / 1000f;
              }
          }
      

       

      The methods are exported like that:

       

      <mbean name="foobar:name=XYZVerarbeitung
      " oid-prefix=".1.3.6.1.4.1.4952.100.200.1.2.2">
           <attribute name="DatensatzLaufzeit" oid=".1"/>
           ....
           <attribute name="MessageCount" oid=".4"/>
           ....
         </mbean>
      

       

      Collecting "MessageCount" works properly - if i try to collect "DatensatzLaufzeit" (1.3.6.1.4.1.4952.100.200.1.2.2.1) i get the follwing logmessage:

       

      18:34:54,609 INFO  [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag=JBoss_5_1_0_GA date=200905221634)] Started in 1m:18s:393ms
      19:07:18,207 INFO  [SnmpAgentService] Unknown type for [oid=.1.3.6.1.4.1.4952.100.200.1.2.2.2, mbean=foobar:name=XYZVerarbeitung, attr=DatesaetzeProStunde, rw=false]
      19:07:18,209 INFO  [SnmpAgentService] Unknown type for [oid=.1.3.6.1.4.1.4952.100.200.1.2.2.1, mbean=foobar:name=XYZVerarbeitung, attr=DatensatzLaufzeit, rw=false]
      

       

      It seems that exporting float values is currently not possible snmp-adaptor.sar - is this correct?