zabbix常见报错cannot send list of active checks to []: host [Zabbix server] not found

1、看日志  

服务端:zabbix-server:  

460  killall zabbix_agentd  

461  ss -tunlp | grep zabbix  

462  zabbix_get -s 10.211.55.12 -k count.line.passwd  

463  cat /tmp/zabbix_server.log  

464  hostname  

465  ss -tunlp | grep zabbix  

466  cat /tmp/zabbix_server.log  

467  getenforce  

468  iptables -L -n

469   iptables -I INPUT -p tcp -m multiport --dports 10050:10051 -j ACCEPT  

470  service iptables save  

471  iptables -L -n  

472  zabbix_get -s 10.211.55.12 -k count.line.passwd  

473  cat /tmp/zabbix_server.log  

474  zabbix_get -s 10.211.55.12 -k count.line.passwd  

475  cat /tmp/zabbix_server.log

 

 

 

2、客户端:zabbix-c1

164  vim /etc/zabbix/zabbix_agentd.conf  

165  pkill -f zabbix  

166  ss -tunlp  

167  iptables -L -n  

168  service zabbix_agentd start  

169  vim /etc/zabbix/zabbix_agentd.conf  

170  service zabbix_agentd stop  

171  service zabbix_agentd start  

172  netstat -nplut |grep zabbix  

173  vim /etc/zabbix/zabbix_agentd.conf  

174  netstat -nplut |grep zabbix  

175  ss -tunlp  

176  ss -tunlp | grep zabbix  

177  cat /etc/networks  

178  cat /etc/hosts  

179  cat /usr/local/zabbix/etc/zabbix_agent.conf  

180  vim  /usr/local/zabbix/etc/zabbix_agent.conf  

181  find / -name zabbix_agentd.conf  

182  vim /usr/local/zabbix/etc/zabbix_agentd.conf  

183  cd /usr/local/etc/zabbix_agentd.conf.d/        

 

3、脚本路径

184  vim /usr/local/zabbix/etc/zabbix_agentd.conf    

# Include=/usr/local/etc/zabbix_agentd.userparams.conf

Include=/usr/local/etc/zabbix_agentd.conf.d/                        //把#去掉,监控项key路径

# Include=/usr/local/etc/zabbix_agentd.conf.d/*.conf

 

        

185  cd /usr/local/etc/zabbix_agentd.conf.d/                               //cd /usr/local/etc/zabbix_agentd.conf.d/ 出错

186  mkdir /usr/local/etc/zabbix_agentd.conf.d/  

187  cd /usr/local/etc/zabbix_agentd.conf.d/  

188  vim count.line.passwd  

189  ls -ld count.line.passwd  

190  chmod 777 count.line.passwd            //权限

191  ls -ld count.line.passwd  

192  killall zabbix_agentd  

193  zabbix_agentd  

194  ifconfig  

195  vim count.line.passwd                //自定义key

196  killall zabbix_agentd  

197  zabbix_agentd

4、测试

[root@zabbix-server ~]# zabbix_get -s 10.211.55.12 -k count.line.passwd

40

到此ok

 

 

总结:zabbix出错原因

1、selinux  

2、iptables

3、端口 如:10050   10051    3306  等

4、ss -tunlp | grep zabbix 查询

5、find   /  -name    zabbix_agentd.conf  查询路径

6、一定记得重启服务与配置检查 如:hostname   ip   端口是否有错

 

你可能感兴趣的:(zabbix常见报错cannot send list of active checks to []: host [Zabbix server] not found)