美文网首页
zabbix5.0在客户端服务器上安装zabbix agent

zabbix5.0在客户端服务器上安装zabbix agent

作者: 无味wy | 来源:发表于2021-08-17 12:00 被阅读0次
  1. 基础准备工作
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
 
hostnamectl set-hostname zbxserver
 
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

安装zabbix

rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm

修改zabbix源地址为阿里云的zabbix镜像地址

vi /etc/yum.repos.d/zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
 
[zabbix-frontend]
name=Zabbix Official Repository frontend - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/frontend
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
 
[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.0/rhel/7/x86_64/debuginfo/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=0
 
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/x86_64/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=0
  1. centos客户端服务器上安装 zabbix agent程序
yum install zabbix-agent -y
  1. 修改agent的配置文件zabbix_agentd.conf
cp /etc/zabbix/zabbix_agentd.conf{,.bak}
vim /etc/zabbix/zabbix_agentd.conf
#修改 【Server=127.0.0.1】 修改为 【Server=10.0.0.110】,注:这里写zabbix server 的ip地址

#修改 【ServerActive=127.0.0.1】 修改为 【ServerActive=10.0.0.110,注,这里写zabbix server 的ip地址

#修改【Hostname=Zabbix server】 修改为 【Hostname=zabbix】,注:可随便写
  1. 重启 zabbix agent服务,并设置为开机自启
systemctl restart zabbix-agent.service 
systemctl enable zabbix-agent.service
  1. 检验客户端的agent是否安装成功
[root@zbxclient101 ~]# netstat -ntlup |grep zabbix
tcp        0      0 0.0.0.0:10050           0.0.0.0:*               LISTEN      21215/zabbix_agentd 
tcp6       0      0 :::10050                :::*                    LISTEN      21215/zabbix_agentd 

#zabbix agent用的端口默认是10050,这点非常重要

相关文章

网友评论

      本文标题:zabbix5.0在客户端服务器上安装zabbix agent

      本文链接:https://www.haomeiwen.com/subject/cunbbltx.html