1.安装
[root@Zabbix ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
[root@Zabbix ~]# yum install zabbix-agent -y
2.配置zabbix_agentd.conf
[root@Zabbix ~]# egrep -v '^#|^$' /etc/zabbix/zabbix_agentd.conf
PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=127.0.0.1 #被动模式服务器IP
ServerActive=127.0.0.1 #主动模式服务器IP
Hostname=Zabbix server #本机主机名,主动模式必须配置,需确保与web中的主机名保持一致
Include=/etc/zabbix/zabbix_agentd.d/*.conf
3.启动服务
[root@Zabbix ~]# systemctl start zabbix-agent
[root@Zabbix ~]# systemctl enable zabbix-agent