zabbix agent service failed, PID not readable

perigee picture perigee · Oct 7, 2016 · Viewed 17.3k times · Source

I'm trying to run zabbix-agent 3.0.4 on CentOS7, systemd failed to start the zabbix agent, from journalctl -xe

PID file /run/zabbix/zabbix_agentd.pid not readable (yes?) after start. node=localhost.localdomain type=SERVICE_START msg=audit(1475848200.601:17994): pid=1 uid=0 auid=4294967298 ses=... zabbix-agent.service never wrote its PID file. Failing. Failed to start Zabbix Agent.

There is no permission error, and I try to re-configure the PID path to /tmp folder in zabbix-agent.service and zabbix_agentd.conf, it doesn't work.

Very weird, anyone has idea? Thank you in advance.

=====

Investigating a little bit, the PID should be under /run/zabbix folder, I create manually the zabbix_agentd.pid, and it disappears after 1 second. Really weird.

Answer

user2398069 picture user2398069 · Jan 1, 2017

I had the same issue and it was related to selinux. So I allowed zabbix_agent_t via semanage

 yum install policycoreutils-python 

 semanage permissive -a zabbix_agent_t