阿里云-云小站(无限量代金券发放中)
【腾讯云】云服务器、云数据库、COS、CDN、短信等热卖云产品特惠抢购

Zabbix 基于JMX的Tomcat监控

293次阅读
没有评论

共计 21176 个字符,预计需要花费 53 分钟才能阅读完成。

工作原理:

1、Java-GATEWAY

 Zabbix 本身不支持直接监控 Java,在 zabbix 1.8 以前,只能使用 Zapcat 来做代理监控,而且要修改源代码,非常麻烦。所有后来为了解决这个监控问题,Zabbix 和 Java 双方应运生成了各自的代理监控程序:zabbix 2.0 以后添加了服务进程 zabbix-java-gateway,用以在服务端接收 JMX 的监控数据;Java 有了 JMX(全称是 Java Management Extensions, 即 Java 管理扩展),用以在客户端收集客户端的监控数据并转发到 zabbix-java-gateway

2、示意图

 Zabbix 基于 JMX 的 Tomcat 监控

 

比如:当Zabbix-Server 需要知道 java 应用程序的某项性能的时候,会启动自身的一个 Zabbix-JavaPollers 进程去连接 Zabbix-Java-Gateway 请求数据,而 Zabbix-Java-gateway 收到请求后会使用“JMX-management-API”去 tomcat 服务器开启 JMX,而前提是 tomcat 服务器端在开启时需要“-Dcom.sun.management.jmxremote”参数来开启 JMX 远程查询。Java 程序会启动自身的一个简单的小程序端口 12345 向 Zabbix-JavaGateway 提供请求数据。

Zabbix监控端部署:

1. 安装 zabbix server

编译安装zabbix server 需要加上 –enable-java 以支持 jmx 监控,如果之前的 zabbix server 没加,那么请重新编译安装

./configure –prefix=/application/zabbix-3.0.3 –enable-server –enable-agent –enable-java –enable-ipv6 –with-mysql=/application/mysql-5.5.49/bin/mysql_config  –with-net-snmp –with-libcurl –with-libxml2 –with-openipmi –with-unixodbc –with-openssl

并且监控端也需要安装java 环境

2.安装zabbix_java_gateway

wget http://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/6/x86_64/zabbix-java-gateway-3.4.1-1.el6.x86_64.rpm

rpm -ivh zabbix-java-gateway-3.4.1-1.el6.x86_64.rpm(zabbix-java-gateway 用老版本可能会出错

#zabbix_java_gateway配置文件 zabbix_java_gateway.conf 里有默认端口等设置,这里我们保持默认即可

service zabbix-java-gateway start

此时,默认的端口10052 应该打开,ss -nat | grep 10052 查看

zabbix_server.conf  中配置监控端访问zabbix_java_gateway

JavaGateway=172.16.2.150  #zabbix_java_gateway地址

StartJavaPollers=6   #预启动进程轮询个数,且这个值要比 zabbix_java_gateway.confStart_poller值要大,不然会无法通信

重启zabbix-server

zabbix 客户端安装:

1.安装JMX

1. 下载 JMX Remote jar 二进制包。放在 tomcat/lib 下面

wget  http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.56/bin/extras/catalina-jmx-remote.jar

2. 修改 tomcat conf/server.xml 配置文件,添加以下内容:

<Listener className=”org.apache.catalina.mbeans.JmxRemoteLifecycleListener” rmiRegistryPortPlatform=”12345″ rmiServerPortPlatform=”12346″ /> 

3. 修改 tomcat/bin 目录下 catalina.sh,添加以下内容:

CATALINA_OPTS=”-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=10.32.18.1″

注意:Djava.rmi.server.hostname这里写上被监控端 hostname 是由于 hostname 默认值为 localhost, 如果你的 tomcat 未监听在 localhost,那么不写具体 ip 会引发问题。 并且这段配置应该写在 catalina.sh 的前面,不然端口打不开。

4. 确保 zabbix server 或者 proxy 和 配置 文件中的端口通讯畅通,重启tomcat,lsof -i:12345 端口打开

验证是否能获取数据

在监控端下载JMX cmd.jar 文件

wget http://nchc.dl.sourceforge.net/project/jmxcmd/jmxcmd.jar

测试有数据则表示成功

命令格式:

# java -jar jmxcmd.jar – 192.168.3.18:12345 java.lang:type=Memory NonHeapMemoryUsage

 

导入模板,添加监控

 

 

Zabbix 基于 JMX 的 Tomcat 监控
<?xml version="1.0" encoding="UTF-8"?>

-<zabbix_export>

<version>2.0</version>

<date>2013-05-30T03:17:01Z</date>


-<groups>


-<group>

<name>Templates</name>

</group>

</groups>


-<templates>


-<template>

<template>CustomTomcat</template>

<name>CustomTomcat</name>


-<groups>


-<group>

<name>Templates</name>

</group>

</groups>


-<applications>


-<application>

<name>class</name>

</application>


-<application>

<name>HeapStatistics</name>

</application>


-<application>

<name>Sessions</name>

</application>


-<application>

<name>ThreadStatistics</name>

</application>


-<application>

<name>Tomcat</name>

</application>

</applications>


-<items>


-<item>

<name>http-8080 gzip compression</name>

<type>16</type>

<snmp_community/>

<multiplier>0</multiplier>

<snmp_oid/>

<key>jmx["Catalina:type=ProtocolHandler,port=8080",compression]</key>

<delay>30</delay>

<history>90</history>

<trends>365</trends>

<status>0</status>

<value_type>1</value_type>

<allowed_hosts/>

<units/>

<delta>0</delta>

<snmpv3_securityname/>

<snmpv3_securitylevel>0</snmpv3_securitylevel>

<snmpv3_authpassphrase/>

<snmpv3_privpassphrase/>

<formula>1</formula>

<delay_flex/>

<params/>

<ipmi_sensor/>

<data_type>0</data_type>

<authtype>0</authtype>

<username/>

<password/>

<publickey/>

<privatekey/>

<port/>

<description/>

<inventory_link>0</inventory_link>

<applications/>

<valuemap/>

</item>


-<item>

<name>http-8080 活动线程</name>

<type>16</type>

<snmp_community/>

<multiplier>0</multiplier>

<snmp_oid/>

<key>jmx["java.lang:type=Threading","ThreadCount"]</key>

<delay>30</delay>

<history>90</history>

<trends>365</trends>

<status>0</status>

<value_type>3</value_type>

<allowed_hosts/>

<units/>

<delta>0</delta>

<snmpv3_securityname/>

<snmpv3_securitylevel>0</snmpv3_securitylevel>

<snmpv3_authpassphrase/>

<snmpv3_privpassphrase/>

<formula>1</formula>

<delay_flex/>

<params/>

<ipmi_sensor/>

<data_type>0</data_type>

<authtype>0</authtype>

<username/>

<password/>

<publickey/>

<privatekey/>

<port/>

<description/>

<inventory_link>0</inventory_link>


-<applications>


-<application>

<name>ThreadStatistics</name>

</application>

</applications>

<valuemap/>

</item>


-<item>

<name>http-8080 线程峰值</name>

<type>16</type>

<snmp_community/>

<multiplier>0</multiplier>

<snmp_oid/>

<key>jmx["java.lang:type=Threading","PeakThreadCount"]</key>

<delay>30</delay>

<history>90</history>

<trends>365</trends>

<status>0</status>

<value_type>3</value_type>

<allowed_hosts/>

<units/>

<delta>0</delta>

<snmpv3_securityname/>

<snmpv3_securitylevel>0</snmpv3_securitylevel>

<snmpv3_authpassphrase/>

<snmpv3_privpassphrase/>

<formula>1</formula>

<delay_flex/>

<params/>

<ipmi_sensor/>

<data_type>0</data_type>

<authtype>0</authtype>

<username/>

<password/>

<publickey/>

<privatekey/>

<port/>

<description/>

<inventory_link>0</inventory_link>


-<applications>


-<application>

<name>ThreadStatistics</name>

</application>

</applications>

<valuemap/>

</item>


-<item>

<name>http-8080 线程总计</name>

<type>16</type>

<snmp_community/>

<multiplier>0</multiplier>

<snmp_oid/>

<key>jmx["java.lang:type=Threading","TotalStartedThreadCount"]</key>

<delay>30</delay>

<history>90</history>

<trends>365</trends>

<status>0</status>

<value_type>3</value_type>

<allowed_hosts/>

<units/>

<delta>0</delta>

<snmpv3_securityname/>

<snmpv3_securitylevel>0</snmpv3_securitylevel>

<snmpv3_authpassphrase/>

<snmpv3_privpassphrase/>

<formula>1</formula>

<delay_flex/>

<params/>

<ipmi_sensor/>

<data_type>0</data_type>

<authtype>0</authtype>

<username/>

<password/>

<publickey/>

<privatekey/>

<port/>

<description/>

<inventory_link>0</inventory_link>


-<applications>


-<application>

<name>ThreadStatistics</name>

</application>

</applications>

<valuemap/>

</item>


-<item>

<name>Sessions-Number of sessions we rejected due to maxActive beeing reached</name>

<type>16</type>

<snmp_community/>

<multiplier>0</multiplier>

<snmp_oid/>

<key>jmx["Catalina:type=Manager,context=/,host=localhost",rejectedSessions]</key>

<delay>30</delay>

<history>90</history>

<trends>365</trends>

<status>0</status>

<value_type>3</value_type>

<allowed_hosts/>

<units/>

<delta>0</delta>

<snmpv3_securityname/>

<snmpv3_securitylevel>0</snmpv3_securitylevel>

<snmpv3_authpassphrase/>

<snmpv3_privpassphrase/>

<formula>1</formula>

<delay_flex/>

<params/>

<ipmi_sensor/>

<data_type>0</data_type>

<authtype>0</authtype>

<username/>

<password/>

<publickey/>

<privatekey/>

<port/>

<description/>

<inventory_link>0</inventory_link>


-<applications>


-<application>

<name>Sessions</name>

</application>

</applications>

<valuemap/>

</item>


-<item>

<name>Sessions-The maximum number of active Sessions allowed, or -1 for no limit</name>

<type>16</type>

<snmp_community/>

<multiplier>0</multiplier>

<snmp_oid/>

<key>jmx["Catalina:type=Manager,context=/,host=localhost",maxActiveSessions]</key>

<delay>30</delay>

<history>90</history>

<trends>365</trends>

<status>0</status>

<value_type>0</value_type>

<allowed_hosts/>

<units/>

<delta>0</delta>

<snmpv3_securityname/>

<snmpv3_securitylevel>0</snmpv3_securitylevel>

<snmpv3_authpassphrase/>

<snmpv3_privpassphrase/>

<formula>1</formula>

<delay_flex/>

<params/>

<ipmi_sensor/>

<data_type>0</data_type>

<authtype>0</authtype>

<username/>

<password/>

<publickey/>

<privatekey/>

<port/>

<description/>

<inventory_link>0</inventory_link>


-<applications>


-<application>

<name>Sessions</name>

</application>

</applications>

<valuemap/>

</item>


-<item>

<name>Sessions- 会话数</name>

<type>16</type>

<snmp_community/>

<multiplier>0</multiplier>

<snmp_oid/>

<key>jmx["Catalina:type=Manager,context=/,host=localhost",sessionCounter]</key>

<delay>30</delay>

<history>90</history>

<trends>365</trends>

<status>0</status>

<value_type>3</value_type>

<allowed_hosts/>

<units/>

<delta>0</delta>

<snmpv3_securityname/>

<snmpv3_securitylevel>0</snmpv3_securitylevel>

<snmpv3_authpassphrase/>

<snmpv3_privpassphrase/>

<formula>1</formula>

<delay_flex/>

<params/>

<ipmi_sensor/>

<data_type>0</data_type>

<authtype>0</authtype>

<username/>

<password/>

<publickey/>

<privatekey/>

<port/>

<description/>

<inventory_link>0</inventory_link>


-<applications>


-<application>

<name>Sessions</name>

</application>

</applications>

<valuemap/>

</item>


-<item>

<name>Sessions- 当前活动会话数</name>

<type>16</type>

<snmp_community/>

<multiplier>0</multiplier>

<snmp_oid/>

<key>jmx["Catalina:type=Manager,context=/,host=localhost",activeSessions]</key>

<delay>30</delay>

<history>90</history>

<trends>365</trends>

<status>0</status>

<value_type>3</value_type>

<allowed_hosts/>

<units/>

<delta>0</delta>

<snmpv3_securityname/>

<snmpv3_securitylevel>0</snmpv3_securitylevel>

<snmpv3_authpassphrase/>

<snmpv3_privpassphrase/>

<formula>1</formula>

<delay_flex/>

<params/>

<ipmi_sensor/>

<data_type>0</data_type>

<authtype>0</authtype>

<username/>

<password/>

<publickey/>

<privatekey/>

<port/>

<description/>

<inventory_link>0</inventory_link>


-<applications>


-<application>

<name>Sessions</name>

</application>

</applications>

<valuemap/>

</item>


-<item>

<name>Sessions- 最大活动会话数</name>

<type>16</type>

<snmp_community/>

<multiplier>0</multiplier>

<snmp_oid/>

<key>jmx["Catalina:type=Manager,context=/,host=localhost",maxActive]</key>

<delay>30</delay>

<history>90</history>

<trends>365</trends>

<status>0</status>

<value_type>3</value_type>

<allowed_hosts/>

<units/>

<delta>0</delta>

<snmpv3_securityname/>

<snmpv3_securitylevel>0</snmpv3_securitylevel>

<snmpv3_authpassphrase/>

<snmpv3_privpassphrase/>

<formula>1</formula>

<delay_flex/>

<params/>

<ipmi_sensor/>

<data_type>0</data_type>

<authtype>0</authtype>

<username/>

<password/>

<publickey/>

<privatekey/>

<port/>

<description/>

<inventory_link>0</inventory_link>


-<applications>


-<application>

<name>Sessions</name>

</application>

</applications>

<valuemap/>

</item>


-<item>

<name>Tomcat version</name>

<type>16</type>

<snmp_community/>

<multiplier>0</multiplier>

<snmp_oid/>

<key>jmx["Catalina:type=Server",serverInfo]</key>

<delay>30</delay>

<history>90</history>

<trends>365</trends>

<status>0</status>

<value_type>1</value_type>

<allowed_hosts/>

<units/>

<delta>0</delta>

<snmpv3_securityname/>

<snmpv3_securitylevel>0</snmpv3_securitylevel>

<snmpv3_authpassphrase/>

<snmpv3_privpassphrase/>

<formula>1</formula>

<delay_flex/>

<params/>

<ipmi_sensor/>

<data_type>0</data_type>

<authtype>0</authtype>

<username/>

<password/>

<publickey/>

<privatekey/>

<port/>

<description/>

<inventory_link>0</inventory_link>


-<applications>


-<application>

<name>Tomcat</name>

</application>

</applications>

<valuemap/>

</item>


-<item>

<name>堆内存已使用</name>

<type>16</type>

<snmp_community/>

<multiplier>0</multiplier>

<snmp_oid/>

<key>jmx["java.lang:type=Memory","HeapMemoryUsage.used"]</key>

<delay>30</delay>

<history>90</history>

<trends>365</trends>

<status>0</status>

<value_type>3</value_type>

<allowed_hosts/>

<units/>

<delta>0</delta>

<snmpv3_securityname/>

<snmpv3_securitylevel>0</snmpv3_securitylevel>

<snmpv3_authpassphrase/>

<snmpv3_privpassphrase/>

<formula>1</formula>

<delay_flex/>

<params/>

<ipmi_sensor/>

<data_type>0</data_type>

<authtype>0</authtype>

<username/>

<password/>

<publickey/>

<privatekey/>

<port/>

<description/>

<inventory_link>0</inventory_link>


-<applications>


-<application>

<name>HeapStatistics</name>

</application>

</applications>

<valuemap/>

</item>


-<item>

<name>堆内存已提交</name>

<type>16</type>

<snmp_community/>

<multiplier>0</multiplier>

<snmp_oid/>

<key>jmx["java.lang:type=Memory","HeapMemoryUsage.committed"]</key>

<delay>30</delay>

<history>90</history>

<trends>365</trends>

<status>0</status>

<value_type>3</value_type>

<allowed_hosts/>

<units/>

<delta>0</delta>

<snmpv3_securityname/>

<snmpv3_securitylevel>0</snmpv3_securitylevel>

<snmpv3_authpassphrase/>

<snmpv3_privpassphrase/>

<formula>1</formula>

<delay_flex/>

<params/>

<ipmi_sensor/>

<data_type>0</data_type>

<authtype>0</authtype>

<username/>

<password/>

<publickey/>

<privatekey/>

<port/>

<description/>

<inventory_link>0</inventory_link>


-<applications>


-<application>

<name>HeapStatistics</name>

</application>

</applications>

<valuemap/>

</item>


-<item>

<name>堆内存最大</name>

<type>16</type>

<snmp_community/>

<multiplier>0</multiplier>

<snmp_oid/>

<key>jmx["java.lang:type=Memory","HeapMemoryUsage.max"]</key>

<delay>30</delay>

<history>90</history>

<trends>365</trends>

<status>0</status>

<value_type>3</value_type>

<allowed_hosts/>

<units/>

<delta>0</delta>

<snmpv3_securityname/>

<snmpv3_securitylevel>0</snmpv3_securitylevel>

<snmpv3_authpassphrase/>

<snmpv3_privpassphrase/>

<formula>1</formula>

<delay_flex/>

<params/>

<ipmi_sensor/>

<data_type>0</data_type>

<authtype>0</authtype>

<username/>

<password/>

<publickey/>

<privatekey/>

<port/>

<description/>

<inventory_link>0</inventory_link>


-<applications>


-<application>

<name>HeapStatistics</name>

</application>

</applications>

<valuemap/>

</item>


-<item>

<name>类 - 已加载</name>

<type>16</type>

<snmp_community/>

<multiplier>0</multiplier>

<snmp_oid/>

<key>jmx["java.lang:type=ClassLoading","LoadedClassCount"]</key>

<delay>30</delay>

<history>90</history>

<trends>365</trends>

<status>0</status>

<value_type>3</value_type>

<allowed_hosts/>

<units/>

<delta>0</delta>

<snmpv3_securityname/>

<snmpv3_securitylevel>0</snmpv3_securitylevel>

<snmpv3_authpassphrase/>

<snmpv3_privpassphrase/>

<formula>1</formula>

<delay_flex/>

<params/>

<ipmi_sensor/>

<data_type>0</data_type>

<authtype>0</authtype>

<username/>

<password/>

<publickey/>

<privatekey/>

<port/>

<description/>

<inventory_link>0</inventory_link>


-<applications>


-<application>

<name>class</name>

</application>

</applications>

<valuemap/>

</item>


-<item>

<name>类 - 已卸载</name>

<type>16</type>

<snmp_community/>

<multiplier>0</multiplier>

<snmp_oid/>

<key>jmx["java.lang:type=ClassLoading","UnloadedClassCount"]</key>

<delay>30</delay>

<history>90</history>

<trends>365</trends>

<status>0</status>

<value_type>3</value_type>

<allowed_hosts/>

<units/>

<delta>0</delta>

<snmpv3_securityname/>

<snmpv3_securitylevel>0</snmpv3_securitylevel>

<snmpv3_authpassphrase/>

<snmpv3_privpassphrase/>

<formula>1</formula>

<delay_flex/>

<params/>

<ipmi_sensor/>

<data_type>0</data_type>

<authtype>0</authtype>

<username/>

<password/>

<publickey/>

<privatekey/>

<port/>

<description/>

<inventory_link>0</inventory_link>


-<applications>


-<application>

<name>class</name>

</application>

</applications>

<valuemap/>

</item>


-<item>

<name>类 - 总计</name>

<type>16</type>

<snmp_community/>

<multiplier>0</multiplier>

<snmp_oid/>

<key>jmx["java.lang:type=ClassLoading","TotalLoadedClassCount"]</key>

<delay>30</delay>

<history>90</history>

<trends>365</trends>

<status>0</status>

<value_type>3</value_type>

<allowed_hosts/>

<units/>

<delta>0</delta>

<snmpv3_securityname/>

<snmpv3_securitylevel>0</snmpv3_securitylevel>

<snmpv3_authpassphrase/>

<snmpv3_privpassphrase/>

<formula>1</formula>

<delay_flex/>

<params/>

<ipmi_sensor/>

<data_type>0</data_type>

<authtype>0</authtype>

<username/>

<password/>

<publickey/>

<privatekey/>

<port/>

<description/>

<inventory_link>0</inventory_link>


-<applications>


-<application>

<name>class</name>

</application>

</applications>

<valuemap/>

</item>

</items>

<discovery_rules/>

<macros/>

<templates/>

<screens/>

</template>

</templates>


-<graphs>


-<graph>

<name>会话状态</name>

<width>900</width>

<height>200</height>

<yaxismin>0.0000</yaxismin>

<yaxismax>100.0000</yaxismax>

<show_work_period>1</show_work_period>

<show_triggers>1</show_triggers>

<type>0</type>

<show_legend>1</show_legend>

<show_3d>0</show_3d>

<percent_left>0.0000</percent_left>

<percent_right>0.0000</percent_right>

<ymin_type_1>0</ymin_type_1>

<ymax_type_1>0</ymax_type_1>

<ymin_item_1>0</ymin_item_1>

<ymax_item_1>0</ymax_item_1>


-<graph_items>


-<graph_item>

<sortorder>0</sortorder>

<drawtype>0</drawtype>

<color>C80000</color>

<yaxisside>0</yaxisside>

<calc_fnc>2</calc_fnc>

<type>0</type>


-<item>

<host>CustomTomcat</host>

<key>jmx["Catalina:type=Manager,context=/,host=localhost",maxActive]</key>

</item>

</graph_item>


-<graph_item>

<sortorder>1</sortorder>

<drawtype>0</drawtype>

<color>00C800</color>

<yaxisside>0</yaxisside>

<calc_fnc>2</calc_fnc>

<type>0</type>


-<item>

<host>CustomTomcat</host>

<key>jmx["Catalina:type=Manager,context=/,host=localhost",activeSessions]</key>

</item>

</graph_item>


-<graph_item>

<sortorder>2</sortorder>

<drawtype>0</drawtype>

<color>0000C8</color>

<yaxisside>0</yaxisside>

<calc_fnc>2</calc_fnc>

<type>0</type>


-<item>

<host>CustomTomcat</host>

<key>jmx["Catalina:type=Manager,context=/,host=localhost",sessionCounter]</key>

</item>

</graph_item>


-<graph_item>

<sortorder>3</sortorder>

<drawtype>0</drawtype>

<color>C800C8</color>

<yaxisside>0</yaxisside>

<calc_fnc>2</calc_fnc>

<type>0</type>


-<item>

<host>CustomTomcat</host>

<key>jmx["Catalina:type=Manager,context=/,host=localhost",rejectedSessions]</key>

</item>

</graph_item>


-<graph_item>

<sortorder>4</sortorder>

<drawtype>0</drawtype>

<color>00C8C8</color>

<yaxisside>0</yaxisside>

<calc_fnc>2</calc_fnc>

<type>0</type>


-<item>

<host>CustomTomcat</host>

<key>jmx["Catalina:type=Manager,context=/,host=localhost",maxActiveSessions]</key>

</item>

</graph_item>

</graph_items>

</graph>


-<graph>

<name>堆内存状态</name>

<width>900</width>

<height>200</height>

<yaxismin>0.0000</yaxismin>

<yaxismax>100.0000</yaxismax>

<show_work_period>1</show_work_period>

<show_triggers>1</show_triggers>

<type>0</type>

<show_legend>1</show_legend>

<show_3d>0</show_3d>

<percent_left>0.0000</percent_left>

<percent_right>0.0000</percent_right>

<ymin_type_1>0</ymin_type_1>

<ymax_type_1>0</ymax_type_1>

<ymin_item_1>0</ymin_item_1>

<ymax_item_1>0</ymax_item_1>


-<graph_items>


-<graph_item>

<sortorder>0</sortorder>

<drawtype>0</drawtype>

<color>C80000</color>

<yaxisside>0</yaxisside>

<calc_fnc>2</calc_fnc>

<type>0</type>


-<item>

<host>CustomTomcat</host>

<key>jmx["java.lang:type=Memory","HeapMemoryUsage.used"]</key>

</item>

</graph_item>


-<graph_item>

<sortorder>1</sortorder>

<drawtype>0</drawtype>

<color>00C800</color>

<yaxisside>0</yaxisside>

<calc_fnc>2</calc_fnc>

<type>0</type>


-<item>

<host>CustomTomcat</host>

<key>jmx["java.lang:type=Memory","HeapMemoryUsage.committed"]</key>

</item>

</graph_item>


-<graph_item>

<sortorder>2</sortorder>

<drawtype>0</drawtype>

<color>0000C8</color>

<yaxisside>0</yaxisside>

<calc_fnc>2</calc_fnc>

<type>0</type>


-<item>

<host>CustomTomcat</host>

<key>jmx["java.lang:type=Memory","HeapMemoryUsage.max"]</key>

</item>

</graph_item>

</graph_items>

</graph>


-<graph>

<name>类状态</name>

<width>900</width>

<height>200</height>

<yaxismin>0.0000</yaxismin>

<yaxismax>100.0000</yaxismax>

<show_work_period>1</show_work_period>

<show_triggers>1</show_triggers>

<type>0</type>

<show_legend>1</show_legend>

<show_3d>0</show_3d>

<percent_left>0.0000</percent_left>

<percent_right>0.0000</percent_right>

<ymin_type_1>0</ymin_type_1>

<ymax_type_1>0</ymax_type_1>

<ymin_item_1>0</ymin_item_1>

<ymax_item_1>0</ymax_item_1>


-<graph_items>


-<graph_item>

<sortorder>0</sortorder>

<drawtype>0</drawtype>

<color>C80000</color>

<yaxisside>0</yaxisside>

<calc_fnc>2</calc_fnc>

<type>0</type>


-<item>

<host>CustomTomcat</host>

<key>jmx["java.lang:type=ClassLoading","LoadedClassCount"]</key>

</item>

</graph_item>


-<graph_item>

<sortorder>1</sortorder>

<drawtype>0</drawtype>

<color>00C800</color>

<yaxisside>0</yaxisside>

<calc_fnc>2</calc_fnc>

<type>0</type>


-<item>

<host>CustomTomcat</host>

<key>jmx["java.lang:type=ClassLoading","UnloadedClassCount"]</key>

</item>

</graph_item>


-<graph_item>

<sortorder>2</sortorder>

<drawtype>0</drawtype>

<color>0000C8</color>

<yaxisside>0</yaxisside>

<calc_fnc>2</calc_fnc>

<type>0</type>


-<item>

<host>CustomTomcat</host>

<key>jmx["java.lang:type=ClassLoading","TotalLoadedClassCount"]</key>

</item>

</graph_item>

</graph_items>

</graph>


-<graph>

<name>线程状态</name>

<width>900</width>

<height>200</height>

<yaxismin>0.0000</yaxismin>

<yaxismax>100.0000</yaxismax>

<show_work_period>1</show_work_period>

<show_triggers>1</show_triggers>

<type>0</type>

<show_legend>1</show_legend>

<show_3d>0</show_3d>

<percent_left>0.0000</percent_left>

<percent_right>0.0000</percent_right>

<ymin_type_1>0</ymin_type_1>

<ymax_type_1>0</ymax_type_1>

<ymin_item_1>0</ymin_item_1>

<ymax_item_1>0</ymax_item_1>


-<graph_items>


-<graph_item>

<sortorder>0</sortorder>

<drawtype>0</drawtype>

<color>C80000</color>

<yaxisside>0</yaxisside>

<calc_fnc>2</calc_fnc>

<type>0</type>


-<item>

<host>CustomTomcat</host>

<key>jmx["java.lang:type=Threading","ThreadCount"]</key>

</item>

</graph_item>


-<graph_item>

<sortorder>1</sortorder>

<drawtype>0</drawtype>

<color>00C800</color>

<yaxisside>0</yaxisside>

<calc_fnc>2</calc_fnc>

<type>0</type>


-<item>

<host>CustomTomcat</host>

<key>jmx["java.lang:type=Threading","PeakThreadCount"]</key>

</item>

</graph_item>


-<graph_item>

<sortorder>2</sortorder>

<drawtype>0</drawtype>

<color>0000C8</color>

<yaxisside>0</yaxisside>

<calc_fnc>2</calc_fnc>

<type>0</type>


-<item>

<host>CustomTomcat</host>

<key>jmx["java.lang:type=Threading","TotalStartedThreadCount"]</key>

</item>

</graph_item>

</graph_items>

</graph>

</graphs>

</zabbix_export> 

 附录

 Zabbix 基于 JMX 的 Tomcat 监控

 

���多 Zabbix 相关教程集合

在 Ubuntu 16.04 服务器上安装 Zabbix 3.2  http://www.linuxidc.com/Linux/2017-07/145519.htm 

CentOS 7 LNMP 环境搭建 Zabbix3.0  http://www.linuxidc.com/Linux/2017-02/140134.htm 

Ubuntu 16.04 安装部署监控系统 Zabbix2.4  http://www.linuxidc.com/Linux/2017-03/141436.htm 

Zabbix 监控安装部署及警报配置  http://www.linuxidc.com/Linux/2017-03/141611.htm 

Zabbix 触发器表达式详解 http://www.linuxidc.com/Linux/2017-03/141921.htm 

Ubuntu 16.04 下安装部署 Zabbix3.0  http://www.linuxidc.com/Linux/2017-02/140395.htm 

CentOS 6.3 下 Zabbix 监控 apache server-status http://www.linuxidc.com/Linux/2013-05/84740.htm 

CentOS 7 下 Zabbix 3.0 安装详解 http://www.linuxidc.com/Linux/2017-03/141716.htm 

CentOS 7.4 安装 Zabbix 3.4  http://www.linuxidc.com/Linux/2017-09/147202.htm

64 位 CentOS 6.2 下安装 Zabbix 2.0.6   http://www.linuxidc.com/Linux/2014-11/109541.htm 

ZABBIX 的详细介绍:请点这里
ZABBIX 的下载地址:请点这里

本文永久更新链接地址:http://www.linuxidc.com/Linux/2017-12/149458.htm

正文完
星哥玩云-微信公众号
post-qrcode
 0
星锅
版权声明:本站原创文章,由 星锅 于2022-01-21发表,共计21176字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
【腾讯云】推广者专属福利,新客户无门槛领取总价值高达2860元代金券,每种代金券限量500张,先到先得。
阿里云-最新活动爆款每日限量供应
评论(没有评论)
验证码
【腾讯云】云服务器、云数据库、COS、CDN、短信等云产品特惠热卖中