Centos 7 – Zabbix agent startup service problem

Last updated on March 29th, 2018 at 02:45 pm

Problem:

zabbix_agentd [1209]: cannot create PID file [/var/run/zabbix/zabbix_agentd.pid] : [2] No such file or directory

Solution:

Create .sh script:

ping 192.168.1.220 -c 2
mkdir -p /var/run/zabbix
chown zabbix:zabbix /var/run/zabbix
systemctl restart zabbix-agent

Change Permission to rc.local:

chmod +x /etc/rc.d/rc.local

Now added this script to rc.local:

nano /etc/rc.d/rc.local

Add this line to rc.local:

/root/zabbix.sh