- 基础准备工作
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
- 在
centos
客户端服务器上安装zabbix agent
程序
yum install zabbix-agent -y
- 修改
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】,注:可随便写
- 重启
zabbix agent
服务,并设置为开机自启
systemctl restart zabbix-agent.service
systemctl enable zabbix-agent.service
- 检验客户端的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,这点非常重要
网友评论