此内容没有您所选择的语言版本。
Chapter 6. Monitoring Enterprise Web Server with JBoss Operations Network
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.1. Configuring User Permissions on a Unix Operating System
Note
If you are using Windows, skip these steps and proceed to Procedure 6.2, “Configuring Monitoring”.
RHQ/JON agent needs read and write permission to the
httpd
and Tomcat directories.
Follow this procedure to assign the permissions:
- At the shell prompt, become the root user.
- 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.2. 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.
Follow this procedure to set up JMX to handle authentication:
- Open the
startup
file 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.0/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.0/tomcat<VERSION>/bin/startup.sh
- on Windows open
$TOMCAT_HOME\bin\
catalina.bat
. Adjust the value of $TOMCAT_HOME based on the version of Tomcat being set up.
- Define an available port for JMX monitoring. Make sure it is not blocked by any firewall. To do so, to the JAVA_OPTS variable in the startup file, add the following line and substitute PORT_NUMBER with the number of the port dedicated to monitoring:
- 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
- Direct the JBoss Operations Network agent to locate the JMX port defined.
- Clickin the JBoss Operations Network interface.
- Set the value of the Manager URL property to the RMI URL at which Tomcat is available. 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/jmxrmi
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Save the new value. The Tomcat resource now appears as fully available for JBoss Operations Network.
- 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.0/jmxremote.access" JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.password.file=/opt/jboss-ews-2.0/jmxremote.password"
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.access.file=/opt/jboss-ews-2.0/jmxremote.access" JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.password.file=/opt/jboss-ews-2.0/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.0\jmxremote.access" set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.password.file=C:\Program Files\jboss-ews-2.0\jmxremote.password"
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.access.file=C:\Program Files\jboss-ews-2.0\jmxremote.access" set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.password.file=C:\Program Files\jboss-ews-2.0\jmxremote.password"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow