zabbix监控进程、日志文件
自定义监控进程
-
写脚本,脚本放统一位置
-
修改被监控端zabbix_agentd.conf配置文件
UnxsafeParameters=1 UnserParameter=<key>,<command>
-
重启zabbix agent
-
在web界面配置监控项和触发器
修改客户端的zabbix_agentd.conf文件
[root@agent etc]# pwd
/usr/local/etc
[root@agent etc]# vim zabbix_agentd.conf
UnsafeUserParameters=1 #默认为0。修改为1,打开自定义监控功能
······
UserParameter=check_process[*],/home/zabbix/check_process.sh $1
[root@agent etc]# pkill zabbix
[root@agent etc]# ss -antl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 0.0.0.0:10050 0.0.0.0:*
LISTEN 0 128 0.0.0.0:111 0.0.0.0:*
LISTEN 0 32 192.168.122.1:53 0.0.0.0:*
LISTEN 0 128 0.0.0.0:22 0.0