> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lwops.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# 2.1.7. WebSphere MQ配置

#### 2.1.7.1. windows系统

1、功能实现：采用powershell编写脚本，直接调用系统命令获取参数 window页面状态： 队列管理器状态信息

![2.1.7. WebSphere MQ配置 操作截图 1](https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/webspheremq/image-01.png)

队列深度状态信息

![2.1.7. WebSphere MQ配置 操作截图 2](https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/webspheremq/image-02.png)

2、powershell命令行获取系统信息：

队列管理器状态

队列深度

3、ps1脚本内容： MQ\_mqm.ps1(获取队列管理器状态，输出json)

#### 2.1.7.2. linux系统

1、配置zabbix\_agentd进程账户具有runmqsc、dspmq命令的执行权限，不然可能出现监控项没有数据的情况： a)配置zabbix\_agentd进程使用websphere mq用户mqm（或其他自定义用户）启动

```plain theme={null}
# vim /etc/zabbix/zabbix_agentd.confUser=mqm
```

![2.1.7. WebSphere MQ配置 操作截图 3](https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/webspheremq/image-03.png)

b)给予监控用户sudo mqm 的权限

```plain theme={null}
# vim /etc/sudoersmonitor ALL=(mqm) NOPASSWD:     /opt/mqm/bin/dspmq,/opt/mqm/bin/runmqsc
```

![2.1.7. WebSphere MQ配置 操作截图 4](https://lwweb.oss-cn-shenzhen.aliyuncs.com/docs/images/yuque/webspheremq/image-04.png)

2、配置agent文件

上传mqm.zip文件到客户端系统/tmp目录下

解压脚本至zabbix程序目录下

```plain theme={null}
# unzip /tmp/mqm.zip -d /etc/zabbix/zabbix_agentd.d/scripts/
# mv /etc/zabbix/zabbix_agentd.d/scripts/webspheremq.conf /etc/zabbix/zabbix_agentd.d
# chmod +x /etc/zabbix/zabbix_agentd.d/scripts/*sh
```

3、重启agent

```plain theme={null}
# service zabbix-agent restart
```
