zabbix 安装和启动报错处理
·
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 problem
You 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
EOF
chmod +x ~/zabbix_agent.sh
bash ~/zabbix_agent.sh
sleep 2s
netstat -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 Agent
Loaded: 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 ago
Process: 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
非root用户可能看不到该报错
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,后创建对应软连接。
libssl.so.1.0.2k
链接:https://pan.baidu.com/s/12s_SnO91vxvoxytcvfUSDA?pwd=a6oi
提取码:a6oi
libcrypto.so.1.0.2k
链接:https://pan.baidu.com/s/16StMlGmlsbK5OZUzxMRpmQ?pwd=q8yp
提取码:q8yp
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
agent 启动报错
agent重启失败
systemctl status zabbix-agent
journalctl -xeu zabbix-agent.service
报错一
zabbix_agentd [8097]: cannot create PID file [/var/run/zabbix/zabbix_agentd.pid]: [13] Permission denied
zabbix_agentd [8109]: cannot create PID file [/var/run/zabbix/zabbix_agentd.pid]: [13] Permission denied
zabbix_agentd [8161]: cannot create PID file [/var/run/zabbix/zabbix_agentd.pid]: [13] Permission denied
zabbix_agentd [8173]: cannot create PID file [/var/run/zabbix/zabbix_agentd.pid]: [13] Permission denied
zabbix_agentd [8185]: cannot create PID file [/var/run/zabbix/zabbix_agentd.pid]: [13] Permission denied
报错二
Jul 10 00:56:43 VM-10-7-ubuntu systemd[1]: zabbix-agent.service: Can't open PID file /run/zabbix/zabbix_agentd.pid (yet?) after start: Operation not permitted
Jul 10 00:56:43 VM-10-7-ubuntu systemd[1]: zabbix-agent.service: Failed with result 'protocol'.
执行如下命令
mkdir -p /var/run/zabbix/
chown zabbix.zabbix /var/run/zabbix/
systemctl restart zabbix-agent.service
更多推荐


所有评论(0)