Exposing MBean Events via SNMP


JBoss has an snmp-adaptor service that can be used to intercept JMX notifications emitted by MBeans, convert them to traps, and send them to SNMP managers. In this respect, the snmp-adaptor acts as an SNMP agent. Future versions may offer support for full agent get/set functionality that maps onto MBean attributes or operations.

This service can be used to integrate JBoss with higher-order system/network management platforms (HP Open-View, for example), making the MBeans visible to those systems. The MBean developer can instrument the MBeans by producing notifications for any significant event (for example, server coldstart), and the adaptor can then be configured to intercept the notification and map it onto an SNMP traps. The adaptor uses the JoeSNMP package from OpenNMS as the SNMP engine.

The SNMP service is configured in snmp-adaptor.sar. This service is available only in the all configuration, so you need to copy it to your configuration if you want to use it. Inside the snmp-adaptor.sar directory are two configuration files that that control the SNMP service:

  • managers.xml This file configures where to send traps. The content model for this file is shown in Figure 2.21.

    Figure 2.21. The schema for the SNMP managers file.


  • notifications.xml This file specifies the exact mapping of each notification type to a corresponding SNMP trap. The content model for this file is shown in Figure 2.22.

    Figure 2.22. The schema for the notification to trap mapping file.


    The SNMPAgentService MBean is configured in snmp-adaptor.sar/META-INF/jboss-service.xml. These are the configurable parameters:

  • HeartBeatPeriod Specifies the period, in seconds, during which heartbeat notifications are generated.

  • ManagersResName Specifies the resource name of the managers.xml file.

  • NotificationMapResName Specifies the resource name of the notications.xml file.

  • trapFactoryClassName Specifies the org.jboss.jmx.adaptor.snmp.agent.TrapFactory implementation class that takes care of translation of JMX notifications into SNMP version 1 and version 2 traps.

  • TimerName Specifies the JMX ObjectName of the JMX timer service to use for heartbeat notifications.

  • SubscriptionList Specifies which MBeans and notifications to listen for.

The Event to Trap Service

trapdService is a simple MBean that acts as an SNMP Manager. It listens to a configurable port for incoming traps and logs them as DEBUG messages, using the system logger. You can modify the log4j configuration to redirect the log output to a file. SnmpAgentService and trapdService are not dependent on each other.



JBoss 4. 0(c) The Official Guide
JBoss 4.0 - The Official Guide
ISBN: B003D7JU58
EAN: N/A
Year: 2006
Pages: 137

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net