Reference:http://blog.163.com/lucas_nina/blog/static/185960149201493034258448/Proven OK Jconsole is a tool that comes with the JDK. So install the JDK first
Path to the 1.jconsole tool:
View/usr/local/jdk1.7.0_79/bin/jconsole by which Jconsole2. How to use:On the Linux monitor side of the graphical interface execution:/usr/local/jdk1.7.0_79/bin/jconsoleA graphical Java monitoring and Management console appears.3. After execution appears jconsole new connection, there are two options:1. Local process (can monitor native Java)--"Org.apache.catalina.startup.Bootstartup start"2. Remote process (Java for monitoring other hosts)---"fill in the host name that needs to be monitored: monitoring port, enter the monitoring dedicated username/password (optional)Step 1: Modify the catalina.sh configuration file on the monitored Host:vi/opt/tomcat/conf/catalina.shIf you do not require password verification, add the following 3 lines at the beginning of the second line:java_opts= "$JAVA _opts-dcom.sun.management.jmxremote.port=12345"Java_opts=" $JAVA _opts-dcom.sun.management.jmxremote.authenticate=false"Java_opts=" $JAVA _opts-dcom.sun.management.jmxremote.ssl=false"Save exit//"12345" for monitoring port number for password verification, the following 4 lines will be changed:java_opts= "$JAVA _opts-dcom.sun.management.jmxremote.port=12345"Java_opts=" $JAVA _opts-dcom.sun.management.jmxremote.authenticate=true"Java_opts=" $JAVA _opts-dcom.sun.management.jmxremote.ssl=false"Java_opts=" $JAVA _opts-dcom.sun.management.jmxremote.pwd.file=/usr/local/jdk1.7.0_79/Jre/lib/management/jmxremote.password "Save exitStep 2: Copy the/usr/local/jdk1.7.0_79/jre/lib/management/jmxremote.password.template:Cp/usr/local/jdk1.7.0_79/jre/lib/management/jmxremote.password.template \/usr/local/jdk1.7.0_79/jre/lib/ Management/jmxremote.passwordStep 3: Add the user name and password for remote monitoring:VIJmxremote.password//To add a user name and passwordMonitorrole 12345678//Username: monitorrole, this name system is pre-setAdmin 123456//Custom user name: adminRoot 123456//Custom user name: RootForce Save exitVIjmxremote.access//custom monitored User name has what permissionsAdd to:Admin ReadOnly//define read-only account, name anyroot readwrite \//define read/write account, name anyCreate javax.management.monitor.*,javax.management.timer.* \Save ExitchmodJmxremote.passwordChown UUCP:UUCP Jmxremote.password//First use ls-l/usr/local/jdk1.7.0_79 to see which users and groups belong to, and then set to the same. Note: If Jconsole cannot access native programs, add the following: java_opts= "$JAVA _opts-dcom.sun.management.jmxremote"OK, you can connect:Enter the host name to be monitored Cen01, port: 12345,
Use the Jconsole tool to monitor Java performance