客户端配置zabbix-agent 后,网页端出现Get value from agent failed: cannot connect to [192.168.199.166]:10050]:[113]No route to host的错误,主机没法被监听
1、服务器端ping 客户端
ping 192.168.199.166
2、如果能ping通,则是因为防火墙的原因,需关闭防火墙
CentOS7 的防火墙配置跟以前版本有很大区别,CentOS7这个版本的防火墙默认使用的是firewall,与之前的版本使用iptables不一样。
1、关闭防火墙
命令:systemctl stop firewalld.service
2、开启防火墙
命令:systemctl start firewalld.service
3、关闭开机启动防火墙
命令:systemctl disable firewalld.service
4、开机启动防火墙
命令:systemctl enable firewalld.service
5、常用端口放行
放行10050端口 #放行10050端口 firewall-cmd --zone=public --add-port=10050/tcp --permanent #重启防火墙 firewall-cmd --reload
- -zone ,作用域
- -add-port=8080/tcp ,添加端口,格式为:端口/通讯协议
- -permanent,永久生效,没有此参数,重启后失效


![zabbix Get value from agent failed: cannot connect to [192.168.199.166]:10050]:[113]No route to host zabbix Get value from agent failed: cannot connect to [192.168.199.166]:10050]:[113]No route to host](http://www.mshxw.com/aiimages/31/866007.png)
