@[toc]
# 安装agent
[root@Zabbix-server ~]# yum install zabbix-agent.x86_64 -y
# 设置开机启动
[root@Zabbix-server ~]# systemctl enable zabbix-agent
# 启动agent
[root@Zabbix-server ~]# systemctl start zabbix-agent
# 查看默认启动的端口
[root@Zabbix-server ~]# netstat -tunlp|grep 1005
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 9903/zabbix_agentd
tcp6 0 0 :::10050 :::* LISTEN 9903/zabbix_agentd
# 下载rpm包
[root@agent ~]# axel https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-agent-4.0.20-1.el7.x86_64.rpm
# 安装agent
[root@agent ~]# rpm -ivh zabbix-agent-4.0.20-1.el7.x86_64.rpm
# 修改agent配置文件,将Server=127.0.0.1修改为10.0.0.2
[root@agent ~]# vim /etc/zabbix/zabbix_agentd.conf
# 启动zabbix-agent
[root@agent ~]# systemctl enable zabbix-agent
[root@agent ~]# systemctl start zabbix-agent