【排错】在zabbix服务端 zabbix_get -s 192.168.100.101-p10050 -k “nginx_status[“nginx_status“,“80“,“active“]“

[root@localhost fonts]# zabbix_get -s 192.168.100.101 -p 10050 -k "nginx_status["nginx_status","80","active"]"
zabbix_get [12564]: Get value error: cannot connect to [[192.168.100.101]:10050]: [113] No route to host

遇到了如上的错误,应该怎么处理咧? 

 排错如下:
 


[root@localhost fonts]# ping 192.168.100.101
PING 192.168.100.101 (192.168.100.101) 56(84) bytes of data.
64 bytes from 192.168.100.101: icmp_seq=1 ttl=64 time=1.06 ms
64 bytes from 192.168.100.101: icmp_seq=2 ttl=64 time=0.425 ms
可以通

看下端口开了没

 [root@localhost fonts]# netstat -an |grep 10050
tcp        0      0 0.0.0.0:10050           0.0.0.0:*               LISTEN
tcp        0      0 127.0.0.1:10050         127.0.0.1:43710         TIME_WAIT
tcp        0      0 127.0.0.1:10050         127.0.0.1:43706         TIME_WAIT
tcp        0      0 127.0.0.1:10050         127.0.0.1:43722         TIME_WAIT
tcp        0      0 127.0.0.1:10050         127.0.0.1:43736         TIME_WAIT
tcp        0      0 127.0.0.1:10050         127.0.0.1:43732         TIME_WAIT
tcp        0      0 127.0.0.1:10050         127.0.0.1:43720         TIME_WAIT
tcp        0      0 127.0.0.1:10050         127.0.0.1:43734         TIME_WAIT
tcp        0      0 127.0.0.1:10050         127.0.0.1:43744         TIME_WAIT

也是没问题的,看到这种no host to route的错误,我就会想到可能是防火墙没有关

看看zabbix服务端 是关闭的

[root@localhost fonts]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

7月 18 20:11:44 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
7月 18 20:11:45 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
7月 18 20:11:45 localhost.localdomain firewalld[746]: WARNING: AllowZoneDrifting is enabled. This is considere...now.
7月 18 12:22:24 localhost.localdomain systemd[1]: Stopping firewalld - dynamic firewall daemon...
7月 18 12:22:25 localhost.localdomain systemd[1]: Stopped firewalld - dynamic firewall daemon.
Hint: Some lines were ellipsized, use -l to show in full.
 

看看客户端的防火墙

[root@localhost zabbix_agentd.d]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: active (running) since 一 2022-07-18 20:11:58 CST; 6h left
     Docs: man:firewalld(1)
 Main PID: 746 (firewalld)
   CGroup: /system.slice/firewalld.service
           └─746 /usr/bin/python2 -Es /usr/sbin/firewalld --nofork --nopid

7月 18 20:11:57 localhost.localdomain systemd[1]: Starting firewalld - dynamic firewall daemon...
7月 18 20:11:58 localhost.localdomain systemd[1]: Started firewalld - dynamic firewall daemon.
7月 18 20:11:58 localhost.localdomain firewalld[746]: WARNING: AllowZoneDrifting is enabled. This is considere...now.
Hint: Some lines were ellipsized, use -l to show in full.
 

是开启的,关闭后再去服务端运行

 [root@localhost fonts]# zabbix_get -s 192.168.100.101 -p 10050 -k "nginx_status["nginx_status","80","active"]"
1
[root@localhost fonts]#

成功了,解决。问题是我到现在没看到防火墙有啥用,还是关了比较好。 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值