【linux-zabbix】zabbix-agent启动报错:Daemon never wrote its PID file. Failing.

背景:

发现有部分的agent失联,排查发现机器正常,agent没起来。

排查日志发现:

# journalctl -xe
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit zabbix-agent.service has begun starting up.
8月 02 17:59:43 gz-cs-gpu-3-104 systemd[1]: Can't open PID file /run/zabbix/zabbix_agentd.pid (yet?) after start: No such file or directory
8月 02 17:59:43 gz-cs-gpu-3-104 zabbix_agentd[30933]: zabbix_agentd [30942]: cannot open "/var/log/zabbix/zabbix_agentd.log": [2] No such file or directory
8月 02 17:59:43 gz-cs-gpu-3-104 systemd[1]: Daemon never wrote its PID file. Failing.
8月 02 17:59:43 gz-cs-gpu-3-104 systemd[1]: Failed to start Zabbix Agent.
-- Subject: Unit zabbix-agent.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit zabbix-agent.service has failed.
-- 
-- The result is failed.
8月 02 17:59:43 gz-cs-gpu-3-104 systemd[1]: Unit zabbix-agent.service entered failed state.
8月 02 17:59:43 gz-cs-gpu-3-104 systemd[1]: zabbix-agent.service failed.
8月 02 17:59:46 gz-cs-gpu-3-104 systemd[1]: Removed slice User Slice of zabbix.
-- Subject: Unit user-996.slice has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit user-996.slice has finished shutting down.
8月 02 17:59:46 gz-cs-gpu-3-104 kubelet[3101]: E0802 17:59:46.702184    3101 dns.go:157] "Nameserver limits exceeded" err="Nameserver limits were exceeded, some nameservers have been omitted, the applied 
8月 02 17:59:48 gz-cs-gpu-3-104 polkitd[1365]: Registered Authentication Agent for unix-process:31997:1381929198 (system bus name :1.1999165 [/usr/bin/pkttyagent --notify-fd 5 --fallback], object path /or
8月 02 17:59:48 gz-cs-gpu-3-104 systemd[1]: Stopped Zabbix Agent.
-- Subject: Unit zabbix-agent.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit zabbix-agent.service has finished shutting down.
8月 02 17:59:48 gz-cs-gpu-3-104 systemd[1]: Starting Zabbix Agent...
-- Subject: Unit zabbix-agent.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit zabbix-agent.service has begun starting up.
8月 02 17:59:48 gz-cs-gpu-3-104 systemd[1]: Can't open PID file /run/zabbix/zabbix_agentd.pid (yet?) after start: No such file or directory
8月 02 17:59:48 gz-cs-gpu-3-104 zabbix_agentd[32011]: zabbix_agentd [32013]: cannot open "/var/log/zabbix/zabbix_agentd.log": [2] No such file or directory
8月 02 17:59:48 gz-cs-gpu-3-104 systemd[1]: Daemon never wrote its PID file. Failing.
8月 02 17:59:48 gz-cs-gpu-3-104 systemd[1]: Failed to start Zabbix Agent.

发现是没有权限创建log文件,这个log文件是配置文件指定,要提前创建目录和文件以及权限所属配置zabbix,我这里是/var/log/zabbix/zabbix_agentd.log

mkdir /var/log/zabbix && touch /var/log/zabbix/zabbix_agentd.log && chown -R zabbix:zabbix /var/log/zabbix

systemctl restart zabbix-agent

你可能感兴趣的:(linux,监控,linux,zabbix,数据库)