我是 zabbix 的新手,我正在尝试创建自定义用户参数来监控每个进程的 CPU 实用程序(Windows 机器)。
我有一个 powershell 脚本和一个用户参数,我还在 zabbix -> 配置 -> 主机下添加了一个新项目,但我一直得到不支持的状态,并且我用完了潜在的博客/解决方案来帮助我。
有没有人知道我错过了什么/做错了什么?
我的用户参数:UserParameter=checkcpuperprocess[*], C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -file C:\Zabbix\conf\CPUperProc.ps1
我的PowerShell脚本:
$properties=@(
@{Name="Process Name"; Expression = {$_.name}},
@{Name="CPU (%)"; Expression = {$_.PercentProcessorTime}},
@{Name="Memory (MB)"; Expression = {[Math]::Round(($_.workingSetPrivate / 1mb),2)}}
)
Get-WmiObject -class Win32_PerfFormattedData_PerfProc_Process |
Select-Object $properties |
Format-Table -AutoSize