agent服务端配置
自定义监控项脚本
# 文件路径: C:\zabbix_agent2-6.0.4-windows-amd64-static\conf\a.bat
@echo off
setlocal
set "processName=o2Popper.exe"
tasklist /FI "IMAGENAME eq %processName%" 2>NUL | find /I /N "%processName%">NULL
if %ERRORLEVEL% ==0 (
echo 1
) else (
echo 0
)
endlocal
修改zabbix-agent2配置文件
...
### Option: UserParameter
# User-defined parameter to monitor. There can be several user-defined parameters.
# Format: UserParameter=<key>,<shell command>
# See 'zabbix_agentd' directory for examples.
#
# Mandatory: no
# Default:
UserParameter=o2Popper.status,cmd /c C:\zabbix_agent2-6.0.4-windows-amd64-static\conf\a.bat
...
登录到zabbix proxy进行测试
zabbix_get -s "10.171.211.15" -p 10050 -k "o2Popper.status"
# 1
Web页面配置
创建监控项