監控zabbix使用jmx監控tomcat

來源:互聯網
上載者:User

標籤:監控zabbix使用jmx監控tomcat

1.在zabix服務端安裝java工具(伺服器已安裝zabbix)

[[email protected] ~]# rpm -ivh
http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-java-gateway-2.4.7-1.el6.x86_64.rpm

[[email protected] ~]# vim /etc/zabbix/zabbix_server.conf
JavaGateway=127.0.0.1
JavaGatewayPort=10055
StartJavaPollers=5

[[email protected] ~]# vim /etc/zabbix/zabbix_java_gateway.conf

LISTEN_IP="0.0.0.0"
LISTEN_PORT=10055
START_POLLERS=5

[[email protected] ~]# /etc/init.d/zabbix-server restart
Shutting down Zabbix server:          [  OK  ]
Starting Zabbix server:                     [  OK  ]
[[email protected] ~]# /etc/init.d/zabbix-java-gateway restart
Shutting down zabbix java gateway:      [  OK  ]
Starting zabbix java gateway:                 [  OK  ]

[[email protected] ~]# netstat -antulp | grep 10055
tcp        0      0 :::10055                    :::*                        LISTEN      15958/java          
[[email protected] ~]#


2.在tomcat端添加一個連接埠,供zabbix擷取資料

jmxcmd:

https://sourceforge.net/projects/jmxcmd/files/latest/download?source=typ_redirect

[[email protected] ~]# vim /usr/local/tomcat-7.0.67/bin/catalina.sh     --添加以下行,擷取tomcat伺服器的IP地址
CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=本機IP地址"

[[email protected] ~]# vim /usr/local/tomcat-7.0.67Html/conf/server.xml      --暴露一個連接埠給zabbix擷取資料
  <Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"  rmiRegistryPortPlatform="9999" rmiServerPortPlatform="9999"/>
[[email protected] ~]# /usr/local/tomcat-7.0.67/bin/shutdown.sh      --關閉tomcat服務
[[email protected] ~]# /usr/local/tomcat-7.0.67/bin/startup.sh          --啟動tomcat服務

[[email protected] ~]# netstat -antulp | grep 9999
tcp        0      0 :::9999            :::*                 LISTEN      12469/java              
[[email protected] ~]# 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
[[email protected] ~]#


3.在zabbix中添加分類,項目,鍵

(1).啟用jmx模組

650) this.width=650;" src="http://s1.51cto.com/wyfs02/M02/7F/75/wKiom1cfJgSCSHdEAACA7AzeKks185.png" title="1.png" alt="wKiom1cfJgSCSHdEAACA7AzeKks185.png" />

(2).建立分類

650) this.width=650;" src="http://s4.51cto.com/wyfs02/M00/7F/75/wKiom1cfJjGSl_CoAABlmiGbCLY160.png" title="2.png" alt="wKiom1cfJjGSl_CoAABlmiGbCLY160.png" />




本文出自 “一起走過的日子” 部落格,請務必保留此出處http://tongcheng.blog.51cto.com/6214144/1767930

監控zabbix使用jmx監控tomcat

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.