zabbix- tomcat using JMX monitoring

1. Install tomcat and jdk

Tomcat and jdk installed on server2 (agent client) and open the tomcat:

rpm -ivh jdk-8u121-linux-x64.rpm 
tar zxf apache-tomcat-8.5.24.tar.gz -C /usr/local/
cd /usr/local/
ln -s apache-tomcat-8.5.24 tomcat
vim /usr/local/tomcat/bin/catalina.sh	#向tomcat中添加JMX的参数 

CATALINA_OPTS='-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=8888	#监听端口号,方便远程访问
-Dcom.sun.management.jmxremote.ssl=false	#是否对连接开启SSL加密,默认开启
-Dcom.sun.management.jmxremote.authenticate=false'	#是否需要开启用户认证,默认开启

Here Insert Picture DescriptionHere Insert Picture DescriptionHere Insert Picture DescriptionSupplementary: JMX stands for Java Management Extensions, provides management extensions for Java applications

cd tomcat/
cd bin/
./startup.sh	#启动tomcat

2. Installation zabbix-java-gateway

server1 (server side) mounted zabbix-java-gateway, and configured accordingly:

yum install zabbix-java-gateway-4.4.1-1.el7.x86_64.rpm -y
systemctl start zabbix-java-gateway
netstat -antlp | grep 10052
vim /etc/zabbix/zabbix_server.conf 
288 JavaGateway=172.25.254.1
296 JavaGatewayPort=10052
304 StartJavaPollers=5
systemctl restart zabbix-server

Here Insert Picture DescriptionHere Insert Picture Description

3.zabbix monitoring interface accordingly provided

step1 configuration - host -server2
Here Insert Picture Description
step2 JMX interfaces - Update
Here Insert Picture Descriptionstep3 configuration - host - Templates - unlink and clean
Here Insert Picture Descriptionstep4 configuration - host - Templates - Add -Java JMX- update
Here Insert Picture Descriptionstep5 view server2 this time JMX icon is gray
Here Insert Picture Descriptionstep6

vim /etc/zabbix/zabbix_java_gateway.conf 

  9 LISTEN_IP="172.25.254.1"
 17 LISTEN_PORT=10052
 35 START_POLLERS=5

systemctl restart zabbix-java-gateway

Here Insert Picture Descriptionstep7 Refresh - Check to server2 this time JMX icon is green
Here Insert Picture Description

Published 250 original articles · won praise 2 · views 10000 +

Guess you like

Origin blog.csdn.net/yrx420909/article/details/104968694