黑客业务

24小时接单的黑客,黑客业务,黑客怎么找,网络黑客,黑客技术

Zabbix 5.x的Template Module ICMP Ping浅析

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

Zabbix 5.*默认自带模板Template Module ICMP Ping。它用于监控主机或设备的生存状态和网络状况,主要监控丢包率和响应时间。Template Module ICMP Ping模板有三个item,如下截图所示:

Template Module ICMP Ping的配置

1:检查或安装fping

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

检查是否安装fping命令:

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

若未安装fping,就必须安装fping。若无配置yum如果源,需要以其他方式安装,如下载安装包RPM在这里跳过安装。

#yum install fping -y

由于fping默认是root而权限工作Zabbix Proxy 或Zabbix Server是zabbix因此,用户需要运行fping程序设置setuid如果权限是自定义的key需要使用时间netstat还应设置命令setuid,否则,数据无法获取,日志中的提示权被拒绝。

# locate fping/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#chown root: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 binary has root ownership and SUID flag set.## Mandatory: no# Default:# 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.## Mandatory: no# Default:# Fping6Location=/usr/sbin/fping6

3:引用模板

该模板应用于被监控的主机或设备,或引用于其他模板(许多翻译是“链接的模板”,个人感觉这个翻译很奇怪),如下所示,在Template OS Windows by Zabbix agent中引用了Template Module ICMP Ping只要模板应用于模板,Template OS Windows 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 packet sent, 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 with the item parameter interval mentioned in the table above,which corresponds to fping option -p) and -S source IP address (or -I in older fping versions). Those options are auto-detected by running checks with different option combinations. Zabbix tries to detect the minimal value in milliseconds that fping allows to use with -i by trying 3 values: 0,1 and 10. The value that first succeeds is then used for subsequent ICMP checks. This process is done by each ICMP pinger process individually.

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

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

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

All IP addresses written to the single file will be checked by fping in parallel,so Zabbix icmp pinger process will spend fixed amount of time disregarding 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

   
  • 评论列表:
  •  笙沉青朷
     发布于 2022-05-28 20:56:54  回复该评论
  • es to detect the minimal value in milliseconds that fping allows to use with -i by tryin
  •  馥妴秙暔
     发布于 2022-05-28 20:06:20  回复该评论
  • 4 in order to view details of this process in the server or proxy log file.Warning: fping defaults can differ depending on platfor

发表评论:

Powered By

Copyright Your WebSite.Some Rights Reserved.