1.安装zabbix-agent
yum install zabbix-agent
2.配置zabbix-agent配置文件
默认在/etc/zabbix下
vim /etc/zabbix/zabbix_agentd.conf
# 被动监控
Server=zabbix-server的ip
# 主动监控
ServerActive=zabbix-server的ip
# 要和再zabbix前端配置的hostname保持一致
Hostname=自定义主机名
重启zabbix-agent
systemctl start zabbix_agent.service
设置开机自启
systemctl enable zabbix_agent.service
查看agent的状态(running代表已启动)
systemctl status zabbix_agent.service
查看agnet的log日志
tailf /var/log/zabbix/zabbix_agentd.log
会出现
no active checks on server [zabbix-server的ip:10051]: host [你的主机名] not found
接下来配置zabbix前端
3.配置zabbix前端添加host
点击create host
将zabbix_agentd.conf配置文件的Hostname填入Host name中,ip修改为agent的ip,添加即可