Version 10

    Mapping-configuration, attributes.xml


    This file defines the mapping from SNMP-oids to MBeans and their attributes.

    (Note: xml driven get/set mapping functionality is available since jboss v4.0.4.GA.)


    The toplevel element attribute-mapping contains a list of mbeans.

    Each mbean element has to have a name attribute that specifies the

    JMX object name of the mbean to monitor. It can also have an oid-prefix element

    that will be prepended to the oids of the attributes. The mbean element contains a list

    of attribute tags that each have to have a name attribute for the

    MBean-attribute-name and an oid attribute that defines the oid under which

    this attribute can be queried.


    Setup in general configuration


    In order to work, the mapping file must be included in the SnmpAgentService-MBean in an attribute called RequestHandlerResName as the following snippet shows


      <!-- The SNMP adaptor MBean -->
      <mbean code="org.jboss.jmx.adaptor.snmp.agent.SnmpAgentService"
        <attribute name="RequestHandlerClassName">org.jboss.jmx.adaptor.snmp.agent.RequestHandlerImpl</attribute>       
        <attribute name="RequestHandlerResName">/attributes.xml</attribute>




    This is an excerpt from the sample file from the snmp-adaptor:


         <!-- system basic information -->
         <mbean name="jboss.system:type=ServerInfo" oid-prefix=".">
              <attribute name="ActiveThreadCount" oid=".1"></attribute>
              <attribute name="FreeMemory" oid=".2"></attribute>
              <attribute name="MaxMemory" oid=".3"></attribute>
         <mbean name="jboss.system:service=ThreadPool">
              <attribute name="QueueSize" oid="."></attribute>
         <!-- tomcat global http request processing -->
         <mbean name="jboss.web:name=http-,type=GlobalRequestProcessor">
              <attribute name="requestCount" oid="."></attribute>
         <!-- Tx Manager statistics -->
         <mbean name="jboss:service=TransactionManager">
              <attribute name="CommitCount" oid="."></attribute>
              <attribute name="RollbackCount" oid="."></attribute>
              <attribute name="TransactionCount" oid="."></attribute>
         <!-- DefaultDS statistics -->
         <mbean name="jboss.jca:name=DefaultDS,service=ManagedConnectionPool" 
              <attribute name="InUseConnectionCount" oid=".9"></attribute>


    Note that the provided values will change in the future.


    The adaptor now also has support for the MIB-2 system group (RFC1213)


    Reload a changed config


    The SnmpAdaptor-MBean now has a reconfigureRequestHandler Method which forces the adaptor to reread the attributes.xml file without the need to completely restart the adaptor.


    Example SNMP-MIB for the above example file


    This is an extremely simple MIB file that you can load into your management station to

    query the respective values.


    Note that this MIB will change in the future.


    -- Tree roots
    org     OBJECT IDENTIFIER ::= { iso 2 } -- "iso" = 1
    jboss     OBJECT IDENTIFIER ::= { org 3 }
    as     OBJECT IDENTIFIER ::= { jboss 4 }
    system     OBJECT IDENTIFIER ::= { as 1 }  -- .
    mgmt      OBJECT IDENTIFIER ::= { as 5 }
    snmp     OBJECT IDENTIFIER ::= { mgmt 6 }
    agent      OBJECT IDENTIFIER ::= { snmp 7 }
    -- system parameters
    activeThreadCount OBJECT-TYPE
         ACCESS read-only 
              "The number of active Threads in the system"
         ::= { system 1 } -- .
    freeMemory OBJECT IDENTIFIER ::= {system 2} -- .
    maxMemory OBJECT IDENTIFIER ::= {system 3} -- .
    threadPoolQueueSize OBJECT-TYPE
         ACCESS read-only
              "The size of the thread pool queue"
         ::= {system 4 }
    requestCount8080 OBJECT IDENTIFIER ::= {system 5}
    txCommitCount OBJECT IDENTIFIER ::= {system 6 }
    txRollbackCount OBJECT IDENTIFIER ::= {system 7 }
    txActiveCount OBJECT IDENTIFIER ::= {system 8 }
    dbInUseCount OBJECT-TYPE
         ACCES read-only
              "The number of db connections currently in use"
         ::= { system 9 }





    The adaptor now also supports snmp-set. In order for an entry to be settable, it not only needs to be marked read-write in the MIB, but also have an attribute mode in the attributes.xml file with a value of rw as in the following example:


       <mbean name="jboss.jmx:name=SnmpAgent,service=snmp,type=systemInfo" 
          <attribute name="SysDescr" oid=".1" mode="rw"></attribute> <!-- can be modified over snmp -->


    Note that for this to work, you have to define a write-community in jboss-service.xml for the

    main adaptor mbean and also have to set it in your agent. If you fail to do so, the set-request will silently time out (this comes from the underlying library).







    Referenced by: