Zabbix monitoring Tomcat
Client-side operation (monitored)
1. Configuring Tomcat JMX
[Email protected] media]# cd/usr/local/tomcat7/bin/
[email protected] bin]# VI catalina.sh #添加以下几行
java_home=/usr/local/java/
98 java_bin= $JAVA _home/bin
Path= $PATH: $JAVA _bin
Classpath= $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
101 Export java_home Java_bin PATH CLASSPATH
102 catalina_opts= "-server-xms256m-xmx512m-xx:permsize=64m -xx:maxpermsize=128m
-dcom.sun.management.jmxremote -dcom.sun.management.jmxremote.authenticate=false -dcom.sun.management.jmxremote.ssl=false -dcom.sun.management.jmxremote.port=12345 "
2. start Tomcatto see if the boot was successful
[Email protected] bin]#/usr/local/tomcat7/bin/startup.sh
Using catalina_base:/USR/LOCAL/TOMCAT7
Using Catalina_home:/USR/LOCAL/TOMCAT7
Using Catalina_tmpdir:/usr/local/tomcat7/temp
Using Jre_home:/usr/local/java/
Using CLASSPATH:/usr/local/tomcat7/bin/bootstrap.jar:/usr/local/tomcat7/bin/tomcat-juli.jar
Tomcat started.
[Email protected] bin]# Netstat-antup | grep 12345
TCP 0 0::: 12345:::* LISTEN 113658/java
Server operation (monitor side)
1.Java support
Compile and install Zabbix Server needs to add --enable-java to support JMX monitoring .
2. Modify the settings.sh file
[Email protected] ~]# cd/usr/local/zabbix-3.0.3/sbin/zabbix_java/
[Email protected] zabbix_java]# VI settings.sh
9 listen_ip= "127.0.0.1"
listen_port=10052
Start_pollers=5
3. Modify the Zabbixserver configuration file to enable support for Javagateway
[Email protected] zabbix_java]# cd/usr/local/zabbix-3.0.3/etc/
[Email protected] etc]# VI zabbix_server.conf #最末行添加以下3行
javagateway=127.0.0.1
javagatewayport=10052
Startjavapollers=5
4. start Javagateway
[Email protected] etc]#/usr/local/zabbix-3.0.3/sbin/zabbix_java/startup.sh
10052
[Email protected] etc]# Netstat-antup | grep 10052
TCP 0 0:: ffff:127.0.0.1:10052:::* LISTEN 1944/java
5. Import a template
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/82/CA/wKiom1dg_G7xEAV3AACD5bgWT_c332.jpg-wh_500x0-wm_3 -wmp_4-s_1421930189.jpg "style=" WIDTH:700PX;HEIGHT:169PX; "title=" 1.jpg "alt=" Wkiom1dg_g7xeav3aacd5bgwt_ C332.jpg-wh_50 "width=" "height=" 169 "border=" 0 "hspace=" 0 "vspace=" 0 "/>
650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/82/CA/wKiom1dg_HCwVPPBAAA0YW352TQ981.jpg-wh_500x0-wm_3 -wmp_4-s_3141493787.jpg "style=" width:700px;height:153px; "title=" 2.jpg "alt=" Wkiom1dg_ Hcwvppbaaa0yw352tq981.jpg-wh_50 "width=" "height=" 153 "border=" 0 "hspace=" 0 "vspace=" 0 "/>
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/82/C8/wKioL1dg_YjgiPWkAAHLAMAnfho160.jpg-wh_500x0-wm_3 -wmp_4-s_4278747218.jpg "style=" width:700px;height:323px; "title=" 3.jpg "alt=" Wkiol1dg_ Yjgipwkaahlamanfho160.jpg-wh_50 "width=" "height=" 323 "border=" 0 "hspace=" 0 "vspace=" 0 "/>
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M02/82/C8/wKioL1dg_Yry1s2uAACD_WF-KAA226.jpg-wh_500x0-wm_3 -wmp_4-s_3202360479.jpg "style=" WIDTH:700PX;HEIGHT:519PX; "title=" 4.jpg "alt=" Wkiol1dg_yry1s2uaacd_ Wf-kaa226.jpg-wh_50 "width=" "height=" 519 "border=" 0 "hspace=" 0 "vspace=" 0 "/>
6. calling the template
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/82/C8/wKioL1dg_gTQtnVnAAD0NdVoMO0464.jpg-wh_500x0-wm_3 -wmp_4-s_1293299045.jpg "style=" WIDTH:700PX;HEIGHT:556PX; "title=" 1.jpg "alt=" Wkiol1dg_ Gtqtnvnaad0ndvomo0464.jpg-wh_50 "width=" "height=" 556 "border=" 0 "hspace=" 0 "vspace=" 0 "/>
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/82/CA/wKiom1dg_PWTVmVaAACCHCCnZFQ939.jpg-wh_500x0-wm_3 -wmp_4-s_1460103546.jpg "style=" width:700px;height:398px; "title=" 2.jpg "alt=" Wkiom1dg_ Pwtvmvaaacchccnzfq939.jpg-wh_50 "width=" "height=" 398 "border=" 0 "hspace=" 0 "vspace=" 0 "/>
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/82/C8/wKioL1dg_g6yh0sAAAEHccyOM2Q612.jpg-wh_500x0-wm_3 -wmp_4-s_3503531199.jpg "style=" width:700px;height:245px; "title=" 3.jpg "alt=" Wkiol1dg_ G6yh0saaaehccyom2q612.jpg-wh_50 "width=" "height=" 245 "border=" 0 "hspace=" 0 "vspace=" 0 "/>
Ps : If an error occurs, modify the hostname IP to native IP
This article is from "Dream Chaser" blog, please make sure to keep this source http://dreamchaser.blog.51cto.com/7756851/1789501
Zabbix Monitoring Tomcat