How to configure JBoss 6.3.0GA to use RMI JMX?

13,290

To connect to JMX the URL entered should be in the format

service:jmx:remoting-jmx://{host_name}:{port}

Standalone mode

where {port} is the native management interface of the AS7 installation being monitored (default=9999).

Domain mode

where {port} is the JMX subsystem interface of the AS7 installation being monitored (first server=4447, port-offset=150 next server).

<subsystem xmlns="urn:jboss:domain:jmx:1.1">
   <show-model value="true"/>
   <remoting-connector use-management-endpoint="false"/>
</subsystem>

Both modes

Outside localhost you have to set -Djboss.bind.address.management or inside xml (standalone.xml / host.xml).

Once connected the capabilities provided by jconsole can be used as normal.

Authentication

The connector is making use of JBoss Remoting to communicate with the server, for this reason the exact same authentication mechanisms as are used by the CLI will apply here.

Local

For processes running local to the AS7 installation we support a local authentication mechanism which allows clients to verify their identity by sharing a token on the filesystem with the server - this mechanism runs silently without any further user interaction required.

Username / Password

Where local authentication is not possible such as if the client is running as a different user than the AS7 process or is running on a remote installation by default the next mechanism to be used is username / password based. Where this mechanism is used the username and password of a user in the ManagementRealm if using the default management connector (port 9999) or in the ApplicationRealm if using the remoting connector (port 4447) should be supplied in the boxes on the 'New Connection' screen before the 'Connect' button is clicked.

The $JBOSS_HOME/bin/add-user.sh (Linux) or $JBOSS_HOME/bin/add-user.bat (Windows) scripts can be used to add these users. Make sure to choose between Management User and ManagementRealm vs Application User and ApplicationRealm depending on whether you're using the default management connector or the remoting connector (usually used with domain mode or when connecting remotely).

Necessary libraries to connect JMX over JBoss Remoting

The JMX MBeanServer is accessible using JBoss Remoting through the management connection. Therefore, it is necessary to add the following libaries from the modules directory of the EAP6 / AS7 distribution to the classpath of the monitoring application:

org/jboss/remoting3/remoting-jmx
org/jboss/remoting3
org/jboss/logging
org/jboss/xnio
org/jboss/xnio/nio
org/jboss/sasl
org/jboss/marshalling
org/jboss/marshalling/river

Ref: Using jconsole to connect to JMX on AS7

Other resource: Connecting VisualVM with a remote JBoss AS 7 / EAP6 JVM process

EDIT:

JBoss EAP 5 supports JMX monitoring using RMI, where JBoss EAP 6 does not. EAP 6 uses “remoting-jmx” instead of “rmi”.

You should look for another solution, as SNMP, or proper plugin for nagios

See:

JVM monitoring via SNMP of JBoss EAP 6 worker nodes with pnp4nagios Template

Jboss SAR MBean and Perl plug-in for Nagios compatible with Jboss 7.1.1

Share:
13,290
djb
Author by

djb

Updated on September 09, 2022

Comments

  • djb
    djb over 1 year

    As you can see, there's the new instructions:
    https://docs.jboss.org/author/display/AS71/JMX+subsystem+configuration
    And the old RMI instructions:
    https://docs.jboss.org/author/pages/viewpage.action?pageId=21627109

    I can get the new instructions working, but we use nagios, which only allows checking JMX via RMI, so I need to get RMI JMX working.

    Does anyone have a solution for this? I can't use the old instructions because it says <jmx-connector> is no longer supported.

    I've added the following to my JAVA_OPTS on JBoss startup:

    JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dorg.jboss.logging.Logger.pluginClass=org.jboss.logging.logmanager.LoggerPluginImpl -Djava.rmi.server.hostname=10.20.2.50

    but i can't get jconsole to connect to service:jmx:rmi:///jndi/rmi://10.20.2.50:12345/jmxrmi

    (PS. If anyone with redhat paywall access could report back on the answer here: https://access.redhat.com/solutions/263763 that would be swell :P)

  • djb
    djb over 9 years
    Erm, thanks, but as my question stated, I already have the remoting-jmx protocol working fine. I need to get RMI JMX working, because nagios doesn't use the remoting-jmx protocol. It only uses RMI. Furthermore, these instructions will not work on JBoss EAP 6.3.0 GA because they have changed the subsystem tags, for jmx subsystem 1.4, and if you try change it to a previous version, like 1.1, it will tell you in the logs that it has disabled jmx because you used the wrong tags.
  • Federico Sierra
    Federico Sierra over 9 years
    @djb I edit the answer adding some more information. I think you can not use the same configuration you were using earlier versions of JBoss with Nagios.
  • djb
    djb over 9 years
    Ok, thanks, I'll try these new options, and report back in a day or two.
  • djb
    djb over 9 years
    I ended up going with Jolokia and Jmx4Perl, and managed to get that working in nagios. The thing is I had to expose the details of my embedded activemq, and it was getting pretty complicated with SNMP, with the need to convert from MBeans to MIBs. The second link was useful for creating my own MBean, but i ended up not needing that.
  • Federico Sierra
    Federico Sierra over 9 years
    @djb nice solution is use Jolokia, you can check activemq for example invoking http://localhost:8161/api/jolokia/read/org.apache.activemq:t‌​ype=Broker,brokerNam‌​e=localhost if you are using version 5.8 or higher