Configuration of the Zabbix-server end
Note When compiling and installing Zabbix-server, take the parameter--enable-java.
Note that since you are compiling Zabbix-java-gateway, your Zabbix server must have a Java environment.
How do I install the JDK environment? Please read this article: http://duanyexuanmu.blog.51cto.com/1010786/1751156
./configure--enable-server--enable-agent--with-mysql--enable-ipv6--with-net-snmp--with-libcurl--with-ssh2--ena Ble-java
Modify the Java settings.sh parameter,
listen_ip= "0.0.0.0"
listen_port=10052
Start_pollers=5
# this is a configuration file for zabbix java gateway.# it is sourced by startup.sh and shutdown.sh scripts.### Option: zabbix.listenip#ip address to listen on.## mandatory: no# default: listen_ip= "0.0.0.0" ### option: zabbix.listenport#port to listen on.## mandatory: no# Range: 1024-32767# Default: LISTEN_PORT=10052### Option: Zabbix.pidfile#name of pid file. #If omitted, zabbix java gateway is started as a console application.## mandatory: no# default:# pid _file=pid_file= "/tmp/zabbix_java.pid" ### option: zabbix.startpollers#number of worker threads to start.## mandatory: no# range: 1-1000# default: start _pollers=5### option: zabbix. timeout#how long to wait for network operations.## mandatory: no# range: 1-30# default:# timeout=3
Modify Zabbix_server.conf
logfile=/tmp/zabbix_server.logdbname=zabbixdbuser=zabbixdbpassword=zabbixjavagateway=127.0.0.1javagatewayport= 10052startjavapollers=5
After you've modified it, save and start Java.
./startup.sh
To view a process:
[Email protected] src]# NETSTAT-TLUNP
Active Internet connections (only servers)
Proto recv-q send-q Local address Foreign address State Pid/program Name
TCP 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1080/sshd
TCP 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 1386/zabbix_agentd
TCP 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 1737/zabbix_server
TCP 0 0::: $:::* LISTEN 1080/sshd
TCP 0 0::: 10050:::* LISTEN 1386/zabbix_agentd
TCP 0 0::: 10051:::* LISTEN 1737/zabbix_server
TCP 0 0::: 10052:::* LISTEN 1994/java
TCP 0 0::: 3306:::* LISTEN 1329/mysqld
TCP 0 0::: +:::* LISTEN 1376/httpd
From the above we see that the Zabbix_agent,zabbix_server has been opened, Java is also open, the port is 10052
========================================================================================
Tomcat side Configuration
1. First configure the Tomcat environment, refer to here, note the control side and the server side of the JDK version to be consistent
http://duanyexuanmu.blog.51cto.com/1010786/1755443
http://duanyexuanmu.blog.51cto.com/1010786/1751156
2. Download the Catalina-jmx-remote.jar and copy it to
Under the/usr/local/tomcat/lib/directory
3. Modify Tomcat's catalina.sh file
Catalina_opts= "-dcom.sun.management.jmxremote-dcom.sun.management.jmxremote.authenticate=false- dcom.sun.management.jmxremote.ssl=false-djava.rmi.server.hostname=192.168.1.224 "
Note, do not according to the internet, the Ssh=false also added.
Which, 192.168.1.224 for the PCIP address of Tomcat, according to your own environment to change the line, you are what IP to fill what IP
4. Modify Server.xml
[Email protected] lib]# Locate Server.xml
/usr/local/tomcat/conf/server.xml
The following options are added:
<listener classname= "Org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiregistryportplatform= "12345" rmiserverportplatform= "12345"/>
Restart Tomcat
====================================================================
Back to Zabbix server:
Testing with tools on the Zabbix server side
Download Cmdline-jmxclient-0.10.3.jar Tools
java-jar/usr/local/src/cmdline-jmxclient-0.10.3.jar-192.168.1.224:12345 java.lang:type=memory NonHeapMemoryUsage
11/12/2014 15:39:30 +0800 org.archive.jmx.Client nonheapmemoryusage:
committed:552665088
init:539426816
max:587202560
used:75002232
Displays the data, finally adds the host in the Zabbix, fills in the template to be OK.
This article is from the "clear" blog, make sure to keep this source http://duanyexuanmu.blog.51cto.com/1010786/1758027
Zabbix 3.0 using JMX to monitor Tomcat