客戶端zabbix-agent2安裝


1CentOS 8解決yum不能更新源問題

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
sed -i 's/$releasever/8/g' /etc/yum.repos.d/CentOS-Base.repo
yum clean all #清理緩存
yum makecache #更新源

2配置源:

[root@nfs01 ~]#getenforce
Enforcing
[root@nfs01 ~]#setenforce 0
[root@nfs01 ~]#getenforce
Permissive
[root@nfs01 ~]#sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
[root@nfs01 ~]#rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm

3安裝:

yum install zabbix-agent2 -y
[root@nfs01 ~]#rpm -ql zabbix-agent2
/etc/zabbix/zabbix_agent2.conf #默認配置文件
/usr/sbin/zabbix_agent2 #默認二進制文件
/var/log/zabbix #日志
/var/run/zabbix #運行路徑

 4配置文件說明:

[root@nfs01 ~]#egrep -v '^#|^$' /etc/zabbix/zabbix_agent2.conf
PidFile=/var/run/zabbix/zabbix_agent2.pid #進路進程號的pid文件
LogFile=/var/log/zabbix/zabbix_agent2.log #日志
LogFileSize=0 #0表示不開啟滾動切割
Server=127.0.0.1 #配置服務端ip
ServerActive=127.0.0.1 #主動注冊服務端
Hostname=Zabbix server #和zabix頁面的中的hostname必須一致
Include=/etc/zabbix/zabbix_agent2.d/*.conf #包含目錄內的配置文件同時生效
ControlSocket=/tmp/agent.sock #指定sock文件位置
[root@nfs01 ~]#

 

[root@laiyue /etc/zabbix]#ls
zabbix_agent2.conf  zabbix_agent2.d
[root@laiyue /etc/zabbix]#vim zabbix_agent2.conf
[root@laiyue /etc/zabbix]#systemctl restart zabbix-agent2

#確保以下三個值配置正確,其中IP值不僅僅是指server端的地址,而是
#Incoming connections will be accepted only from the hosts listed here
#也就是說,除了下面列出的地址以外,誰也無法與agent端建立連接
Server=IP
ServerActive=IP
Hostname=Zabbix server

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM