Centos7.7 二進制文件安裝使用 Zabbix5.0(zabbix-agent)


一、配置阿里雲yum源

[root@zabbix2 ~]# curl -o /etc/yum.repos.d/epel.repos http://mirrors.aliyun.com/repo/epel-7.repo
[root@zabbix2 ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

二、Zabbix5.0 YUM源

[root@zabbix2 ~]# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm

Zabbix5.0 YUM源切換到阿里

[root@zabbix2 ~]# vim /etc/yum.repos.d/zabbix.repo
%s#repo.zabbix.com#mirrors.aliyun.com/zabbix#g
[root@zabbix2 ~]# yum clean all
[root@zabbix2 ~]# yum makecache

三、安裝 Zabbix agent

[root@zabbix2 ~]# yum install zabbix-agent -y

四、修改配置文件

[root@zabbix2 ~]# vim /etc/zabbix/zabbix_agentd.conf

PidFile=/var/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
DebugLevel=3
Server=192.168.161.200
ListenPort=10050
ListenIP=192.168.161.201
ServerActive=192.168.161.200
Hostname=192.168.161.201
Include=/etc/zabbix/zabbix_agentd.d/*.conf
# UserParameter

說明:

  • PidFile:Pid
  • LogFile:日誌文件
  • DebugLevel:日誌級別
  • Server:zabbix server 的地址
  • ListenPort:nginx的地址 默認10050
  • ListenIP:自己的ip
  • ServerActive:主動將自己的作業給到server 的ip
  • Hostname:agent的主機名/ip
  • Include :包含的配置文件

五、測試是否成功加入agent(在server端檢查)

5.1 安裝 zabbix-get

[root@zabbix1 ~]# yum list all | grep zabbix

在這裏插入圖片描述

[root@zabbix1 ~]# yum install zabbix-get.x86_64

# 在 zabbix 服務器端檢查
[root@zabbix1 ~]# zabbix_get -s 192.168.161.201 -p10050 -k "system.hostname"
zabbix2
[root@zabbix1 ~]# zabbix_get -s 192.168.161.201 -p 10050 -k "system.cpu.load"
0.040000
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章