JBoss Community Archive (Read Only)

RHQ 4.9

JBoss AS 3.x-4.x Product Configuration


JBoss AS 3.x and 4.x servers, and JBoss EAP/EWP/SOA-P 4.x servers, are managed by the jboss-as plugin. Server instances can always be auto-discovered, but in order to collect metrics and execute operations, they must have remote JMX access enabled.

Enabling Remote Acess to JMX

In order for the RHQ Agent to access metrics and operations of a managed JBoss AS instance, remote JMX access must be enabled for that instance.

Setting up remote JMX access for a JBoss AS instance is fairly straightforward.

First, verify that the JNP (JBoss Naming Protocol) service is deployed; it is deployed by default.

The JNP service is configured via the following block in <JBOSS_HOME>/server/<CONFIG_NAME>/conf/jboss-service.xml:

<mbean code="org.jboss.naming.NamingService"> ... </mbean>

It is typically a good idea to enable authentication on the JMX connector.

To enable authentication, uncomment the following line in <JBOSS_HOME>/server/<CONFIG_NAME>/deploy/jmx-invoker-service.xml:

<interceptor code="org.jboss.jmx.connector.invoker.AuthenticationInterceptor"

Note, in JBoss EAP and other application platform products, authentication is enabled by default.

If you enable authentication, make sure the admin user is enabled in <JBOSS_HOME>/server/<CONFIG_NAME>/conf/props/jmx-console-users.properties. The necessary line is:


This line is commented by default in JBoss EAP and other application platform products, but not in JBoss AS.

If you changed any configuration files, you will need to restart the JBoss AS instance for the changes to take effect.

Enabling Discovery and Management of JBoss AS JVM

To enable discovery and management of the JBoss AS JVM and its subsystems (memory management, threading, logging, etc.), you must configure JBoss AS to use the platform MBeanServer as the server it installs its MBeans into.

On UNIX, add the following lines to your run.conf:

JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"

On Windows, add the following lines to your run.bat:

set JAVA_OPTS=%JAVA_OPTS% -Djboss.platform.mbeanserver

Then restart JBoss AS.

Enabling HTTP Response-Time Metrics

Before enabling HTTP Response-Time metric collection in your JBoss AS Server WAR Resources, you will need to install the RHQ servlet filter JAR and configure the RHQ servlet filter in one or more web.xml files.

Install Filter Jar

The connector-rtfilter.zip file contains two jar files:

  1. the rhq-rtfilter JAR

  2. the commons-logging JAR

JBoss AS already includes commons-logging.jar, so only the rhq-rtfilter JAR file is needed; copy it to <JBOSS_HOME>/lib/.

Configure Filter in web.xml File(s)

Typically, the filter is deployed across all applications, in which case you can configure the filter in the global web.xml (located in <JBOSS_HOME>/server/<CONFIG_NAME>/default/deploy/jboss-web.deployer/conf/). However, if you only want to deploy the filter to certain web applications, instead configure it in <WAR>/WEB-INF/web.xml for each application.

Add the following lines to the web.xml file(s). Uncomment the filter and filter mapping to activate the filter. To only apply the filter to certain URL's, you can change the filter mapping's URL pattern and/or add additional filter mappings.

  <!-- ===== RHQ Response Time Metric Filter ===== -->
  <!-- This filter gathers response time information for processed requests -->
  <!-- for all hosted applications. This requires that the                  -->
  <!-- rhq-rtfilter-X.X.X.jar also be placed properly in the Tomcat         -->
  <!-- deployment. The jar file can be downloaded from the RHQ Server.      -->
  <!-- Using the GUI, navigate to the Administration page. Then click       -->
  <!-- 'Download Agent Connectors'.                                         -->
  <!-- Download connector-rtfilter.zip. Unzip to extract the jar.           -->
  <!--                                                                      -->
  <!-- Optional parameters                                                  -->
  <!--                                                                      -->
  <!--   chopQueryString  Filter directly chops off the query parameters    -->
  <!--                    from the URL? Default is true.                    -->
  <!--                                                                      -->
  <!--   logDirectory     Directory to which the logs are written.          -->
  <!--                                                                      -->
  <!--   logFilePrefix    Prefix to written logfile names.                  -->
  <!--                                                                      -->
  <!--   dontLogRegEx     Patterns that should not be logged.               -->
  <!--                                                                      -->
  <!--   matchOnUriOnly   Apply the dontLog pattern to the URI only?        -->
  <!--                                                                      -->
  <!--   timeBetweenFlushesInSec                                            -->
  <!--                    Seconds between auto flushes of the logfile.      -->
  <!--   maxLogFileSize   The maximum allowed size, in bytes, of the        -->
  <!--                    logfiles if a logfile exceeds this limit, the     -->
  <!--                    filter will truncate it; the default value is     -->
  <!--                    5242880 (5 MB)                                    -->
  <!--   vHostMappingFile Name of vhost mapping file. This properties file  -->
  <!--                    must be in the Tomcat process classpath.          -->
  <!--                                                                      -->
  <!-- NOTE: When enabling, also uncomment the RhqRtFilter filter below.    -->
  <!-- NOTE: When enabling, uncomment the start and end tags.               -->

<!-- start tag (also uncomment end tag)

<!-- Optional parameters. Note these typically remain commented. Also,
     some of these values may be configurable on the relevant
     RHQ Server resource, via the RHQ GUI.

<!-- end tag (also uncomment start tag)

  <!-- ===== RHQ Response Time Metric Filter Mapping ===== -->
  <!-- To limit to only certain applications various filters can be         -->
  <!-- defined. This will perform RT metric collection for all              -->
  <!-- applications.                                                        -->
  <!--                                                                      -->
  <!-- Note: Uncomment only when also enabling the RhqRtFilter above.       -->

Restart JBoss AS

After installing the filter jar and configuring the filter in web.xml, restart the JBoss AS instance to pick up the changes and deploy the filter.

Enable Collection of HTTP Response Time Metrics in RHQ

Once AS is logging HTTP response times for one or more web applications, you will need to configure RHQ to collect those response times. Enabling response time collection in RHQ is done on a per web application basis as follows:

  1. Find the Web Application (WAR) Resource or Embedded Web Application (WAR) Resource corresponding to the web application. To do so, go to the (JBossAS) JBoss AS Server Resource corresponding to the AS server that's collecting response times. In the Resource tree on the left, expand the Applications node that's a child of the JBoss AS Server Resource node. If the WAR for which you wish to enable response time collection is a standalone application, expand the Web Application (WAR)s node under the Applications node; or if the WAR is part of an EAR, first expand the Enterprise Application (EAR)s node and then expand the Embedded Web Application (WAR)s node under the EAR node. Find the WAR Resource node corresponding to the WAR and select that node.

  2. Go to the (Embedded) Web Application (WAR) Resource's Inventory > Connection Settings subtab. Under the Response Time section, make sure the Response Time Log File property is set to the correct location of the response time log file that the response time servlet filter is now producing (e.g. for a web application named foo.war deployed to the default virtual host, the path to the response time log file would be something like "/opt/jboss-4.2.3.Final/server/default/log/rt/foo_rt.log"). Optionally, you can also set the Response Time Url Excludes and/or Response Time Url Transforms properties.

  3. Go to the (Embedded) Web Application Context Resource's Monitoring > Schedules subtab and enable the "Response Time" metric. Set the collection interval of that metric to the value of choice.

  4. Wait a few minutes for the first batch of response time data to get collected and reported to the RHQ Server, then go to the (Embedded) Web Application (WAR) Resource's Monitoring > Calltime subtab to view the response time data. If the data's not there, wait a bit longer, then refresh the page.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 08:49:38 UTC, last content change 2013-09-18 19:42:25 UTC.