《Zabbix 客户端安装》


安装环境:Centos7

#配置yum 源
echo '[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591' >/etc/yum.repos.d/zabbix.repo

#安装
yum install zabbix-agent -y

#修改配置文件/etc/zabbix/zabbix_agentd.conf

#定义客户端名称,服务器端的地址,请修改下面你的client_domain(客户端域名) ,your_zabbix_server_domain(服务器域名),110.110.110.110(服务器IP) 为实际的地址
client_domain=your_zabbix_client
sed -i "s/^Server=127.0.0.1/Server=your_zabbix_server_domain,110.110.110.110\/32/g" /etc/zabbix/zabbix_agentd.conf
sed -i "s/^ServerActive=127.0.0.1/ServerActive= your_zabbix_server_domain, 110.110.110.110\/32/g" /etc/zabbix/zabbix_agentd.conf
sed -i "s/^Hostname=Zabbix server/Hostname=$client_domain/g" /etc/zabbix/zabbix_agentd.conf
sed -i "s/^# Timeout=3/Timeout=30/g" /etc/zabbix/zabbix_agentd.conf

#启动zabbix-agent 并添加自动启动
systemctl start zabbix-agent
systemctl enable zabbix-agent

#需要本机防火墙开放10050端口
iptables -I INPUT -p tcp --dport 10050 -j ACCEPT