传送门 --->
Zabbix 5.0监控平台搭建与被监控端的添加
一、被监控端Mysql主机安装Zabbix-agent
永久关闭防火墙
[root@localhost ~]# systemctl stop firewalld [root@localhost ~]# systemctl disable firewalld //永久关闭防火墙
Zabbix-agent 5.0下载
注意:
如果下载的zabbix-agent 5.0安装包使用rpm
安装时提示“错误:依赖检测失败:libpcre.so.0()(64bit)
”,则可以使用zabbix 5.0 Yum源来安装zabbix-agent 5.0软件。
----> 传送门
安装zabbix-agent5.0 报错解决
1.安装Zabbix Yum源仓库
[root@localhost ~]# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm [root@localhost ~]# yum clean all
使用Zabbix 5.0 Yum源文件安装zabbix-agent 5.0软件,并且将gpgcheck=1修改为gpgcheck=0,防止出现“获取GPG密钥失败”报错。
2.修改Zabbix 5.0 Yum源配置文件
[root@localhost ~]# sed -i "s/gpgcheck=1/gpgcheck=0/g" /etc/yum.repos.d/zabbix.repo [root@localhost ~]# cat /etc/yum.repos.d/zabbix.repo [zabbix] name=Zabbix Official Repository - $basearch baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/ enabled=1 gpgcheck=0 //修改gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591 [zabbix-frontend] name=Zabbix Official Repository frontend - $basearch baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/frontend enabled=1 gpgcheck=0 //修改gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591 [zabbix-debuginfo] name=Zabbix Official Repository debuginfo - $basearch baseurl=http://repo.zabbix.com/zabbix/5.0/rhel/7/$basearch/debuginfo/ enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591 gpgcheck=0 //修改gpgcheck=0 [zabbix-non-supported] name=Zabbix Official Repository non-supported - $basearch baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/ enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX gpgcheck=0 //修改gpgcheck=0 [root@localhost ~]# yum -y install zabbix-agent //安装zabbix-agent 5.0软件 ... 已安装: zabbix-agent.x86_64 0:5.0.0-1.el7 完毕!
3.修改zabbix-agent配置文件
[root@localhost ~]# vim /etc/zabbix/zabbix_agentd.conf 119 Server=127.0.0.1,192.168.2.128 //Zabbix-server地址,多个用","隔开 160 ServerActive=192.168.2.128 //主动检查本主机数据发送给Zabbix-server 171 #Hostname=Zabbix server 172 Hostname=192.168.2.129 //客户端IP地址 [root@localhost ~]# systemctl start zabbix-agent [root@localhost ~]# systemctl enable zabbix-agent [root@localhost ~]# ss -antulp | grep :10050 tcp LISTEN 0 128 *:10050 *:* users:(("zabbix_agentd",pid=3389,fd=4),("zabbix_agentd",pid=3388,fd=4),("zabbix_agentd",pid=3387,fd=4),("zabbix_agentd",pid=3386,fd=4),("zabbix_agentd",pid=3385,fd=4),("zabbix_agentd",pid=3384,fd=4)) tcp LISTEN 0 128 :::10050 :::* users: