GHOST系统之家 - Windows系统光盘下载网站!
当前位置:GHOST系统之家>电脑问题 > Zabbix 5.x的Template Module ICMP Ping浅析

Zabbix 5.x的Template Module ICMP Ping浅析

来源:Ghost系统之家浏览:时间:2023-08-14 09:09:46

本文转载自微信公众号「DBA闲思杂想录」,作者潇湘隐者。转载本文请联系DBA闲思杂想录公众号。

Zabbix 5.*默认自带了模板Template ModuleICMPPing。它用来监控主机或设备的存活状态以及网络情况,主要是监控丢包率和响应时间两个指标。Template ModuleICMPPing模板有三个item,如下截图所示:

Template Module ICMP Ping的配置

1:检查或安装fping

Zabbix使用外部命令fping处理ICMPping的请求,而不是ping命令,而fping不包含在Zabbix的发行版本中。所以需要额外安装fping命令的相关包。

检查是否安装了fping命令:

[root@Zabbix ~]# yum list installed | grep fpingfping.x86_643.16-1.el8@zabbix-non-supported

如果没有安装过fping,就必须安装fping。如果没有配置yum源的话,需要用其它方式安装,例如可以下载安装包进行RPM安装,此处略过。

yum install fping -y

由于fping默认是root权限工作,而Zabbix Proxy或ZabbixServer是zabbix用户运行的,所以需要对fping程序设置setuid权限,如果在自定义key的时候需要用到netstat命令,也同样要设置setuid,否则不能获取到数据,而日志中提示权拒绝。

locatefping/usr/sbin/fping/usr/sbin/fping6/usr/share/doc/fping/usr/share/doc/fping/COPYING/usr/share/doc/fping/ChangeLog/usr/share/doc/fping/README/usr/share/man/man8/fping.8.gz/usr/share/man/man8/fping6.8.gz#chownroot:zabbix/usr/sbin/fping#chmod 4710 /usr/sbin/fping

2:在Zabbix Server和Zabbix Proxy端的配置文件里面打开注释

在zabbix_server.conf或zabbix_proxy.conf中把FpingLocation或Fping6Location路径修改为刚安装的fping命令的路径。如果安装路径和配置文件中FpingLocation/Fping6Location默认的路径一致,其实也可以不用修改。

默认设置如下所示:

Option: FpingLocation# Location of fping.# Make sure that fping binaryhas

root ownership and SUID flag set.## Mandatory: no#Default:#FpingLocation=/usr/sbin/fping ### Option: Fping6Location# Location offping6.#Make sure that fping6 binary has root ownership and SUID flag set.#Make emptyif your fping utility is capable to process IPv6 addresses.##Mandatory: no#Default:# Fping6Location=/usr/sbin/fping6

3:引用模板

在被监控的主机或设备上应用这个模板,或者在其他模板中引用这个模板(很多翻译是“链接的模板”,个人感觉这个翻译怪怪的),如下所示,在TemplateOSWindows by Zabbix agent中引用了Template Module ICMP Ping模板,那么只要应用模板TemplateOSWindows by Zabbix agent 就会监控主机或设备了。

Template Module ICMP Ping的选项介绍

在被监控的主机或设备上对应的“最新数据”(Latest data)——“Status”下面有三个监控项

ICMP loss

ICMP ping

ICMP response time

关于这些item的key,可以参考官方文档,下面节选部分内容如下:

Defaults, limits and description of values for ICMP check parameters:

ParameterUnitDescriptionFping's flagDefaults set byAllowed limits

by Zabbix

fpingZabbixminmax

packetsnumbernumber of request packets to a target-C

3110000

intervalmillisecondstime to wait between successive packets-p1000

20unlimited

sizebytespacket size in bytes

56 bytes on x86, 68 bytes on x86_64-b56 or 68

2465507

timeoutmillisecondsfping v3.x - timeout to wait after last packetsent,affected by -C flag

fping v4.x - individual timeout for each packet-tfping v3.x - 500

fping v4.x - inherited from -p flag, but not more than 2000

50unlimited

In addition Zabbix uses fping options -i interval ms (do not mix up withtheitem parameter interval mentioned in the table above, which corresponds tofpingoption -p) and -S source IP address (or -I in older fping versions).Thoseoptions are auto-detected by running checks with different optioncombinations.Zabbix tries to detect the minimal value in milliseconds thatfping allows touse with -i by trying 3 values: 0, 1 and 10. The value thatfirst succeeds isthen used for subsequent ICMP checks. This process is done byeach ICMP pingerprocess individually.

Auto-detected fping options are invalidated every hour and detected againonthe next attempt to perform ICMP check. Set DebugLevel>=4 in order toviewdetails of this process in the server or proxy log file.

Warning: fping defaults can differ depending on platform and version - ifindoubt, check fping documentation.

Zabbix writes IP addresses to be checked by any of three icmpping* keys toatemporary file, which is then passed to fping. If items have differentkeyparameters, only ones with identical key parameters are written to asinglefile.

All IP addresses written to the single file will be checked by fpinginparallel, so Zabbix icmp pinger process will spend fixed amount oftimedisregarding the number of IP addresses in the file.

ICMP loss掉包的案例截图:

ICMP ping掉包的案例截图

ICMP response time 就是时延或者响应时间

参考资料:

https://www.zabbix.com/documentation/current/manual/config/items/itemtypes/simple_checks#icmp_pings

推荐系统

  • 电脑公司Ghost Win8.1 x32 精选纯净版2022年7月(免激活) ISO镜像高速下载

    电脑公司Ghost Win8.1 x32 精选纯净版2022年7月(免激活) ISO镜像高速下载

    语言:中文版系统大小:2.98GB系统类型:Win8

    电脑公司Ghost Win8.1x32位纯净版V2022年7月版本集成了自2022流行的各种硬件驱动,首次进入系统即全部硬件已安装完毕。电脑公司Ghost Win8.1x32位纯净版具有更安全、更稳定、更人性化等特点。集成最常用的装机软件,精心挑选的系统维护工具,加上绿茶独有

  • 微软Win11原版22H2下载_Win11GHOST 免 激活密钥 22H2正式版64位免费下载

    微软Win11原版22H2下载_Win11GHOST 免 激活密钥 22H2正式版64位免费下载

    语言:中文版系统大小:5.13GB系统类型:Win11

    微软Win11原版22H2下载_Win11GHOST 免 激活密钥 22H2正式版64位免费下载系统在家用办公上跑分表现都是非常优秀,完美的兼容各种硬件和软件,运行环境安全可靠稳定。Win11 64位 Office办公版(免费)优化  1、保留 Edge浏览器。  2、隐藏“操作中心”托盘图标。  3、保留常用组件(微软商店,计算器,图片查看器等)。  5、关闭天气资讯。 

  • Win11 21H2 官方正式版下载_Win11 21H2最新系统免激活下载

    Win11 21H2 官方正式版下载_Win11 21H2最新系统免激活下载

    语言:中文版系统大小:4.75GB系统类型:Win11

    Ghost Win11 21H2是微软在系统方面技术积累雄厚深耕多年,Ghost Win11 21H2系统在家用办公上跑分表现都是非常优秀,完美的兼容各种硬件和软件,运行环境安全可靠稳定。Ghost Win11 21H2是微软最新发布的KB5019961补丁升级而来的最新版的21H2系统,以Windows 11 21H2 22000 1219 专业版为基础进行优化,保持原汁原味,系统流畅稳定,保留常用组件

  • windows11中文版镜像 微软win11正式版简体中文GHOST ISO镜像64位系统下载

    windows11中文版镜像 微软win11正式版简体中文GHOST ISO镜像64位系统下载

    语言:中文版系统大小:5.31GB系统类型:Win11

    windows11中文版镜像 微软win11正式版简体中文GHOST ISO镜像64位系统下载,微软win11发布快大半年了,其中做了很多次补丁和修复一些BUG,比之前的版本有一些功能上的调整,目前已经升级到最新版本的镜像系统,并且优化了自动激活,永久使用。windows11中文版镜像国内镜像下载地址微软windows11正式版镜像 介绍:1、对函数算法进行了一定程度的简化和优化

  • 微软windows11正式版GHOST ISO镜像 win11下载 国内最新版渠道下载

    微软windows11正式版GHOST ISO镜像 win11下载 国内最新版渠道下载

    语言:中文版系统大小:5.31GB系统类型:Win11

    微软windows11正式版GHOST ISO镜像 win11下载 国内最新版渠道下载,微软2022年正式推出了win11系统,很多人迫不及待的要体验,本站提供了最新版的微软Windows11正式版系统下载,微软windows11正式版镜像 是一款功能超级强大的装机系统,是微软方面全新推出的装机系统,这款系统可以通过pe直接的完成安装,对此系统感兴趣,想要使用的用户们就快来下载

  • 微软windows11系统下载 微软原版 Ghost win11 X64 正式版ISO镜像文件

    微软windows11系统下载 微软原版 Ghost win11 X64 正式版ISO镜像文件

    语言:中文版系统大小:0MB系统类型:Win11

    微软Ghost win11 正式版镜像文件是一款由微软方面推出的优秀全新装机系统,这款系统的新功能非常多,用户们能够在这里体验到最富有人性化的设计等,且全新的柔软界面,看起来非常的舒服~微软Ghost win11 正式版镜像文件介绍:1、与各种硬件设备兼容。 更好地完成用户安装并有效地使用。2、稳定使用蓝屏,系统不再兼容,更能享受无缝的系统服务。3、为

  • 雨林木风Windows11专业版 Ghost Win11官方正式版 (22H2) 系统下载

    雨林木风Windows11专业版 Ghost Win11官方正式版 (22H2) 系统下载

    语言:中文版系统大小:4.75GB系统类型:

    雨林木风Windows11专业版 Ghost Win11官方正式版 (22H2) 系统下载在系统方面技术积累雄厚深耕多年,打造了国内重装系统行业的雨林木风品牌,其系统口碑得到许多人认可,积累了广大的用户群体,雨林木风是一款稳定流畅的系统,一直以来都以用户为中心,是由雨林木风团队推出的Windows11国内镜像版,基于国内用户的习惯,做了系统性能的优化,采用了新的系统

  • 雨林木风win7旗舰版系统下载 win7 32位旗舰版 GHOST 免激活镜像ISO

    雨林木风win7旗舰版系统下载 win7 32位旗舰版 GHOST 免激活镜像ISO

    语言:中文版系统大小:5.91GB系统类型:Win7

    雨林木风win7旗舰版系统下载 win7 32位旗舰版 GHOST 免激活镜像ISO在系统方面技术积累雄厚深耕多年,加固了系统安全策略,雨林木风win7旗舰版系统在家用办公上跑分表现都是非常优秀,完美的兼容各种硬件和软件,运行环境安全可靠稳定。win7 32位旗舰装机版 v2019 05能够帮助用户们进行系统的一键安装、快速装机等,系统中的内容全面,能够为广大用户