一、安装 zabbix-agent
Zabbix(一)Zabbix 5.0 LTS 版本搭建,这篇文章最后已经介绍过安装 agent。
- CentOS
下载 rpm 源
rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
修改源地址
sed -i 's#http://repo.zabbix.com#https://mirrors.aliyun.com/zabbix#' /etc/yum.repos.d/zabbix.repo
安装 zabbix-agent
yum clean all && yum install -y zabbix-agent
修改配置文件
sed -i "s/Server=127.0.0.1/Server=${zabbix_server_ip}/g" /etc/zabbix/zabbix_agentd.conf
sed -i "s/ServerActive=127.0.0.1/ServerActive=${zabbix_server_ip}/g" /etc/zabbix/zabbix_agentd.conf
sed -i "s/Hostname=Zabbix server/Hostname=${hostname}/g" /etc/zabbix/zabbix_agentd.conf
启动
systemctl start zabbix-agent.service && systemctl enable zabbix-agent.service
- Ubuntu
下载 deb 源
wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+focal_all.deb
加载 deb 源
dpkg -i zabbix-release_5.0-1+focal_all.deb
安装 zabbix-agent
apt install zabbix-agent
修改配置文件
sed -i "s/Server=127.0.0.1/Server=${zabbix_server_ip}/g" /etc/zabbix/zabbix_agentd.conf
sed -i "s/ServerActive=127.0.0.1/ServerActive=${zabbix_server_ip}/g" /etc/zabbix/zabbix_agentd.conf
sed -i "s/Hostname=Zabbix server/Hostname=${hostname}/g" /etc/zabbix/zabbix_agentd.conf
启动
systemctl start zabbix-agent.service && systemctl enable zabbix-agent.service
- Windows
下载安装包
https://cdn.zabbix.com/zabbix/binaries/stable/5.0/5.0.20/zabbix_agent-5.0.20-windows-amd64-openssl.msi
二、在管理页面添加主机
1、添加主机
2、添加模版
再次查看主机列表,已经添加成功
将所有主机添加进来,确保可用性为 ZBX 绿色