1. 程式人生 > >zabbix監控tomcat和相關模板(匯入直接可用),一個主機監控多個tomcat

zabbix監控tomcat和相關模板(匯入直接可用),一個主機監控多個tomcat

參考url:http://www.iyunv.com/thread-227674-1-1.html  推薦

其他監控一主機多tomcat的方法(不推薦):

http://www.cnblogs.com/bestlx/p/6098688.html 

http://www.bfish.net/2016/05/zabbix-monitor-many-tomcat.html

注意:

1,注意操作檔案路徑:

a,zabbix安裝路徑; /home/zabbix/bin/jmx_discovery.sh 

b,tomcat安裝路徑(不是在homt下,需要修改):find /home/*/t

c, t_datadir=`find /home/*/tomcat*/bin/ -name catalina.sh|awk -F "/bin/catalina.sh" '{print $1}'`   ,如果不是tomcat名,需要修改引數{print $1}

d,文件中的java.System.status 需要統一修改為java.System.status[*],否則無法完成。

e, /etc/zabbix/zabbix_agentd.conf 配置檔案中 UnsafeUserParameters=1 必須開啟,否則模板的自動發現功能報錯。

f,該模板的監控和觸發屬性在自動發現中配置,所以匯入模板後,下屬的監控項和觸發器等都為空。需要等一會兒,資料等還會出來。

操作步驟:
1、上傳 catalina-jmx-remote.jar,cmdline-jmxclient-0.10.3.jar,jmx_discovery.sh 和 add_service_tomcat.sh 到 /tmp/目錄下


2、給 add_service_tomcat.sh 賦執行許可權,並執行

3、zabbix服務端對主機新增模版

指令碼說明:
add_service_tomcat.sh

cp /tmp/jmx_discovery.sh /home/zabbix/bin/jmx_discovery.sh                             #複製檔案
cp /tmp/cmdline-jmxclient-0.10.3.jar /lib/cmdline-jmxclient-0.10.3.jar                 #複製檔案
 

#!/bin/bash
#t_datadir=`ps -ef | grep [t]omcat | awk '{print $9}'| awk -F"=|conf" '{print $3}'`          #檢查tomcat例項路徑,如果例項都是root使用者啟動,在| grep [t]omcat後新增|grep root
#tomcat_no=`ps -ef | grep [t]omcat | awk '{print $9}'| awk -F"=|conf" '{print $3}'|wc -l`    #檢查tomcat例項數,如果例項都是root使用者啟動,在| grep [t]omcat後新增|grep root
 
因為lunix版本的及命令格式等問題,上面兩句不一定能得到正確路徑,所以用下面兩句替換上面兩行,各自改下你們安裝tomcat的路徑即可。
t_datadir=`find /home/*/tomcat*/bin/ -name catalina.sh|awk -F "/bin/catalina.sh" '{print $1}'`      
tomcat_no=`find /home/*/tomcat*/bin/ -name catalina.sh|awk -F "/bin/catalina.sh" '{print $1}'|wc -l`
 
 
n_port=12345                                                                                #配置監控初始埠
local_ip=`ifconfig eth0 |awk -F '[ :]+' 'NR==2 {print $4}'`                                 #提取主機IP
for tomcat in $t_datadir
do
    m_no=`cat -n $tomcat/bin/catalina.sh|grep 'Execute The Requested Command'|awk '{print $1}'`    #提取程式碼插入位置
    cp $tomcat/bin/catalina.sh  $tomcat/bin/catalina.sh_bak                                        #備份catalina.sh
    cp /tmp/catalina-jmx-remote.jar  $tomcat/lib/catalina-jmx-remote.jar                           #複製檔案到例項lib目錄
    sed -i ''$m_no'a export CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote"'  $tomcat/bin/catalina.sh                        #插入監控配置
    let "m_no=m_no+1"                                                                                                                      #設定行號
    sed -i ''$m_no'a export CATALINA_OPTS="$CATALINA_OPTS -Djava.rmi.server.hostname='$local_ip'"' $tomcat/bin/catalina.sh                 #插入監控配置
    let "m_no=m_no+1"                                                                                                                      #設定行號
    sed -i ''$m_no'a export CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.port='$n_port'"' $tomcat/bin/catalina.sh          #插入監控配置
    let "m_no=m_no+1"                                                                                                                      #設定行號
    sed -i ''$m_no'a export CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.ssl=false"' $tomcat/bin/catalina.sh               #插入監控配置
    let "m_no=m_no+1"                                                                                                                      #設定行號
    sed -i ''$m_no'a export CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"' $tomcat/bin/catalina.sh      #插入監控配置
    let "n_port=n_port+1"
done
 
local_ip=`ifconfig eth0 |awk -F '[ :]+' 'NR==2 {print $4}'`                 #提取主機IP
 下面的路徑需要修改成實際的zabbix目錄
cat >> /etc/zabbix/zabbix_agentd.conf <<END                                 #修改zabbix_agentd.conf,新增KEY
下面的路徑需要修改成實際的zabbix目錄
UserParameter=java.jmx.discovery,/home/zabbix/bin/jmx_discovery.shUserParameter=java.Runtime.status[*],java -jar /lib/cmdline-jmxclient-0.10.3.jar - $local_ip:\$1 java.lang:type=Runtime \$2 2>&1 |grep \$2 |awk '{print \$NF}'UserParameter=java.Memory.status[*],java -jar /lib/cmdline-jmxclient-0.10.3.jar - $local_ip:\$1 java.lang:type=Memory \$2 2>&1 |grep \$2 |awk '{print \$NF}'UserParameter=java.System.status[*],java -jar /lib/cmdline-jmxclient-0.10.3.jar - $local_ip:\$1 java.lang:type=OperatingSystem \$2 2>&1 |grep \$2 |awk '{print \$NF}'UserParameter=java.HeapMemoryUsage.status[*],java -jar /lib/cmdline-jmxclient-0.10.3.jar - $local_ip:\$1 java.lang:type=Memory HeapMemoryUsage 2>&1 |grep \$2 |awk '{print \$NF}'UserParameter=java.NonHeapMemoryUsage.status[*],java -jar /lib/cmdline-jmxclient-0.10.3.jar - $local_ip:\$1 java.lang:type=Memory NonHeapMemoryUsage 2>&1 |grep \$2 |awk '{print \$NF}'UserParameter=java.LoadClass.status[*],java -jar /lib/cmdline-jmxclient-0.10.3.jar - $local_ip:\$1 java.lang:type=ClassLoading \$2 2>&1 |awk '{print \$NF}'UserParameter=java.Threading.status[*],java -jar /lib/cmdline-jmxclient-0.10.3.jar - $local_ip:\$1 java.lang:type=Threading \$2 2>&1 |awk '{print \$NF}'END

#一下內容建議單獨執行,不在指令碼中執行。

chmod +x /home/zabbix/bin/jmx_discovery.sh
rm -rf /tmp/jmx_discovery.sh
rm -rf /tmp/add_service_tomcat.sh
rm -rf /tmp/catalina-jmx-remote.jar
service zabbix_agentd restart
ps -ef|grep java
tomcat_stop  #多個tomcat需要每個獨立啟動
tomcat_start
ps -ef|grep java

jmx_discovery.sh

該指令碼執行後,能正確輸出tomcat服務名。

#!/bin/bash
#t_datadir=`ps -ef | grep [t]omcat | awk '{print $9}'| awk -F"=|conf" '{print $3}'`          #檢查tomcat例項路徑,如果例項都是root使用者啟動,在| grep [t]omcat後新增|grep root
#tomcat_no=`ps -ef | grep [t]omcat | awk '{print $9}'| awk -F"=|conf" '{print $3}'|wc -l`    #檢查tomcat例項數,如果例項都是root使用者啟動,在| grep [t]omcat後新增|grep root
 
因為lunix版本的及命令格式等問題,上面兩句不一定能得到正確路徑,所以用下面兩句替換上面兩行,各自改下你們安裝tomcat的路徑即可。
t_datadir=`find /home/*/tomcat*/bin/ -name catalina.sh|awk -F "/bin/catalina.sh" '{print $1}'`       
tomcat_no=`find /home/*/tomcat*/bin/ -name catalina.sh|awk -F "/bin/catalina.sh" '{print $1}'|wc -l`
 
n_port=12345                                                                                #配置監控初始埠
i=1
printf '{"data":[\n'
 
for tomcat in $t_datadir                                                                    #輸出JSON檔案
do
    t_service=`echo "$tomcat"|awk -F"/" '{print $(NF-0)}'`  #這裡的NF-0不能提提取tomcat服務名,則需要修改為:NF-1。
    if [ "$i" != ${tomcat_no} ];then
        printf "\t\t{ \n"
        printf "\t\t\t\"{#JMX_PORT}\":\"${n_port}\",\n"
        printf "\t\t\t\"{#JAVA_NAME}\":\"${t_service}\"},\n"
    else
        printf "\t\t{ \n"
        printf "\t\t\t\"{#JMX_PORT}\":\"${n_port}\",\n"
        printf "\t\t\t\"{#JAVA_NAME}\":\"${t_service}\"}]}\n"
    fi
    let "n_port=n_port+1"
    let "i=i+1"
done

tomcat模板4zabbix3.0,匯入後在主機新增就可使用。針對一主機多tomcat情況。

建立一個xxx.xml檔案進行儲存。

!!!檔案編碼為utf-8.

<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
    <version>3.0</version>
    <date>2016-06-08T01:26:24Z</date>
    <groups>
        <group>
            <name>Templates</name>
        </group>
    </groups>
    <templates>
        <template>
            <template>Template  for Tomcat</template>
            <name>Template  for Tomcat</name>
            <description/>
            <groups>
                <group>
                    <name>Templates</name>
                </group>
            </groups>
            <applications>
                <application>
                    <name>Tomcat_記憶體</name>
                </application>
                <application>
                    <name>Tomcat_類</name>
                </application>
                <application>
                    <name>Tomcat_系統</name>
                </application>
                <application>
                    <name>Tomcat_執行緒</name>
                </application>
                <application>
                    <name>Tomcat_執行時間</name>
                </application>
            </applications>
            <items/>
            <discovery_rules>
                <discovery_rule>
                    <name>Tomcat Server</name>
                    <type>0</type>
                    <snmp_community/>
                    <snmp_oid/>
                    <key>java.jmx.discovery</key>
                    <delay>30</delay>
                    <status>0</status>
                    <allowed_hosts/>
                    <snmpv3_contextname/>
                    <snmpv3_securityname/>
                    <snmpv3_securitylevel>0</snmpv3_securitylevel>
                    <snmpv3_authprotocol>0</snmpv3_authprotocol>
                    <snmpv3_authpassphrase/>
                    <snmpv3_privprotocol>0</snmpv3_privprotocol>
                    <snmpv3_privpassphrase/>
                    <delay_flex/>
                    <params/>
                    <ipmi_sensor/>
                    <authtype>0</authtype>
                    <username/>
                    <password/>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <filter>
                        <evaltype>0</evaltype>
                        <formula/>
                        <conditions>
                            <condition>
                                <macro>{#JMX_PORT}</macro>
                                <value/>
                                <operator>8</operator>
                                <formulaid>A</formulaid>
                            </condition>
                        </conditions>
                    </filter>
                    <lifetime>30</lifetime>
                    <description>發現查詢tomcat服務</description>
                    <item_prototypes>
                        <item_prototype>
                            <name>{#JAVA_NAME} 堆記憶體提交值:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.HeapMemoryUsage.status[{#JMX_PORT},committed]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>30</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units>B</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>java提交記憶體</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>Tomcat_記憶體</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME} 堆記憶體最大值:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.HeapMemoryUsage.status[{#JMX_PORT},max]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>30</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units>B</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>java最大使用記憶體</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>Tomcat_記憶體</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME} 堆記憶體使用值:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.HeapMemoryUsage.status[{#JMX_PORT},used]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>30</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units>B</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>java使用記憶體</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>Tomcat_記憶體</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME} 已加裝當前類的數量:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.LoadClass.status[{#JMX_PORT},LoadedClassCount]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>30</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units/>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>載入的類</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>Tomcat_類</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME} 已載入類總數:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.LoadClass.status[{#JMX_PORT},TotalLoadedClassCount]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>30</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units/>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>總共載入過的類個數</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>Tomcat_類</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME} 已解除安裝類的數量:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.LoadClass.status[{#JMX_PORT},UnloadedClassCount]</key>
                            <delay>60</delay>
                            <history>7</history>
                            <trends>30</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units/>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>解除安裝回收類個數</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>Tomcat_類</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME} 被掛起的物件的計數:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.Memory.status[{#JMX_PORT},ObjectPendingFinalizationCount]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>30</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units/>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <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/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME} 非堆記憶體提交值:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.NonHeapMemoryUsage.status[{#JMX_PORT},committed]</key>
                            <delay>60</delay>
                            <history>7</history>
                            <trends>30</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units>B</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>堆記憶體提交大小</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>Tomcat_記憶體</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME} 非堆記憶體最大值:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.NonHeapMemoryUsage.status[{#JMX_PORT},max]</key>
                            <delay>60</delay>
                            <history>7</history>
                            <trends>30</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units>B</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>堆記憶體最大值</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>Tomcat_記憶體</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME} 非堆記憶體使用值:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.NonHeapMemoryUsage.status[{#JMX_PORT},used]</key>
                            <delay>60</delay>
                            <history>7</history>
                            <trends>30</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units>B</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>
                            <params/>
                            <ipmi_sensor/>
                            <data_type>0</data_type>
                            <authtype>0</authtype>
                            <username/>
                            <password/>
                            <publickey/>
                            <privatekey/>
                            <port/>
                            <description>堆記憶體使用大小</description>
                            <inventory_link>0</inventory_link>
                            <applications>
                                <application>
                                    <name>Tomcat_記憶體</name>
                                </application>
                            </applications>
                            <valuemap/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME}  JVM啟動時間:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.Runtime.status[{#JMX_PORT},Uptime]</key>
                            <delay>60</delay>
                            <history>7</history>
                            <trends>30</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units>uptime</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <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/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME}  JVM名稱:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.Runtime.status[{#JMX_PORT},VmName]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>0</trends>
                            <status>0</status>
                            <value_type>4</value_type>
                            <allowed_hosts/>
                            <units/>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <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/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME}  JVM版本:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.Runtime.status[{#JMX_PORT},VmVersion]</key>
                            <delay>60</delay>
                            <history>7</history>
                            <trends>0</trends>
                            <status>0</status>
                            <value_type>1</value_type>
                            <allowed_hosts/>
                            <units/>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <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/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME} 系統可開啟最大開啟檔案數:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.System.status[{#JMX_PORT},MaxFileDescriptorCount]</key>
                            <delay>60</delay>
                            <history>7</history>
                            <trends>30</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units/>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <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/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME} 系統應用當前開啟檔案數:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.System.status[{#JMX_PORT},OpenFileDescriptorCount]</key>
                            <delay>60</delay>
                            <history>7</history>
                            <trends>30</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units/>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <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/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME} 系統平均負載:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.System.status[{#JMX_PORT},SystemLoadAverage]</key>
                            <delay>60</delay>
                            <history>7</history>
                            <trends>30</trends>
                            <status>0</status>
                            <value_type>0</value_type>
                            <allowed_hosts/>
                            <units>%</units>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <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/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME} 守護程式執行緒數:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.Threading.status[{#JMX_PORT},DaemonThreadCount]</key>
                            <delay>30</delay>
                            <history>7</history>
                            <trends>30</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units/>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <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/>
                            <logtimefmt/>
                            <application_prototypes/>
                        </item_prototype>
                        <item_prototype>
                            <name>{#JAVA_NAME} 執行緒峰值數:</name>
                            <type>0</type>
                            <snmp_community/>
                            <multiplier>0</multiplier>
                            <snmp_oid/>
                            <key>java.Threading.status[{#JMX_PORT},PeakThreadCount]</key>
                            <delay>60</delay>
                            <history>7</history>
                            <trends>30</trends>
                            <status>0</status>
                            <value_type>3</value_type>
                            <allowed_hosts/>
                            <units/>
                            <delta>0</delta>
                            <snmpv3_contextname/>
                            <snmpv3_securityname/>
                            <snmpv3_securitylevel>0</snmpv3_securitylevel>
                            <snmpv3_authprotocol>0</snmpv3_authprotocol>
                            <snmpv3_authpassphrase/>
                            <snmpv3_privprotocol>0</snmpv3_privprotocol>
                            <snmpv3_privpassphrase/>
                            <formula>1</formula>
                            <delay_flex/>