> ## 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.15. exchage邮箱

# 1、创建脚本queue.ps1

进入C:\Program Files\ZABBIX\_AGENT3\script创建队列脚本queue.ps1

```text theme={null}
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
$server = "BJMX01"
$queue = (get-queue -server $server |Measure-Object -Property messagecount -sum).sume
cho $queue
```

# 2、创建脚本dag.ps1

进入C:\Program Files\ZABBIX\_AGENT3\script创建DAG脚本dag.ps1

````text theme={null}
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
$server="bjmx11"$status=Get-MailboxDatabaseCopyStatus -Server
$server |foreach {$_.status}
if ($status | where-object{$_ -notmatch "Healthy|Mounted" -and $_ -ne""} )
{
echo 1
}
else
{
echo 0
}
 ```
# 3、添加配置conf文件
````

### 3、Exchange

UserParameter= queue.num,C:\Program Files\ZABBIX\_AGENT3\script\queue.ps1 UserParameter= dag.mount,C:\Program Files\ZABBIX\_AGENT3\script\dag.ps1 \\\\

# 4、重启Agent服务
