Monitor tomcat status (three methods)

Monitor tomcat status
1, open the java monitoring page
vim /usr/local/tomcat8/webapps/memtest/meminfo.jsp
<%
Runtime rtm = Runtime.getRuntime();
long mm = rtm.maxMemory()/1024/1024;
long tm = rtm.totaMemory()/1024/1024;
long fm = rtm.freeMemory()/1024/1024;
out.println("JVM memory detall info:<br>");
out.println("Max memory:"+mm+"MB"+"<br>");
out.println("Total memory:"+tm+"MB"+"<br>");
out.println("Free memory:"+fm+"MB"+"<br>");
out.println("Available memory can be used is :"+(mm+fm+tm)+"MB"+"<br>");
%>
二,访问本机(192.168.200.111:8080/meminfo.jsp)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
另一种方法
一,使用jps命令进行监控
 jps -lvm
-------------------------------------------------- -------------------------------------------------- -------------------------------------------------- -----------------------------------
There is another method
TOMcat remote monitoring function
One , modify the configuration file, open Remote monitoring
 vim /usr/local/tomcat8/bin/catalina.sh
#!/bin/sh
CATALINA_OPTS="$CATALINA_OPTS
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=12345
-Dcom.sun .management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=192.168.200.115"
Second, close the restart script
 /usr/local/tomcat8/bin/shutdown.sh
 /usr/local/tomcat8/bin/startup.sh
Third, check the port
 netstat -lnpt | grep 12345
Fourth, you need to install the jdk environment on windows to monitor This linux server
download address: http://www.orade.com/technetwork/java/javase/downloads/index.html
Fifth, find on the windows machine -- Progrom Files/java/jdk1.8.../bin/
 in the c drive, find jconsole.exe in bin and
 then you can establish a connection
 
 
 
 
 
 
 
 
 
 

Reprinted in: https://www.cnblogs.com/123456likun/p/11563699.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326449249&siteId=291194637