Zabbix using JMX to monitor Tomcat performance

Source: Internet
Author: User

Test environment: centos6.4 x64


First, Zabbbix server configuration


1, Zabbix Server installation needs to add--enable-java

2, Zabbix Server installation JDK

3, find Zabbix_java, modify the following:

vi/usr/local/zabbix/zabbix_java_gateway/sbin/zabbix_java/settings.sh

listen_ip= "0.0.0.0"

listen_port=10052

Start_pollers=5


4. Add the following files in Zabbix_server

Vi/usr/local/zabbix/etc/zabbix_server.conf

javagateway=127.0.0.1

javagatewayport=10052

Startjavapollers=5


5. Start Javagateway

cd/usr/local/zabbix/zabbix_java_gateway/sbin/zabbix_java/

./startup.sh

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/78/53/wKiom1Z6S8PiZtTnAAAmCIi9sL0596.png "title=" 001. PNG "alt=" Wkiom1z6s8pizttnaaamcii9sl0596.png "/>


II. Tomcat Client Configuration

1. Download the JMX Remote jar binary package in the Tomcat download page Extras category. Placed under the/lib directory of the Tomcat project.

#wget –http://mirror.bit.edu.cn/apache/tomcat/tomcat-6/v6.0.39/bin/extras/catalina-jmx-remote.jar

# MV Catalina-jmx-remote.jar to/tomcat project/lib/directory


2. Modify the Conf/server.xml file to add the following:(This step has been tested, can not write)

<listener classname= "Org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiregistryportplatform= "12345" rmiserverportplatform= "12346"/>

-----The port here is consistent with the ZABBIX server-defined monitoring JMX port


3. Modify the Tomcat/bin directory under catalina.sh

Find the #-----Execute the requested Command-----------------------------------------

Add the following content:

Catalina_opts= "-dcom.sun.management.jmxremote-dcom.sun.management.jmxremote.authenticate=false- Dcom.sun.management.jmxremote.ssl=false-djava.rmi.server.hostname= Client IP Address "


4. Start Tomcat

# cd/usr/local/tomcat/bin/

#./startup.sh


5. Download the Cmdline-jmxclient-0.10.3.jar file to test if you can get the data

#wget Http://repo.typesafe.com/typesafe/repo/cmdline-jmxclient/cmdline-jmxclient/0.10.3/cmdline-jmxclient-0.10.3.jar


6. Test data is successful (thefull path of the package is added before Cmdline-jmxclient-0.10.3.jar, otherwise the package cannot be found)

# java-jar/data/packages/cmdline-jmxclient-0.10.3.jar-localhost:12345 java.lang:type=memory Nonheapmemoryusage

If the connection is correct, the output is as follows (reference value):

01/26/2014 11:55:55 +0800 org.archive.jmx.Client nonheapmemoryusage:

committed:52690944

init:24313856

max:136314880

used:52454776


Three, Zabbix template configuration

Zabbix's own tomcat template is really bad, find a big god sharing template online

Templates in attachments, such as cannot download please leave an email address.


1. Import Template Zbx_export_templates.xml


2. After successful import, you can see the template Custometomcat

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/78/52/wKioL1Z6TCrQp229AABl30WNRlg982.jpg "title=" 002. JPG "alt=" wkiol1z6tcrqp229aabl30wnrlg982.jpg "/>


3. When the association template is complete, it is visible:

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/78/53/wKiom1Z6TCzRqC6QAADG9cIBoIw914.jpg "title=" 003. JPG "alt=" wkiom1z6tczrqc6qaadg9ciboiw914.jpg "/>


4. To get tomcat use a memory template for example

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/78/53/wKiom1Z6TDvCw_jRAAHH4asCznk118.jpg "title=" 004. JPG "alt=" wkiom1z6tdvcw_jraahh4ascznk118.jpg "/>

5. Add a template, set JMXIP address and port

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/78/52/wKioL1Z6TF-T2FCbAACkf1bUkP8043.jpg "title=" 005. JPG "alt=" wkiol1z6tf-t2fcbaackf1bukp8043.jpg "/>

6. When successful, the JMX icon turns green, indicating the available

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/78/53/wKiom1Z6TGix73QlAADwG9jYyBg785.jpg "title=" 006. JPG "alt=" wkiom1z6tgix73qlaadwg9jyybg785.jpg "/>

7. The figure is as follows:

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/78/53/wKiom1Z6THzQBElpAAMyMSdVeFY770.jpg "title=" 007. JPG "alt=" wkiom1z6thzqbelpaamymsdvefy770.jpg "/>

This article is from the "Small Five Car God" blog, please be sure to keep this source http://linuxtech.blog.51cto.com/3670088/1727573

Zabbix using JMX to monitor Tomcat performance

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.