Article From:https://www.cnblogs.com/Gnnnny/p/9239680.html

Deployment environment

CentOS     7.4
Zabbix     3.4
Tomcat     6.0.32

  

Server configuration

1、Install JDK

  The version should be confirmed above 1.7

  The following are the 7 and 8 versions of the JDK source package:

  7.0JDKSource code package

  8.0JDKSource code package

  And uploaded to ZABBIX server

Create installation directory, download and uninstall it to the directory.

# mkdir /usr/local/java/

# tar -zxvf jdk1.7.0_67.tar.gz -C /usr/local/java/

 

 The system environment variable after the installation is successful

# vim /etc/profile

export JAVA_HOME=/usr/local/java/jdk1.7.0_67
export JAVA_BIN=/usr/local/java/dk1.7.0_67/bin
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH

 

Make the configuration effective

# source /etc/profile

 

2、Install Zabbix-Java-gateway

Zabbix2.0A service process that supports JMX applications is added. It is called “Zabbix-Java-gateway”. It is a program written in Java.

Install gatway, need Java, Java-devel dependency

 

Install the yum source

# yum -y install http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

Install Gateway

# yum install -y  java  java-devel  zabbix-java-gateway

  

Whether the test was installed successfully

1)、Test whether Java is successful

# java -version

openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-b10)
OpenJDK 64-Bit Server VM (build 25.171-b10, mixed mode)

 2)、Test whether Gateway is successful

# status zabbix-java-gateway
● zabbix-java-gateway.service - Zabbix Java Gateway
   Loaded: loaded (/usr/lib/systemd/system/zabbix-java-gateway.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

 

3、Modify the Java-gateway configuration file and start it

Edit /etc/zabbix/zabbix_java_gateway.conf, modify the contents as follows

# Listener address
LISTEN_IP=”0.0.0.0″
# Monitor port
LISTEN_PORT=10052
# PID_FILEfile
PID_FILE=”/var/run/zabbix/zabbix_java.pid”
# Open number of working threads
START_POLLERS=5

Start zabbix-java-gateway

# systemctl start zabbix-java-gateway 

  

4、Modify the zabbix_server configuration file and restart

Edit /etc/zabbix/zabbix_java_gateway.conf, modify the contents as follows

# JavaGatewayThe IP address of the server
JavaGateway=192.168.89.204
# JavaGatewayService port
JavaGatewayPort=10052
# The process of collecting data from javaGateway
StartJavaPollers=5

Restart zabbix-server

# systemctl status zabbix-server

After the above steps are completed, the server side has been fully configured. It

 

Client configuration

1、Adding JXM parameters in Tomcat

Edit the catalina.sh in the bin directory of the Tomcat service that needs to be monitored.

Add the following parameters to the CATALINA_OPTS variable:

-Djava.rmi.server.hostname=Local IP address-Djavax.management.builder.initial=-Dcom.sun.management.jmxremote=true-Dcom.sun.managEment.jmxremote.port=12345-Dcom.sun.management.jmxremote.ssl=false-Dcom.sun.management.jmxremoTe.authenticate=false

  

zabbixPage setting

 1、Import templates to ZABBIX

Configuration(Configure) –> Hosts (host) –> Templates (template)

Template App Apache Tomcat JMX

Template App Generic Java JMX

 

Add the JMX port after importing the template

 

The final difference is whether there is a figure

 

Similar Posts:

One Reply to “CentOS7, zabbix3.4 passes, zabbix-Java-gateway monitors Tomcat.”

  1. Hi,

    thx for great post.

    I notice an error under point 4:
    the file shall be “/etc/zabbix/zabbix_server.conf” not “/etc/zabbix/zabbix_java_gateway.conf”.

Leave a Reply

Your email address will not be published. Required fields are marked *