zabbix 安装报错处理
- yum安装agent或者proxy报错
- 解决办法,yum源取消检查配置
- 对已经安装好的zabbix 报错
- 解决办法
yum安装agent或者proxy报错
配置官方源
rpm -ivh https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-1.el7.noarch.rpm
yum安装报错: Processing Dependency: libpcre.so.0()(64bit) for package: zabbix-agent-4.2.8-1.el6.x86_64
[root@cdp-qa-gpsegment ~]# yum install zabbix-agent
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package zabbix-agent.x86_64 0:4.2.8-1.el6 will be installed
--> Processing Dependency: libpcre.so.0()(64bit) for package: zabbix-agent-4.2.8-1.el6.x86_64
--> Processing Conflict: zabbix6.0-agent-6.0.25-1.el7.x86_64 conflicts zabbix-agent < 6.0
--> Finished Dependency Resolution
Error: zabbix6.0-agent conflicts with zabbix-agent-4.2.8-1.el6.x86_64
Error: Package: zabbix-agent-4.2.8-1.el6.x86_64 (zabbix)Requires: libpcre.so.0()(64bit)You could try using --skip-broken to work around the problemYou could try running: rpm -Va --nofiles --nodigest
解决办法,yum源取消检查配置
yum源取消检查配置
gpgcheck=1 #改为0
cat > /etc/yum.repos.d/zabbix.repo <<'EOF'
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://repo.zabbix.com/zabbix/4.2/rhel/8/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://repo.zabbix.com/non-supported/rhel/8/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1
EOF
cat > ~/zabbix_agent.sh <<'EOF'
#!/bin/bash
proxy_ip="10.0.0.1"
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
setenforce 0
yum -y install zabbix-agent.x86_64
name=`hostname`
sed -i s'/Hostname=Zabbix server/Hostname='$name'/' /etc/zabbix/zabbix_agentd.conf
sed -i s'/Server=127.0.0.1/Server=127.0.0.1,'$proxy_ip'/' /etc/zabbix/zabbix_agentd.conf
sed -i s'/ServerActive=127.0.0.1/ServerActive='$proxy_ip'/' /etc/zabbix/zabbix_agentd.conf
systemctl enable zabbix-agent
systemctl start zabbix-agent
echo "EnableRemoteCommands=1" >>/etc/zabbix/zabbix_agentd.conf
EOFchmod +x ~/zabbix_agent.sh
bash ~/zabbix_agent.sh
sleep 2snetstat -anltup | grep zabbix
cat /etc/zabbix/zabbix_agentd.conf | grep -v "#" | awk NF
对已经安装好的zabbix 报错
查看状态是activating,但是没有相关进程和端口占用
[root@iZuf6ex0h6m4cv4z9ehz47Z lib64]# systemctl status zabbix-agent.service
● zabbix-agent.service - Zabbix AgentLoaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: enabled)Active: activating (auto-restart) (Result: exit-code) since Thu 2024-01-25 14:51:24 CST; 5s agoProcess: 2842835 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=127)
[root@iZuf6ex0h6m4cv4z9ehz47Z lib64]# netstat -anltup | grep 10050
[root@iZuf6ex0h6m4cv4z9ehz47Z lib64]# ps -ef | grep zabbix
root 2842995 2839275 0 14:51 pts/0 00:00:00 grep --color=auto zabbix
journalctl -xe
发下报错: error while loading shared libraries: libcrypto.so.10: cannot open shared object file: No such file or directory
Jan 25 14:52:07 iZuf6ex0h6m4cv4z9ehz47Z zabbix_agentd[2843206]: /usr/sbin/zabbix_agentd: error while loading shared libraries: libcrypto.so.10: cannot open shared object file: No such file or directory
Jan 25 14:52:07 iZuf6ex0h6m4cv4z9ehz47Z systemd[1]: zabbix-agent.service: Control process exited, code=exited status=127
Jan 25 14:52:07 iZuf6ex0h6m4cv4z9ehz47Z systemd[1]: zabbix-agent.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- The unit zabbix-agent.service has entered the 'failed' state with result 'exit-code'.
Jan 25 14:52:07 iZuf6ex0h6m4cv4z9ehz47Z systemd[1]: Failed to start Zabbix Agent.
-- Subject: Unit zabbix-agent.service has failed
-- Defined-By: systemd
-- Support: https://access.redhat.com/support
--
-- Unit zabbix-agent.service has failed.
--
-- The result is failed.
解决办法
从其他正常的服务器获取对应lib文件,下载后上传到/usr/lib64 下,权限赋予0755,后创建对应软连接。
cd /usr/lib64
chmod 755 libssl.so.1.0.2k
chmod 755 libcrypto.so.1.0.2k
ln -s libssl.so.1.0.2k libssl.so.10
ln -s libcrypto.so.1.0.2k libcrypto.so.10
ldconfig -v
systemctl restart zabbix-agent
systemctl status zabbix-agent