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

發佈了49 篇原創文章 · 獲贊 12 · 訪問量 6萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章