zabbix监控tomcat
2017-07-31 本文已影响52人
WFF_FFW
环境介绍
zabbix server :192.168.1.127
zabbix agentd: 192.168.1.180
tomcat 版本:7.0.69
一:tomcat安装
1.jdk安装参考地址:http://www.jianshu.com/p/f5b3cf91304c
2.tomcat安装
wget http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.69/bin/apache-tomcat-7.0.69.tar.gz
tar -zxf apache-tomcat-7.0.69.tar.gz -C /opt/
/opt/apache-tomcat-7.0.69/bin/startup.sh
Netstat -ntpl
Service iptables stop
http://192.168.1.180:8080
tomcat
二:zabbix监控tomcat配置
1.vim /usr/local/zabbix/sbin/zabbix_java/settings.sh
修改配置文件
修改四项
LISTEN_IP="0.0.0.0"
LISTEN_PORT=10052
PID_FILE="/tmp/zabbix_java.pid"
TART_POLLERS=5
2.vim /usr/local/zabbix/etc/zabbix_server.conf 在此修改以下三处
修改zabbix_server端配置文件
3.重启zabbix server 服务
/etc/init.d/zabbix_server restart
4.启动zabbix_java
/usr/local/zabbix/sbin/zabbix_java/startup.sh
查看端口
5.调整tomcat端,安装catalina-jmx-remote.jar
wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-7/v7.0.79/bin/extras/catalina-jmx-remote.jar
mv catalina-jmx-remote.jar /opt/apache-tomcat-7.0.69/lib/
6.修改catalina.sh文件
vim /opt/apache-tomcat-7.0.69/bin/catalina.sh
CATALINA_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=12345 -Djava.rmi.server.hostname=192.168.1.180"
7.重启tomcat服务
/opt/apache-tomcat-7.0.69/bin/shutdown.sh
/opt/apache-tomcat-7.0.69/bin/startup.sh
- zabbix_server端获取数据
cmdline-jmxclient-0.10.3.jar下载地址:http://note.youdao.com/noteshare?id=a08ad44ec5c35cfa1eb19ec104ca5e16&sub=ED3EBD1685B0492387FACC6EB1DC9419
mv cmdline-jmxclient-0.10.3.jar /usr/local/zabbix/sbin/zabbix_java/bin/
java -jar /usr/local/zabbix/sbin/zabbix_java/bin/cmdline-jmxclient-0.10.3.jar - 192.168.1.180:12345 java.lang:type=Memory NonHeapMemoryUsage
1.127-1.180
zabbix_server Web端配置
1)配置-》主机-》192.168.1.180-》主机-》jmx接口-》192.168.1.180->12345-》更新
tomcat_zabbix接口
2)配置-》主机-》192.168.1.180-》模板-》添加Template JMX Generic和Template JMX Tomcat模板-》更新
模板添加
正常