Zabbix monitoring Tomcat
First, Environment
Two servers, one is zabbix_java_server , the other tomcat-server
Files needed:Catalina-jmx-remote.jar Cmdline-jmxclient-0.10.3.jar
Second, tomcat-server controlled end configuration
# Cd/usr/java/apache-tomcat-8.0.30/bin
# vim catalina.sh
Add the following content:
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/79/C8/wKioL1aakxXhBYXlAABX-n5JZLQ098.png "title=" 1.png " alt= "Wkiol1aakxxhbyxlaabx-n5jzlq098.png"/>
catalina_opts= "-dcom.sun.management.jmxremote -dcom.sun.management.jmxremote.authenticate=false -dcom.sun.management.jmxremote.port= 12345 -dcom.sun.management.jmxremote.ssh=false -djava.rmi.server.hostname= Tomcat-server IP"
Note:1. Tomcat-server IP is the client ( the controlled side ) IP address that must be written outside the network IP is not localhost and 127.0.0.1.
2. put the configuration information at the beginning of the file, position, can not be placed in the end, there will be no port open.
3.12345 is the default port, no special requirements as far as possible do not change, such as modify the service side also synchronized modification.
Restart Tomcat
# sh /usr/java/apache-tomcat-8.0.30/bin/shutdown.sh
# SH /usr/java/apache-tomcat-8.0.30/bin/startup.sh
# Netstat-an | grep 12345
The following information is displayed as success.
TCP 0 0 0.0.0.0:12345 0.0.0.0:* LISTEN
Tested at the end of the control. The command is as follows:
# java-jar/usr/java/cmdline-jmxclient-0.10.3.jar-localhost:12345 Java.lang:type=memory NonHeapMemoryUsage
The display was successful.
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/79/C9/wKiom1aaku-Qm7JMAAAttc1Ovs0999.png "title=" 2.png " alt= "Wkiom1aaku-qm7jmaaattc1ovs0999.png"/>
Third, server-side installation
1. Install JDK (JAR) is installed Skip
# RPM-IVH jdk-8u20-linux-x64.rpm ///install JDK (JRE)
# Vi/etc/profile /// Edit text Add the following three line environment variables
Export JAVA_HOME=/USR/JAVA/JDK1.8.0_20
Export path= $PATH: $JAVA _home
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
# Source/etc/profile // Refresh Cache
# java-version /// view version, the installation is successful.
2. compiling zabbix_java
Find the Zabbix directory under Sbin to see if there is a zabbix_java directory, if there is a skip
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/79/C9/wKiom1aakv7RfJUzAABt6s_76Y0386.png "title=" 3.png " alt= "Wkiom1aakv7rfjuzaabt6s_76y0386.png"/>
# cd/usr/local/zabbix-2.0.6
#./configure--enable-java-prefix=/usr/local/zabbix/sbin/zabbix_java
# Make&&make Install
3. Edit the file
# vi/usr/local/zabbix/sbin/zabbix_java/settings.sh
listen_ip= "0.0.0.0"
listen_port=10052
Start_pollers=5
# vi/usr/local/zabbix/etc/zabbix_server.conf
javagateway=127.0.0.1
javagatewayport=10052
Startjavapollers=5
4. start zabbix_java.
# SH/ usr/local/zabbix/sbin/zabbix_java/startup.sh
# Netstat-an | grep 10052 ///Check that the port is open
The following information is displayed as success.
TCP 0 0 0.0.0.0:10052 0.0.0.0:* LISTEN
Four, Zabbix Graphical Interface configuration
Host add JMX interface
Go backstage,configuration->hosts-> Select your host ->JMX interface Click Add , enter the corresponding tomcat IP address and the jmx port, such as:
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/79/C9/wKiom1aakw6hxwJkAAAoOd-oR9o070.png "title=" 4.png " alt= "Wkiom1aakw6hxwjkaaaood-or9o070.png"/>
Link TOMCAT Template
Switch to the templates tab and select the tomcat/jmx template that comes with Zabbix , as follows
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/79/C8/wKioL1aak1WymIydAAB3s-imzVk511.png "title=" 5.png " alt= "Wkiol1aak1wymiydaab3s-imzvk511.png"/>
Four, End
Reference article:
http://www.huilog.com/?p=688//Gave me a reminder that I was able to solve the problem when I got stuck.
Http://bbs.chinaunix.net/thread-4152652-1-1.html
This article is from the "Enlightened Grocery store" blog, please be sure to keep this source http://wutou.blog.51cto.com/615096/1735737
Zabbix Monitoring Tomcat