# 10.8 activemq监控

## 关闭被监控端的防火墙

activemq 防火墙的添加还是有问题，先把防火墙给关了，它好像是后续会再产生一个随机端口，进行数据的传输

## zabbix\_proxy安装java\_gateway，

因为是基于JMX进行监控的

## 修改配置文件

配置`./apache-activemq-5.11.1/conf/activemq.xml`

修改broker字段： 增加useJmx="true"

```
<broker useJmx="true" xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">
```

修改broken字段内的managementContext节点：

```
<managementContext>
            <managementContext createConnector="true" connectorPort="11099"/>
</managementContext>
```

配置./apache-activemq-5.11.1/bin/activemq

在脚本最后添加：

```
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

> 增加的方式不对，添加上以后密码还是为空，后续有空查一下原因

## 导入模板

在zabbix\_web中导入zbx\_activemq目录下的xml文件

在被监控主机上增加宏设置 加入{$JMX\_PASSWORD}，和{$JMX\_USERNAME}，user为admin，pass为activemq


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.clay-wangzhi.com/10-zabbix/10.8-activemq-jian-kong.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
