此内容没有您所选择的语言版本。
Chapter 6. Monitoring Enterprise Web Server with JBoss Operations Network
Complete this task to download the JBoss Operations Network (JON) plugin for JBoss Enterprise Web Server from the Red Hat Customer Portal.
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
To allow JBoss Operations Network to monitor JBoss Enterprise Web Server, you need to configure the server to allow the JBoss ON discovery and give JBoss ON the needed access.
Procedure 6.2. Configuring User Permissions on a Unix Operating System
Note
For Windows, skip these steps and proceed to Procedure 6.3, “Configuring Monitoring”.
RHQ/JON agent needs read and write permission to the
httpd and Tomcat directories.
To assign the permissions:
- 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>
# usermod -aG tomcat,apache <RHQ_AGENT_USER>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure 6.3. Configuring Monitoring
JBoss Enterprise Web Servers are auto-discovered on Linux and Unix platforms. However, you need to configure the instance's JMX to allow proper handling of authentication and accurate Tomcat monitoring.
To set up JMX to handle authentication:
- 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"JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.port=PORT_NUMBER -Djava.rmi.server.hostname=IP_ADDRESS"Copy to Clipboard Copied! Toggle word wrap Toggle overflow - on Windows:
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=PORT_NUMBER -Djava.rmi.server.hostname=IP_ADDRESS"
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=PORT_NUMBER -Djava.rmi.server.hostname=IP_ADDRESS"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- 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"JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false" JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"Copy to Clipboard Copied! Toggle word wrap Toggle overflow 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"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"Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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"
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"Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- 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
service:jmx:rmi:///jndi/rmi://$IP_ADDRESS:$PORT/jmxrmiCopy to Clipboard Copied! Toggle word wrap Toggle overflow
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.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Set tomcat to run as root user in the
/etc/tomcat<VERSION>/tomcat<VERSION>.conffile.TOMCAT_USER="root"
TOMCAT_USER="root"Copy to Clipboard Copied! Toggle word wrap Toggle overflow - On the shell prompt, run the following command to start tomcat.
service tomcat<VERSION> start
service tomcat<VERSION> startCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 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
jboss-ews-2.1\share\tomcat6\bin\service.bat installCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 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"
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"Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 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.