zabbix对tomcat的监控

一,配置tomcat

1,配置jdk

2,配置tomcat

Tomcat下载地址:http://tomcat.apache.org/

# tar -zxvf apache-tomcat-7.0.75-tar.gz

# cd apache-tomcat-7.0.75/bin

#  vim catalina.sh

添加:

CATALINA_HOME=/tomcat/apache-tomcat-7.0.75

# chmod +x startup.sh

 

启动tomcat

# /tomcat/apache-tomcat-7.0.75/bin/catalina.sh start

Using CATALINA_BASE:   /tomcat/apache-tomcat-7.0.75

Using CATALINA_HOME:   /tomcat/apache-tomcat-7.0.75

Using CATALINA_TMPDIR: /tomcat/apache-tomcat-7.0.75/temp

Using JRE_HOME:        /jdk/jdk1.7.0_79

Using CLASSPATH:       /tomcat/apache-tomcat-7.0.75/bin/bootstrap.jar:/tomcat/apache-tomcat-7.0.75/bin/tomcat-juli.jar

Tomcat started.

 

四.在浏览器中输入

http://localhost:8080/

出现tomcat的测试页面即说明成功

 

 

五,配置tomcat jmx

配置jmx

编辑catalina.sh,加入如下配置

[root@solr-01 bin]# vim catalina.sh

在第一行加入以下内容

#                   case the default is "true"

# -----------------------------------------------------------------------------

 

# OS specific support.  $var _must_ be set to either true or false.

JAVA_OPTS="-Xms512m -Xmx512m -XX:ParallelGCThreads=8 -XX:PermSize=128m -XX:MaxPermSize=256m"

export CATALINA_OPTS="$CATALINA_OPTS

-Dcom.sun.management.jmxremote

-Dcom.sun.management.jmxremote.port=12345

-Dcom.sun.management.jmxremote.ssl=false

-Dcom.sun.management.jmxremote.authenticate=false

-Djava.rmi.server.hostname=192.168.244.165"

 

重启tomcat

[root@solr-01 bin]# ./startup.sh

Using CATALINA_BASE:   /tomcat/apache-tomcat-7.0.75

Using CATALINA_HOME:   /tomcat/apache-tomcat-7.0.75

Using CATALINA_TMPDIR: /tomcat/apache-tomcat-7.0.75/temp

Using JRE_HOME:        /jdk/jdk1.7.0_79

Using

 CLASSPATH:       /tomcat/apache-tomcat-7.0.75/bin/bootstrap.jar:/tomcat/apache-tomcat-7.0.75/bin/tomcat-juli.jar

Tomcat started.

 

 

 

Zabbix server 配置

启动Zabbix_java

[root@zabbix zabbix-3.0.4]# cd /usr/local/zabbix/sbin/zabbix_java/

[root@zabbix zabbix_java]# ./startup.sh

配置文件配置

[root@zabbix ~]# vim /etc/zabbix/zabbix_java_gateway.conf

LISTEN_IP="0.0.0.0"

LISTEN_PORT=10052

PID_FILE="/var/run/zabbix/zabbix_java.pid"

START_POLLERS=5

启动zabbix_java_gateway服务

 

[root@zabbix ~]# vim /usr/local/zabbix/etc/zabbix_server.conf

JavaGateway=0.0.0.0

JavaGatewayPort=10052

StartJavaPollers=5

启动zabbix_server服务

 

Zabbix图形界面配置(选择JMX的方式监控tomcat

 

 

 

选择模板

 

 

 

最后成功出图

 

 

 

posted @ 2017-04-27 15:54  yy迷迭香  阅读(217)  评论(0编辑  收藏  举报