监控 Apache ActiveMQ 消息中间件
对 Apache ActiveMQ 消息中间件的运行状态,节点,Topic等相关指标进行监测。
使用协议:JMX
监控前操作
您需要在 ActiveMQ 开启
JMX服务,HertzBeat 使用 JMX 协议对 ActiveMQ 进行指标采集。
-
修改安装目录下的
conf/activemq.xml文件,开启JMX在
broker标签中添加userJmx="true"属性<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" useJmx="true">
<!-- others -->
</broker> -
修改安装目录下的
bin/env文件,配置JMX 端口 IP等将如下原配置信息
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port=11099"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=`ACTIVEMQ_CONF`/jmx.password"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=`ACTIVEMQ_CONF`/jmx.access"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"更新为如下配置,⚠️注意修改
本机对外IP# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.password.file=`ACTIVEMQ_CONF`/jmx.password"
# ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.access.file=`ACTIVEMQ_CONF`/jmx.access"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port=11099"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.authenticate=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Djava.rmi.server.hostname=本机对外IP"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote" -
重启 ACTIVEMQ 服务,在 HertzBeat 添加对应 ActiveMQ 监控即可,参数使用 JMX 配置的 IP 端口。
配置参数
| 参数名称 | 参数帮助描述 |
|---|---|
| 监控Host | 被监控的对端IPV4,IPV6或域名。注意⚠️不带协议头(eg: https://, http://)。 |
| 任务名称 | 标识此监控的名称,名称需要保证唯一性。 |
| JMX端口 | JMX 对外提供的HTTP端口,默认为 11099。 |
| JMX URL | 可选,自定义 JMX URL 连接 |
| 用户名 | 认证时使用的用户名 |
| 密码 | 认证时使用的密码 |
| 采集间隔 | 监控周期性采集数据间隔时间,单位秒,可设置的最小间隔为30秒 |
| 是否探测 | 新增监控前是否先探测检查监控可用性,探测成功才会继续新增修改操作 |
| 描述备注 | 更多标识和描述此监控的备注信息,用户可以在这里备注信息 |
采集指标
指标 集合:broker
| 指标名称 | 指标单位 | 指标帮助描述 |
|---|---|---|
| BrokerName | 无 | The name of the broker. |
| BrokerVersion | 无 | The version of the broker. |
| Uptime | 无 | Uptime of the broker. |
| UptimeMillis | ms | Uptime of the broker in milliseconds. |
| Persistent | 无 | Messages are synchronized to disk. |
| MemoryPercentUsage | % | Percent of memory limit used. |
| StorePercentUsage | % | Percent of store limit used. |
| TempPercentUsage | % | Percent of temp limit used. |
| CurrentConnectionsCount | 无 | Attribute exposed for management |
| TotalConnectionsCount | 无 | Attribute exposed for management |
| TotalEnqueueCount | 无 | Number of messages that have been sent to the broker. |
| TotalDequeueCount | 无 | Number of messages that have been acknowledged on the broker. |
| TotalConsumerCount | 无 | Number of message consumers subscribed to destinations on the broker. |
| TotalProducerCount | 无 | Number of message producers active on destinations on the broker. |
| TotalMessageCount | 无 | Number of unacknowledged messages on the broker. |
| AverageMessageSize | 无 | Average message size on this broker |
| MaxMessageSize | 无 | Max message size on this broker |
| MinMessageSize | 无 | Min message size on this broker |