JBoss uses the JAVA_OPTS
approach for enabling remote access to MBeans. However, it requires some additional properties. To set up your JAVA_OPTS
for use in JBoss see the following code segment:
JAVA_OPTS="-Dcom.sun.management.jmxremote.port=12345" JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false" JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false" JAVA_OPTS="${JAVA_OPTS} -Djboss.platform.mbeanserver" JAVA_OPTS="${JAVA_OPTS} -Djavax.management.builder.initial=org.jboss.system\ .server.jmx.MBeanServerBuilderImpl" export JAVA_OPTS
When you start JBoss via the run.sh you must also pass the "-b 0.0.0.0" argument:
cd ${JBOSS_HOME}/bin ./run.sh -b 0.0.0.0
JMX actually uses two separate ports for MBean access: one is used for initial connection handling and authentication, and the other is used for RMI access. During the handshake between a JMX Client and the JMX Agent the agent tells the client the IP address and port number for the RMI registry. By default JBoss sets the IP address to 127.0.0.1. This works when the JMX client and the JMX agent reside on the same device, but it won't work in a distributed environment.
By passing the "-b 0.0.0.0" argument you instruct JBoss to bind to all available network ports, and this results in the JMX Agent's handshaking logic using a network reachable address when informing clients of the RMI registry hostname and port.
The jmx-console
Web page in JBoss allows you to view the different MBeans that are available; however, this does not mean that these MBeans are available remotely. If JConsole can view MBeans, then so can the zenjmx daemon that gathers this information.
All JBoss services must have a device entry under the /Devices/Server/JBoss
device class.
Note
The zenjmx daemon must be configured and running. See Section 2.1, “Sun Java Runtime Environment (JRE)” for more information about configuring the zenjmx daemon with the Sun JRE tools.
Navigate to the device or device class in the Zenoss interface.
If applying changes to a device class:
Select the class in the devices hierarchy.
Click Details.
Select Configuration Properties.
If applying changes to a device:
Click the device in the device list.
Select Configuration Properties.
Edit the appropriate configuration properties for the device or devices.
Table 38.2. JBoss Configuration Properties
Name Description zJBossJmxManagementAuthenticate
This configuration property is deprecated.
zJBossJmxManagementPassword
JMX password
zJBossJmxManagementPort
The port number used to gather JMX information
zJBossJmxManagementUsername
JMX username for authentication
Click
to save your changes.You will now be able to start collecting the JBoss server metrics from this device.
Navigate to Graphs and you should see some placeholders for graphs. After approximately fifteen minutes you should see the graphs start to become populated with information.
Tip
The out-of-the-box JBoss data source configuration has been defined at the macro level, but can be configured to operate on a more granular basis. For example, the Servlet Reload Count applies to all servlets in all Web applications but it could be narrowed to be Servlet /submitOrder in Web application "production server."