Monitoring Zabbix using JMX to monitor Tomcat
1. Install the java tool on the zabix server (zabbix has been installed on the server)
[Root @ db02 ~] # Rpm-ivh
Http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-java-gateway-2.4.7-1.el6.x86_64.rpm
[Root @ db02 ~] # Vim/etc/zabbix/zabbix_server.conf
JavaGateway = 127.0.0.1
JavaGatewayPort = 10055
Startjavapolers = 5
[Root @ db02 ~] # Vim/etc/zabbix/zabbix_java_gateway.conf
LISTEN_IP = "0.0.0.0"
Listen_port= 10055
START_POLLERS = 5
[Root @ db02 ~] #/Etc/init. d/zabbix-server restart
Shutting down Zabbix server: [OK]
Starting Zabbix server: [OK]
[Root @ db02 ~] #/Etc/init. d/zabbix-java-gateway restart
Shutting down zabbix java gateway: [OK]
Starting zabbix java gateway: [OK]
[Root @ db02 ~] # Netstat-antulp | grep 10055
Tcp 0 0: 10055: * LISTEN 15958/java
[Root @ db02 ~] #
2. Add a port to tomcat for zabbix to obtain data.
Jmxcmd:
Https://sourceforge.net/projects/jmxcmd/files/latest/download? Source = typ_redirect
[Root @ web02 ~] # Vim/usr/local/tomcat-7.0.67/bin/catalina. sh -- Add the following lines to obtain the IP address of the tomcat server.
CATALINA_OPTS = "-Dcom. sun. management. jmxremote-Dcom. sun. management. jmxremote. authenticate = false-Dcom. sun. management. jmxremote. ssl = false-Djava. rmi. server. hostname = Local IP Address"
[Root @ web02 ~] # Vim/usr/local/tomcat-7.0.67Html/conf/server. xml -- expose a port to zabbix to get data
<Listener className = "org. apache. catalina. mbeans. JmxRemoteLifecycleListener" rmiRegistryPortPlatform = "9999" rmiServerPortPlatform = "9999"/>
[Root @ web02 ~] #/Usr/local/tomcat-7.0.67/bin/shutdown. sh -- disable the tomcat Service
[Root @ web02 ~] #/Usr/local/tomcat-7.0.67/bin/startup. sh -- start the tomcat Service
[Root @ web02 ~] # Netstat-antulp | grep 9999
Tcp 0 0: 9999: * LISTEN 12469/java
[Root @ web02 ~] # Java-jar jmxcmd. jar-localhost: 9999 java. lang: type = Memory NonHeapMemoryUsage
04/26/2016 16:21:38 + 0800 de. layereight. jmxcmd. Client NonHeapMemoryUsage:
Committed: 136183808
Init: 134676480
Max: 318767104
Used: 36691992
[Root @ web02 ~] #
3. Add category, project, and key in zabbix
(1) Enable the jmx Module
(2). Create a category
Some Zabbix Tutorials:
Compile and install Zabbix2.4.5 source code in Ubuntu 14.04
Install and deploy the distributed monitoring system Zabbix 2.06
Install and deploy the distributed monitoring system Zabbix 2.06
Install and deploy Zabbix in CentOS 6.3
Zabbix distributed monitoring system practice
Under CentOS 6.3, Zabbix monitors apache server-status
Monitoring MySQL database Parameters Using Zabbix in CentOS 6.3
Install Zabbix 2.0.6 in 64-bit CentOS 6.2
ZABBIX details: click here
ZABBIX: click here
This article permanently updates the link address: