######
在Zabbix服务器安装fping:
tar -zxvf fping-4.0.tar.gz
cd fping-4.0
./configure --prefix=/usr/local/fping/
make && make install
修改fping的权限:
chown root:zabbix /usr/local/fping/sbin/fping
chmod 4710 /usr/local/fping/sbin/fping
fping安装成功:
[root@centos8 ~]# find / -name fping
/root/fping-4.0/src/fping
/usr/local/fping
/usr/local/fping/sbin/fping
[root@centos8 ~]#
测试命令fping:
当Zabbix服务器能Ping通被监控主机的站点域名(blog.zhuohua.store)时的效果:
[root@centos8 ~]# /usr/local/fping/sbin/fping blog.zhuohua.store
blog.zhuohua.store is alive
[root@centos8 ~]#
当Zabbix服务器能Ping通被监控主机的IP地址(47.75.39.177)时的效果:
[root@centos8 ~]# /usr/local/fping/sbin/fping 47.75.39.177
47.75.39.177 is alive
[root@centos8 ~]#
修改Zabbix服务器的配置文件:
[root@centos8 ~]# cat /usr/local/zabbix/etc/zabbix_server.conf |grep "fping"
# Location of fping.
# Make sure that fping binary has root ownership and SUID flag set.
# FpingLocation=/usr/sbin/fping
# 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@centos8 ~]# cat /usr/local/zabbix/etc/zabbix_server.conf |grep "fping"
# Location of fping.
# Make sure that fping binary has root ownership and SUID flag set.
FpingLocation=/usr/local/fping/sbin/fping
# 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
保存好配置文件后,重启一下Zabbix本机的客户端和服务端:
pkill -9 -U zabbix
/usr/local/zabbix/sbin/zabbix_agentd
/usr/local/zabbix/sbin/zabbix_server
重新检查主机Linux_server_1的三个监控项:
模板Template Module ICMP Ping自带的三个触发器:
触发器名称: High ICMP ping loss
严重性: 警告
表达式: {Linux_server_1:icmppingloss.min(5m)}>{$ICMP_LOSS_WARN} and {Linux_server_1:icmppingloss.min(5m)}<100