1、开启ActiveMq的jmx  打开对应版本的wrapper.conf配置文件,修改配置,使jmx可用  

# Uncomment to enable remote jmx

wrapper.java.additional.n=-Dcom.sun.management.jmxremote.port=1616
wrapper.java.additional.n=-Dcom.sun.management.jmxremote.authenticate=false
wrapper.java.additional.n=-Dcom.sun.management.jmxremote.ssl=false

2、修改conf目录下的activemq.xml,在broker上增加useJmx=”true”  并且修改 managementContext节点

<managementContext>
            <managementContext createConnector="true" connectorPort="1616"/>
</managementContext

虽然在wrapper.conf中已经配置了端口,但是在这里不配置connectPort就不能用jmx连接

配置完以后记得重启服务

3、导入模板(zabbix3.0版本)

<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
    <version>3.0</version>
    <date>2018-05-30T01:51:30Z</date>
    <groups>
        <group>
            <name>自定义模版群组[可选]</name>
        </group>
    </groups>
    <templates>
        <template>
            <template>JMX ActiveMQ</template>
            <name>JMX ActiveMQ子模板</name>
            <description/>
            <groups>
                <group>
                    <name>自定义模版群组[可选]</name>
                </group>
            </groups>
            <applications>
                <application>
                    <name>ActiveMQ</name>
                </application>
            </applications>
            <items>
                <item>
                    <name>ActiveMQ Broker</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;BrokerId&quot;]</key>
                    <delay>3600</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>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>ActiveMQ Broker name</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;BrokerName&quot;]</key>
                    <delay>3600</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>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>ActiveMQ Broker version(版本)</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;BrokerVersion&quot;]</key>
                    <delay>3600</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>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>ActiveMQ Data directory</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;DataDirectory&quot;]</key>
                    <delay>3600</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>{$JMX_USERNAME}</username>
                    <password>{$JMX_PASSWORD}</password>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>ActiveMQ Memory limit</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;MemoryLimit&quot;]</key>
                    <delay>3600</delay>
                    <history>7</history>
                    <trends>365</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>{$JMX_USERNAME}</username>
                    <password>{$JMX_PASSWORD}</password>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>ActiveMQ Memory percent usage</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;MemoryPercentUsage&quot;]</key>
                    <delay>120</delay>
                    <history>7</history>
                    <trends>365</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>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>ActiveMQ Persistent(持久化)</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;Persistent&quot;]</key>
                    <delay>3600</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>{$JMX_USERNAME}</username>
                    <password>{$JMX_PASSWORD}</password>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>ActiveMQ Slave</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;Slave&quot;]</key>
                    <delay>3600</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>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>ActiveMQ Statistics enabled</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;StatisticsEnabled&quot;]</key>
                    <delay>3600</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>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>ActiveMQ Store limit</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;StoreLimit&quot;]</key>
                    <delay>3600</delay>
                    <history>7</history>
                    <trends>365</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/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>ActiveMQ Store percent usage(内存使用百分比)</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;StorePercentUsage&quot;]</key>
                    <delay>120</delay>
                    <history>7</history>
                    <trends>365</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>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>ActiveMQ Temp limit</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;TempLimit&quot;]</key>
                    <delay>3600</delay>
                    <history>7</history>
                    <trends>365</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/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>ActiveMQ Temp percent usage</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;TempPercentUsage&quot;]</key>
                    <delay>120</delay>
                    <history>7</history>
                    <trends>365</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>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>ActiveMQ Total consumer count</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;TotalConsumerCount&quot;]</key>
                    <delay>120</delay>
                    <history>7</history>
                    <trends>365</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>{$JMX_USERNAME}</username>
                    <password>{$JMX_PASSWORD}</password>
                    <publickey/>
                    <privatekey/>
                    <port/>
                    <description/>
                    <inventory_link>0</inventory_link>
                    <applications>
                        <application>
                            <name>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>ActiveMQ Total dequeue count</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;TotalDequeueCount&quot;]</key>
                    <delay>120</delay>
                    <history>7</history>
                    <trends>365</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>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>ActiveMQ Total enqueue count</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;TotalEnqueueCount&quot;]</key>
                    <delay>120</delay>
                    <history>7</history>
                    <trends>365</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>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
                <item>
                    <name>ActiveMQ Total message count</name>
                    <type>16</type>
                    <snmp_community/>
                    <multiplier>0</multiplier>
                    <snmp_oid/>
                    <key>jmx[&quot;{$JMX_DOMAIN_NAME}:BrokerName=localhost,Type=Broker&quot;,&quot;TotalMessageCount&quot;]</key>
                    <delay>120</delay>
                    <history>7</history>
                    <trends>365</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>ActiveMQ</name>
                        </application>
                    </applications>
                    <valuemap/>
                    <logtimefmt/>
                </item>
            </items>
            <discovery_rules/>
            <macros>
                <macro>
                    <macro>{$JMX_DOMAIN_NAME}</macro>
                    <value>org.apache.activemq</value>
                </macro>
                <macro>
                    <macro>{$JMX_PASSWORD}</macro>
                    <value/>
                </macro>
                <macro>
                    <macro>{$JMX_USERNAME}</macro>
                    <value/>
                </macro>
            </macros>
            <templates/>
            <screens/>
        </template>
    </templates>
    <triggers>
        <trigger>
            <expression>{JMX ActiveMQ:jmx[&quot;{$JMX_DOMAIN_NAME}:BrokerName=localhost,Type=Broker&quot;,&quot;TotalMessageCount&quot;].avg(5m)}&gt;500</expression>
            <name>ActiveMQ too many message waiting process</name>
            <url/>
            <status>0</status>
            <priority>5</priority>
            <description/>
            <type>0</type>
            <dependencies/>
        </trigger>
    </triggers>
    <graphs>
        <graph>
            <name>ActiveMQ numbers of message</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>1</sortorder>
                    <drawtype>0</drawtype>
                    <color>C80000</color>
                    <yaxisside>0</yaxisside>
                    <calc_fnc>2</calc_fnc>
                    <type>0</type>
                    <item>
                        <host>JMX ActiveMQ</host>
                        <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;TotalDequeueCount&quot;]</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>JMX ActiveMQ</host>
                        <key>jmx[&quot;org.apache.activemq:BrokerName=localhost,Type=Broker&quot;,&quot;TotalEnqueueCount&quot;]</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>JMX ActiveMQ</host>
                        <key>jmx[&quot;{$JMX_DOMAIN_NAME}:BrokerName=localhost,Type=Broker&quot;,&quot;TotalMessageCount&quot;]</key>
                    </item>
                </graph_item>
            </graph_items>
        </graph>
    </graphs>
</zabbix_export>

4、在服务端用mdline-jmxclient-0.10.3.jar查看各个键值

# java -jar cmdline-jmxclient-0.10.3.jar - 192.168.23.212:1616 org.apache.activemq:BrokerName=localhost,Type=Broker
Attributes:
 Slave: Slave broker. (type=boolean)
 BrokerName: The name of the broker. (type=java.lang.String)
 Persistent: Messages are synchronized to disk. (type=boolean)
 BrokerId: The unique id of the broker. (type=java.lang.String)
 Topics: Topics (broadcasted 'queues'); generally system information. (type=[Ljavax.management.ObjectName;)
 Queues: Standard Queues containing AIE messages. (type=[Ljavax.management.ObjectName;)
 TemporaryTopics: Temporary Topics; generally unused. (type=[Ljavax.management.ObjectName;)
 TemporaryQueues: Temporary Queues; generally temporary message response holders. (type=[Ljavax.management.ObjectName;)
 TopicSubscribers: Topic Subscribers (type=[Ljavax.management.ObjectName;)
 DurableTopicSubscribers: Durable (persistent) topic subscribers (type=[Ljavax.management.ObjectName;)
 QueueSubscribers: Queue Subscribers. (type=[Ljavax.management.ObjectName;)
 TemporaryTopicSubscribers: Temporary Topic Subscribers. (type=[Ljavax.management.ObjectName;)
 TemporaryQueueSubscribers: Temporary Queue Subscribers. (type=[Ljavax.management.ObjectName;)
 InactiveDurableTopicSubscribers: Inactive (disconnected persistent) topic subscribers (type=[Ljavax.management.ObjectName;)
 BrokerVersion: The version of the broker. (type=java.lang.String)
 TotalEnqueueCount: Number of messages that have been sent to the broker. (type=long)
 TotalDequeueCount: Number of messages that have been acknowledged on the broker. (type=long)
 TotalConsumerCount: Number of message consumers subscribed to destinations on the broker. (type=long)
 TotalMessageCount: Number of unacknowledged messages on the broker. (type=long)
 MemoryPercentUsage: Percent of memory limit used. (type=int)
 MemoryLimit: Memory limit, in bytes, used for holding undelivered messages before paging to temporary storage. (type=long)
 StoreLimit: Disk limit, in bytes, used for persistent messages before producers are blocked. (type=long)
 StorePercentUsage: Percent of store limit used. (type=int)
 TempLimit: Disk limit, in bytes, used for non-persistent messages and temporary date before producers are blocked. (type=long)
 TempPercentUsage: Percent of temp limit used. (type=int)
 StatisticsEnabled: Broker statistics enabled. (type=boolean)
 OpenWireURL: The url of the openwire connector (type=java.lang.String)
 StompURL: The url of the stomp connector (type=java.lang.String)
 SslURL: The url of the SSL connector (type=java.lang.String)
 StompSslURL: The url of the Stomp SSL connector (type=java.lang.String)
 VMURL: The url of the VM connector (type=java.lang.String)
 DataDirectory: The location of the data directory (type=java.lang.String)
 JMSJobScheduler: JMSJobScheduler (type=javax.management.ObjectName)
Operations:
 enableStatistics: Enable broker statistics.
  Parameters 0, return type=void
 addConnector: Adds a Connector to the broker.
  Parameters 1, return type=java.lang.String
   name=discoveryAddress type=java.lang.String 
 removeConnector: Removes a Connector from the broker.
  Parameters 1, return type=boolean
   name=connectorName type=java.lang.String 
 addNetworkConnector: Adds a Network Connector to the broker.
  Parameters 1, return type=java.lang.String
   name=discoveryAddress type=java.lang.String 
 removeNetworkConnector: Removes a Network Connector from the broker.
  Parameters 1, return type=boolean
   name=connectorName type=java.lang.String 
 stopGracefully: Poll for queues matching queueName are empty before stopping
  Parameters 4, return type=void
   name=p1 type=java.lang.String 
   name=p2 type=java.lang.String 
   name=p3 type=long 
   name=p4 type=long 
 resetStatistics: Reset all broker statistics.
  Parameters 0, return type=void
 disableStatistics: Disable broker statistics.
  Parameters 0, return type=void
 terminateJVM: Shuts down the JVM.
  Parameters 1, return type=void
   name=exitCode type=int 
 addTopic: Adds a Topic destination to the broker.
  Parameters 1, return type=void
   name=name type=java.lang.String 
 addQueue: Adds a Queue destination to the broker.
  Parameters 1, return type=void
   name=name type=java.lang.String 
 removeTopic: Removes a Topic destination from the broker.
  Parameters 1, return type=void
   name=name type=java.lang.String 
 removeQueue: Removes a Queue destination from the broker.
  Parameters 1, return type=void
   name=name type=java.lang.String 
 createDurableSubscriber: Creates a new durable topic subscriber.
  Parameters 4, return type=javax.management.ObjectName
   name=clientId type=java.lang.String 
   name=subscriberName type=java.lang.String 
   name=topicName type=java.lang.String 
   name=selector type=java.lang.String 
 destroyDurableSubscriber: Destroys a durable subscriber.
  Parameters 2, return type=void
   name=clientId type=java.lang.String 
   name=subscriberName type=java.lang.String 
 reloadLog4jProperties: Reloads log4j.properties from the classpath.
  Parameters 0, return type=void
 gc: Runs the Garbage Collector.
  Parameters 0, return type=void
 stop: Stop the broker and all its components.
  Parameters 0, return type=void
 start: Operation exposed for management
  Parameters 0, return type=void