Docs/Zabbix/自定义监控.md

25 lines
No EOL
600 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

zabbix_agent配置文件中添加键值
```shell
# 固定写法
# key表示键值名字命名最好为单词+"."
# cmd 表示命令或脚本
UserParamter=key,cmd
# 如
# UserParamter=check.nginx,ss -anlutp | grep -w 80 | wc -l
```
客户端测试
```shell
# 客户端需要重启
zabbix_agent2 -t key
# 如
# zabbix_agent2 -t check.ginx
```
服务端测试
```shell
# 服务端需要安装zabbix-get
zabbix-get -s host -p port -k key
# 如
# zabbix-get -s 10.100.2.31 -p 10050 -k check.nginx
```
web配置
主机-创建监控项-类型为zabbix客户端, 键值配置为zabbix-agent中配置的值