centos7,zabbix3.4 through, Zabbix-java-gateway Monitor Tomcat

Source: Internet
Author: User
Tags apache tomcat

Deployment environment
CentOS     7.4Zabbix     3.4Tomcat     6.0.32

  

Server configuration 1, installing the JDK

Version to be confirmed at more than 1.7

The following are the 7.0 and 8.0 versions of the JDK source packages:

7.0JDK Source Package

8.0JDK Source Package

and upload it to Zabbix server.

Create the installation directory, download and unzip the installation to this directory

# mkdir/usr/local/java/# TAR-ZXVF jdk1.7.0_67.tar.gz-c/usr/local/java/

After the installation is successful, mention the system environment variable

# Vim/etc/profileexport Java_home=/usr/local/java/jdk1.7.0_67export Java_bin=/usr/local/java/dk1.7.0_67/binexport Path= $PATH: $JAVA _home/binexport classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jarexport java_home JAVA_ BIN PATH CLASSPATH

Make configuration effective

# Source/etc/profile

 

2, Installation Zabbix-java-gateway

Zabbix2.0 has added a service process that supports the monitoring of JMX applications, called "Zabbix-java-gateway", which is a program written in Java.

Installation of Gatway requires Java,java-devel dependency

Installing 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

Installing the Gateway

# yum Install-y  java  java-devel  Zabbix-java-gateway

  

Test whether the installation was successful

1), test whether Java is successful

# java-"1.8.0_171"1.8. 0_171-  25.171-B10, Mixed mode)

2), test whether the 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 content as follows

# Listening Address
Listen_ip= "0.0.0.0″
# Listening Port
listen_port=10052
# pid_file File
Pid_file= "/var/run/zabbix/zabbix_java.pid"
# Number of worker threads opened
Start_pollers=5

Start Zabbix-java-gateway

  

4. Modify the Zabbix_server configuration file and restart

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

# Javagateway Server IP Address
javagateway=192.168.89.204
# Service port for Javagateway
javagatewayport=10052
# Number of processes that collect data from Javagateway
Startjavapollers=5

Restart Zabbix-server

# SYSTEMCTL Status Zabbix-server

After the above steps are complete, the server side is fully configured.

Client Configuration 1, adding the JXM parameter 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

  

Zabbix Page Setup 1, import template to Zabbix

Configuration (config)--hosts--Templates (templates)

Template App Apache Tomcat JMX

Template App Generic Java JMX

Add a JMX port after importing a template

To see if there is a graph at the end

centos7,zabbix3.4 through, Zabbix-java-gateway Monitor Tomcat

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.