JBoss Community Archive (Read Only)

RHQ 4.9

JBoss AS 5.x-6.x Product Configuration

Overview

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

Enabling Remote Access to JMX and Profile Service

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.

In AS 5.x, 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>

In 6.x, the JNP service is configured via the following block in <JBOSS_HOME>/server/<CONFIG_NAME>/deploy/naming-jboss-beans.xml:

<bean name="RemoteNamingBean" class="org.jnp.server.Main"> ... </bean>

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

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

<interceptor code="org.jboss.jmx.connector.invoker.AuthenticationInterceptor"
                     securityDomain="java:/jaas/jmx-console"/>

To enable authentication in AS 6.x, uncomment the following line in <JBOSS_HOME>/server/<CONFIG_NAME>/deploy/jmx-jboss-mbeans.xml:

<property name="securityDomain">jmx-console</property>

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:

admin=admin

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"
JAVA_OPTS="$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"

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

set JAVA_OPTS=%JAVA_OPTS% -Djboss.platform.mbeanserver
set JAVA_OPTS=%JAVA_OPTS% -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl

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/server/<PROFILE>/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/jbossweb.sar/ for AS 5.x-6.x, or <JBOSS_HOME>/server/<CONFIG_NAME>/default/deploy/jboss-web.deployer/conf/ for AS 3.x-4.x). 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)
   <filter>
       <filter-name>RhqRtFilter</filter-name>
       <filter-class>org.rhq.helpers.rtfilter.filter.RtFilter</filter-class>
-->

<!-- 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.

       <init-param>
           <param-name>chopQueryString</param-name>
           <param-value>true</param-value>
       </init-param>
       <init-param>
           <param-name>logDirectory</param-name>
          <param-value>/tmp</param-value>
       </init-param>
       <init-param>
           <param-name>logFilePrefix</param-name>
           <param-value>localhost_7080_</param-value>
       </init-param>
       <init-param>
           <param-name>dontLogRegEx</param-name>
           <param-value></param-value>
       </init-param>
       <init-param>
          <param-name>matchOnUriOnly</param-name>
          <param-value>true</param-value>
       </init-param>
       <init-param>
           <param-name>timeBetweenFlushesInSec</param-name>
           <param-value>73</param-value>
       </init-param>
       <init-param>
           <param-name>flushAfterLines</param-name>
           <param-value>13</param-value>
       </init-param>
       <init-param>
           <param-name>maxLogFileSize</param-name>
           <param-value>5242880</param-value>
       </init-param>
-->

<!-- end tag (also uncomment start tag)
   </filter>
-->

  <!-- ===== 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.       -->
<!--
   <filter-mapping>
       <filter-name>RhqRtFilter</filter-name>
       <url-pattern>/*</url-pattern>
   </filter-mapping>
-->

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 Context Resource or Embedded Web Application Context Resource corresponding to the web application. To do so, go to the (JBossAS5) 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, expand the Embedded Web Application (WAR)s node under the Applications node. Find the WAR Resource corresponding to the WAR and expand it, then click on its child (Embedded) Web Application Context Resource node to select that Resource.

  2. Go to the (Embedded) Web Application Context 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-6.1.0.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 Context 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:39 UTC, last content change 2013-09-18 19:42:24 UTC.