[Monitor] zabbix zabbix tomcat monitoring service

Server configuration (zabbix_server)

1. Install jdk

  Version 1.7 requires more than 1.8 installed on my side, you can refer to my jdk installation article

# Upload zabbix_server server. Installation (JDK-8u171-Linux-x64.rpm) 
[the root @ VM_0_10_centos the src] # RPM -ivh JDK-8u171-Linux-x64.rpm

  Configuration files are as follows:

[root@VM_0_10_centos src]# vi /etc/profile
JAVA_HOME=/usr/java/jdk1.8.0_171-amd64
JAVA_BIN=/usr/java/jdk1.8.0_171-amd64/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME JAVA_BIN CLASSPATH PATH

2, install Zabbix-Java-gateway

  Zabbix2.0 since added service process support for JMX monitoring application, called "Zabbix-Java-gateway", it is written in a java program. Installation gatway, requires Java, Java-devel-dependent

  Yum install Source:

# I use is zabbix 3.4.4 
[root @ VM_0_10_centos src] # yum -y install http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarc 
h.rpm

# 安装Gateway:3.4.15
[root@VM_0_10_centos src]#  yum install -y  java  java-devel  zabbix-java-gateway

# View version 
[root @ VM_0_10_centos src] # the Java -version 
the Java Version " 1.8.0_171 " 
the Java (TM) SE Runtime Environment (Build 1.8.0_171- B11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

3, modify the Java-gateway configuration file and start it

# Edit the configuration file 
[root @ VM_0_10_centos src] # CAT /etc/zabbix/zabbix_java_gateway.conf | grep -v "^ #" | grep -v "^ $" 
LISTEN_IP = " 0.0.0.0 "     # listen address 
LISTEN_PORT = 10052     # listen port 
pid_file the = " /var/run/zabbix/zabbix_java.pid " 
START_POLLERS = 5   #   number of worker threads open
TIMEOUT=3

# Start the service 
[root @ VM_0_10_centos sbin] # / usr / sbin / zabbix_java_gateway 
[root @ VM_0_10_centos sbin] # PS -ef | grep zabbix_java_gateway

4, modify the configuration file and restart zabbix_server

# Edit zabbix_server configuration file 
[root @ VM_0_10_centos sbin] # CAT /usr/local/etc/zabbix_server.conf | grep -v "^ $" | grep -v "^ #" | grep the Java 
JavaGateway = 106.53.73.200   # JavaGateway of server IP address (server address) 
JavaGatewayPort = 10052 
StartJavaPollers =. 5

# Restart the server service 
[root @ VM_0_10_centos sbin] # killall zabbix_server 
[root @ VM_0_10_centos sbin] SS -tulp | grep zabbix_server

Client configuration (zabbix_agentd)

# Installed tomcat, I am here tomcat9 
[root @ VM_0_10_centos src] # tar -zxvf the Apache-Tomcat-9.0.29.tar.gz -C / usr / local / 
[root @ VM_0_10_centos local] # mv the Apache-Tomcat-9.0 .29 / tomcat9.0.29

1, add a parameter tomcat in JXM

# Edit catalina.sh need to be monitored under the bin directory tomcat service 
# Add the following parameters to CATALINA_OPTS variable: 
[root @ VM_0_10_centos tomcat9.0.29] # vi /usr/local/tomcat9.0.29/bin/catalina.sh 
= CATALINA_OPTS " $ CATALINA_OPTS \
-Djavax.management.builder.initial= \
-Dcom.sun.management.jmxremote=true \
-Dcom.sun.management.jmxremote.port=12345 \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-Djava.rmi.server.hostname = zabbix_agentd monitored host ip "

# Start Tomcat 
[root @ VM_0_10_centos tomcat9.0.29] # ./bin/startup.sh

 

zabbix Page Setup

 1, import the template to zabbix

Configuration (Configuration) -> Hosts (host) -> Templates (template)

Template App Apache Tomcat JMX

Template App Generic Java JMX

 

 Add Monitoring Templates

 

 Select Graphics View

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/HeiDi-BoKe/p/12018301.html