zabbix自定义key监控目标IP的指定端口

 

 

  为了监控某个IP的端口是否正常,zabbix内置tcp监控的key值" net.tcp.port[IP,port]  返回结果1表示端口正常,返回0表示不存在",既触发器配置" {Zabbix server:net.tcp.port[113.143.100.199,8899].last()}=0 "

  该监控项只能在zabbix-server的主机监控项下配置,通过server端来获取状态的监控

 

2,目标icmp的监控

 

 

  配置好的监控项出现红色感叹号的位置错误(failed: 1.81.7.103: Address family for hostname not supported),该错误表示zabbix_server和zabbix-agent的sourceip问题导致,亦或者fping的权限问题

解决思路:

1,Fping的权限问题

[root@begon ~]# ls -l /usr/sbin/fping*
-rwsr-xr-x 1 root zabbix 32960 Oct 26 2014 /usr/sbin/fping
-rwsr-xr-x 1 root root 32960 Oct 26 2014 /usr/sbin/fping6
2,服务端可对外访问的IP

[root@begon ~]# grep -i sourceip /etc/zabbix/zabbix_server.conf
### Option: SourceIP
SourceIP=X.X.X.X

3,zabbix-server的IP

[root@begon ~]# grep -i Server= /etc/zabbix/zabbix_agentd.conf
# Example: Server=127.0.0.1,192.168.1.0/24,::1,2001:db8::/32,zabbix.example.com
# Server=
Server=X.X.X.X

4,Fping的路径

[root@begon ~]# grep -i fping /etc/zabbix/zabbix_server.conf
### Option: FpingLocation
# Location of fping.
# Make sure that fping binary has root ownership and SUID flag set.
FpingLocation=/usr/sbin/fping
### Option: Fping6Location
# Location of fping6.
# Make sure that fping6 binary has root ownership and SUID flag set.
# Make empty if your fping utility is capable to process IPv6 addresses.
# Fping6Location=/usr/sbin/fping6
[root@begon ~]#

 

posted @ 2020-10-24 21:28  邓聪聪  阅读(1807)  评论(0编辑  收藏  举报