1、检查是否关闭防火墙及selinux
systemctl stop firewalld.service
systemctl disable firewalld.service
setenforce 0
2、查看服务是否启动
systemctl status zabbix-agent
3、查看服务端与客户端端口10050是否连通,检查iptables
netstat -antp
iptables -L -n
4、通过日志诊断
问题1
cat /var/log/zabbix/zabbix_agentd.log
2660:20200423:195520.197 Starting Zabbix Agent [kingdeetest-10.100.7.34]. Zabbix 3.2.9 (revision 73587).
2660:20200423:195520.198 **** Enabled features ****
2660:20200423:195520.201 IPv6 support: YES
2660:20200423:195520.203 TLS support: YES
2660:20200423:195520.206 **************************
2660:20200423:195520.207 using configuration file: /etc/zabbix/zabbix_agentd.conf
2660:20200423:195520.208 cannot set resource limit: [13] Permission denied
2660:20200423:195520.210 cannot disable core dump, exiting… 一般是未关闭selinux
解决办法 setenforce 0
问题2
zabbix_agentd [28973]: cannot create PID file [/var/run/zabbix/zabbix_agentd.pid]: [2] No such file or directory
Fresh install of zabbix22-agent fails to start because the agent cannot create its PID file.
解决办法:
新建一个zabbix目录
$ sudo mkdir /var/run/zabbix
授权用户使用
$ sudo chown root:zabbix /var/run/zabbix
授权
$ sudo chmod 0775 /var/run/zabbix
$ sudo chcon -u system_u -t zabbix_var_run_t /var/run/zabbix