Chapter 6. Monitoring Enterprise Web Server with JBoss Operations Network
Procedure 6.1. Download Installation Files
- Open http://access.redhat.com in a web browser.
- Click in the menu across the top of the page.
- Click in the list under JBoss Enterprise Middleware.
- Enter your login information.You are taken to the Software Downloads page.
Download the JBoss Operations Network Plugin
If you intend to use the JBoss Operations Network plugin for JBoss Enterprise Web Server, selectJBoss ON for EWSfrom either the Software Downloads drop-down box, or the menu on the left.- Click the
JBoss Operations Network VERSION Base Distributiondownload link. - Click the link to start the Base Distribution download.
- Repeat the steps to download the
EWS Plugin Pack for JBoss ON VERSION
Procedure 6.2. Configuring User Permissions on a Unix Operating System
Note
httpd and Tomcat directories.
- As a user with root privileges, run the following command to add the user, under which JON Agent runs to the tomcat and apache user groups:
# usermod -aG tomcat,apache <RHQ_AGENT_USER>
Procedure 6.3. Configuring Monitoring
- Open the
startupfile of the respective JBoss Enterprise Web Server instance for editing:- on Red Hat Enterprise Linux installed from a ZIP file open
/opt/jboss-ews-2.1/tomcat<VERSION>/bin/startup.sh - on Red Hat Enterprise Linux installed from a RPM files open
/usr/sbin/tomcat<VERSION> - on Solaris open
/opt/jboss-ews-2.1/tomcat<VERSION>/bin/startup.sh - on Windows open
C:\Program Files\jboss-ews-2.1\share\tomcat<VERSION>\bin\startup.bat. - on Red Hat Enterprise Linux and on Solaris when running by
daemon.shopen/opt/jboss-ews-2.1/tomcat<VERSION>/bin/setenv.sh
- Define an available port for JMX monitoring. Ensure the port is not blocked by any firewall. To ensure the port is not blocked, in the startup file, add the following line and substitute PORT_NUMBER with the number of the port dedicated to monitoring to the JAVA_OPTS variable:
- on Red Hat Enterprise Linux and Solaris:
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=PORT_NUMBER -Djava.rmi.server.hostname=IP_ADDRESS" - on Windows:
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=PORT_NUMBER -Djava.rmi.server.hostname=IP_ADDRESS"
- If you want to disable authentication and SSL for development purposes, add the following lines to the JAVA_OPTS variable in the startup file:
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false" JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"Important
In production environments, add the following lines to the JAVA_OPTS variable in the startup file to secure JMX with SSL and restrict the access with a firewall:- on Red Hat Enterprise Linux and Solaris
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.access.file=/opt/jboss-ews-2.1/jmxremote.access" JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.password.file=/opt/jboss-ews-2.1/jmxremote.password"- on Windows:
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.access.file=C:\Program Files\jboss-ews-2.1\jmxremote.access" set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.password.file=C:\Program Files\jboss-ews-2.1\jmxremote.password"
- Once the Tomcat server resource is discovered and imported into JBoss Operations Network inventory, it may be necessary to update the new resource's connection settings.
- Click in the JBoss Operations Network interface for the newly imported Tomcat Server resource.
- Verify the value of the Manager URL property to the RMI URL at which uses the correct JMX host name and port number as defined in the Tomcat server startup file. An example for this value is as follows:
service:jmx:rmi:///jndi/rmi://$IP_ADDRESS:$PORT/jmxrmi
Procedure 6.4. To configure JON monitoring for managing JBoss Enterprise Web Server Tomcat installed from RPMs:
- On the shell prompt become the root user.
- Set up JMX JAVA_OPTS properties in the
/usr/sbin/tomcat<VERSION>file in the start and start-security sections.if [ "$1" = "start" ]; then JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=8100 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxr emote.access.file="/etc/tomcat<VERSION>/jmxremote.access" -Dcom.sun.management.jmxremote.password.file="/etc/tomcat<VERSION>/jmxremote.password"" ${JAVACMD} $JAVA_OPTS $LOGGING_CONFIG $CATALINA_OPTS \ -classpath "$CLASSPATH" \ -Dcatalina.base="$CATALINA_BASE" \ -Dcatalina.home="$CATALINA_HOME" \ -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" \ -Djava.io.tmpdir="$CATALINA_TMPDIR" \ org.apache.catalina.startup.Bootstrap start \ >> ${CATALINA_BASE}/logs/catalina.out 2>&1 & if [ ! -z "$CATALINA_PID" ]; then echo $! > $CATALINA_PID fi elif [ "$1" = "start-security" ]; then JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=8100 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxr emote.access.file="/etc/tomcat<VERSION>/jmxremote.access" -Dcom.sun.management.jmxremote.password.file="/etc/tomcat<VERSION>/jmxremote.password"" ${JAVACMD} $JAVA_OPTS $LOGGING_CONFIG $CATALINA_OPTS \ -classpath "$CLASSPATH" \ -Dcatalina.base="$CATALINA_BASE" \ - Set tomcat to run as root user in the
/etc/tomcat<VERSION>/tomcat<VERSION>.conffile.TOMCAT_USER="root"
- On the shell prompt, run the following command to start tomcat.
service tomcat<VERSION> start
- Start the JON agent.
- From the JBoss Operations Network Web UI, import JON agent and tomcat to JON.
- On the JBoss Operations Network Web UI, setup Tomcat connection configuration (principal and credentials).
- On the JBoss Operations Network Web UI, setup Tomcat Control method configuration to RPM System V init script.
Note
Start and Shutdown script may not be set because Tomcat plugin always runsservice tomcat<VERSION> start/stopcommand for RPM System V init script configuration setting.
Procedure 6.5. JBoss Operations Network managing Tomcat installed as Windows service
- Install Tomcat as Windows service using the following command.
jboss-ews-2.1\share\tomcat6\bin\service.bat install
- Create
jmxremote.accessfile withcontrolRole readwritein theC:\jmxdirectory. - Create
jmxremote.passwordfile withcontrolRole pwdin theC:\jmxdirectory.Note
Set owner ofjmxremote.accessandjmxremote.passwordto SYSTEM and restrict access ofjmxremote.passwordfile only to user SYSTEM. The user SYSTEM must have only read access. - Enable JMX for Tomcat windows service.
jboss-ews-2.1\sbin\tomcat6.exe //US//Tomcat6 ++JvmOptions="-Dcom.sun.management.jmxremote.port=8100;-Dcom.sun.management.jmxremote.access.file="C:\jmx\jmxremote.access";-Dcom.sun.management.jmxremote.password.file="C:\jmx\jmxremote.password";-Dcom.sun.management.jmxremote.ssl=false;-Dcom.sun.management.jmxremote.authenticate=true"
- Start Tomcat win service by Windows services application
Note
See the tomcat logs in logs directory to check if Tomcat win service has started. - Install and configure JON agent. Type discovery in agent prompt to discover Tomcat windows service.
- On the JBoss Operations Network Web UI, click and then, click to select .
- On the JBoss Operations Network Web UI, go to platforms and search the agent name. Click on your agent.
- On the Agent page, Tomcat Servers are listed.
- Select your Tomcat server by clicking it.
- On the JBoss Operations Network Web UI, click on the tab and then configure the Tomcat Server in the Connection settings.
- Enter the Principal and Credentials information. use the
controlRoleand password set injmxremotefiles. - Set Control Method to RPM System V init script.
Note
You can not set Start and Shutdown Script fields. - Click .
- Update the connection settings of Tomcat Server JVM and set Principal and Credentials.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.