centos7安裝zabbix-agent

```手工安裝法

關閉SELinux

sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
setenforce 0

防火牆設置,容許zabbix-agent的10050端口經過

firewall-cmd --permanent --add-port=10050/tcp
firewall-cmd --reload

固然。你也能夠關閉防火牆:
systemctl stop firewalld
systemctl disable firewalld

安裝zabbix 軟件源

rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm

安裝zabbix-agent

yum install zabbix-sender zabbix-agent zabbix-get

這裏若是報錯建議多試幾回,多是網絡很差或者rp太差,親測是能夠用的。

在 /etc/zabbix/zabbix_agentd.conf 中更改:

Server=<zbx-server的ip>
ServerActive=<zbx-server的ip>
Hostname=<本機的名字>

設置啓動和開機項

systemctl start zabbix-agent.service
systemctl enable zabbix-agent.service

自動安裝、批量安裝

使用ansible進行操做,ansible相關請見筆者博文。代碼地址https://github.com/lyjason/ansible/tree/master/zabbix
相關文章
相關標籤/搜索