SmokePing网络PING探测监控解决方案
一、SmokePing软件介绍
smokeping是一款监控网络状态和稳定性的开源软件(它是rrdtool的作者开发的),smokeping会向目标设备和系统发送各种类型的测试数据包,测量、记录,并通过rrdtool制图方式,图形化地展示网络的时延情况,进而能够清楚的判断出网络的即时通信情况,如:延迟、丢包率、是否是BGP多线等。
官网地址:https://oss.oetiker.ch/smokeping/pub/
1.1 smokeping功能特点
(1)支持多种探测方式,包括fping、echoping、dig、curl等;
(2)易用可扩展的插件;
(3)支持master/slave 的 工作方式。
(4)可以自定义报警功能。
1.2 smokeping七大组件
general(普通设置) 、alerts(警报设置)、Datebase(数据库参数)、presentation(网络自定义)、slaves(从smokeping定义)、targets(目标设置—“含插件定义”)
SmokePing主从同步原理:https://oss.oetiker.ch/smokeping/doc/smokeping_master_slave.en.html
二、SmokePing容器化部署
2.1 容器化部署SmokePing
[root@10-27-0-224 ~]# mkdir -p /data/smokeping [root@10-27-0-224 ~]# docker run -d -it --name=smokeping -e TZ=Asia/Shanghai -p 80:80 --restart=always -v /data/smokeping/data:/data -v /data/smokeping/config:/config linuxserver/smokeping
2.2 修改SmokePing配置
(1)查看数据持久化目录
[root@10-27-0-224 ~]# yum install tree -y [root@10-27-0-224 ~]# tree /data/smokeping/ /data/smokeping/ ├── config │ ├── Alerts │ ├── custom-cont-init.d │ ├── custom-services.d │ ├── Database │ ├── General │ ├── httpd.conf │ ├── pathnames │ ├── Presentation │ ├── Probes │ ├── site-confs │ │ └── smokeping.conf │ ├── Slaves │ ├── ssmtp.conf │ └── Targets └── data ├── DNS │ ├── CloudflareDNS1.rrd │ ├── CloudflareDNS2.rrd │ ├── GoogleDNS1.rrd │ ├── GoogleDNS2.rrd │ ├── L3-1.rrd │ ├── L3-2.rrd │ ├── OpenDNS1.rrd │ ├── OpenDNS2.rrd │ └── Quad9.rrd ├── DNSProbes │ ├── CloudflareDNS1.rrd │ ├── CloudflareDNS2.rrd │ ├── GoogleDNS1.rrd │ ├── GoogleDNS2.rrd │ ├── L3-1.rrd │ ├── L3-2.rrd │ ├── OpenDNS1.rrd │ ├── OpenDNS2.rrd │ └── Quad9.rrd ├── Europe │ ├── Germany │ │ └── TelefonicaDE.rrd │ ├── Switzerland │ │ ├── CernIXP.rrd │ │ └── SBB.rrd │ └── UK │ ├── CambridgeUni.rrd │ └── UEA.rrd ├── InternetSites │ ├── Facebook.rrd │ ├── GoogleSearchIpv6.rrd │ ├── GoogleSearch.rrd │ ├── JupiterBroadcasting.rrd │ ├── linuxserverio.rrd │ └── Youtube.rrd ├── __sortercache │ ├── data.DNS.storable │ ├── data.FPing6.storable │ └── data.FPing.storable └── USA ├── IU.rrd ├── MIT.rrd ├── OSUOSL.rrd ├── UCB.rrd ├── UCSD.rrd └── UMN.rrd 14 directories, 49 files
(2)修改监控频率
[root@10-27-0-224 ~]# vim /data/smokeping/config/Database *** Database *** step = 10 # 监控频率每隔10s pings = 10 # 每10s向目标设备发送10个探测数据包 # consfn mrhb steps total AVERAGE 0.5 1 1008 AVERAGE 0.5 12 4320 MIN 0.5 12 4320 MAX 0.5 12 4320 AVERAGE 0.5 144 720 MAX 0.5 144 720 MIN 0.5 144 720 # 修改完需要删掉旧的rrd文件 [root@10-27-0-224 ~]# find /data -name "*.rrd"|xargs rm -f [root@10-27-0-224 ~]# tree /data/smokeping/ /data/smokeping/ ├── config │ ├── Alerts │ ├── custom-cont-init.d │ ├── custom-services.d │ ├── Database │ ├── General │ ├── httpd.conf │ ├── pathnames │ ├── Presentation │ ├── Probes │ ├── site-confs │ │ └── smokeping.conf │ ├── Slaves │ ├── ssmtp.conf │ └── Targets └── data ├── DNS ├── DNSProbes ├── Europe │ ├── Germany │ ├── Switzerland │ └── UK ├── InternetSites ├── __sortercache │ ├── data.DNS.storable │ ├── data.FPing6.storable │ └── data.FPing.storable └── USA
(3)配置监控项
[root@10-27-0-224 ~]# vim /data/smokeping/config/Targets *** Targets *** probe = FPing menu = Top title = Network Latency Grapher remark = Welcome to the SmokePing website of WORKS Company. \ Here you will learn all about the latency of our network. + InternetSites # 一级标题 menu = Internet Sites title = Internet Sites # 一级标题名 ++ Facebook # 二级标题 menu = Facebook title = Facebook # 二级标题名 host = facebook.com ++ Youtube menu = YouTube title = YouTube host = youtube.com ++ JupiterBroadcasting menu = JupiterBroadcasting title = JupiterBroadcasting host = jupiterbroadcasting.com ++ GoogleSearch menu = Google title = google.com host = google.com ++ GoogleSearchIpv6 menu = Google probe = FPing6 title = ipv6.google.com host = ipv6.google.com ++ linuxserverio menu = linuxserver.io title = linuxserver.io host = linuxserver.io + Europe menu = Europe title = European Connectivity ++ Germany menu = Germany title = The Fatherland +++ TelefonicaDE # 三级标题 menu = Telefonica DE title = Telefonica DE # 三级标题名 host = www.telefonica.de ++ Switzerland menu = Switzerland title = Switzerland +++ CernIXP menu = CernIXP title = Cern Internet eXchange Point host = cixp.web.cern.ch +++ SBB menu = SBB title = SBB host = www.sbb.ch/en ++ UK menu = United Kingdom title = United Kingdom +++ CambridgeUni menu = Cambridge title = Cambridge host = cam.ac.uk +++ UEA menu = UEA title = UEA host = www.uea.ac.uk + USA menu = North America title = North American Connectivity ++ MIT menu = MIT title = Massachusetts Institute of Technology Webserver host = web.mit.edu ++ IU menu = IU title = Indiana University host = www.indiana.edu ++ UCB menu = U. C. Berkeley title = U. C. Berkeley Webserver host = www.berkeley.edu ++ UCSD menu = U. C. San Diego title = U. C. San Diego Webserver host = ucsd.edu ++ UMN menu = University of Minnesota title = University of Minnesota host = twin-cities.umn.edu ++ OSUOSL menu = Oregon State University Open Source Lab title = Oregon State University Open Source Lab host = osuosl.org + DNS menu = DNS title = DNS ++ GoogleDNS1 menu = Google DNS 1 title = Google DNS 8.8.8.8 host = 8.8.8.8 ++ GoogleDNS2 menu = Google DNS 2 title = Google DNS 8.8.4.4 host = 8.8.4.4 ++ OpenDNS1 menu = OpenDNS1 title = OpenDNS1 host = 208.67.222.222 ++ OpenDNS2 menu = OpenDNS2 title = OpenDNS2 host = 208.67.220.220 ++ CloudflareDNS1 menu = Cloudflare DNS 1 title = Cloudflare DNS 1.1.1.1 host = 1.1.1.1 ++ CloudflareDNS2 menu = Cloudflare DNS 2 title = Cloudflare DNS 1.0.0.1 host = 1.0.0.1 ++ L3-1 menu = Level3 DNS 1 title = Level3 DNS 4.2.2.1 host = 4.2.2.1 ++ L3-2 menu = Level3 DNS 2 title = Level3 DNS 4.2.2.2 host = 4.2.2.2 ++ Quad9 menu = Quad9 title = Quad9 DNS 9.9.9.9 host = 9.9.9.9 + DNSProbes menu = DNS Probes title = DNS Probes probe = DNS ++ GoogleDNS1 menu = Google DNS 1 title = Google DNS 8.8.8.8 host = 8.8.8.8 ++ GoogleDNS2 menu = Google DNS 2 title = Google DNS 8.8.4.4 host = 8.8.4.4 ++ OpenDNS1 menu = OpenDNS1 title = OpenDNS1 host = 208.67.222.222 ++ OpenDNS2 menu = OpenDNS2 title = OpenDNS2 host = 208.67.220.220 ++ CloudflareDNS1 menu = Cloudflare DNS 1 title = Cloudflare DNS 1.1.1.1 host = 1.1.1.1 ++ CloudflareDNS2 menu = Cloudflare DNS 2 title = Cloudflare DNS 1.0.0.1 host = 1.0.0.1 ++ L3-1 menu = Level3 DNS 1 title = Level3 DNS 4.2.2.1 host = 4.2.2.1 ++ L3-2 menu = Level3 DNS 2 title = Level3 DNS 4.2.2.2 host = 4.2.2.2 ++ Quad9 menu = Quad9 title = Quad9 DNS 9.9.9.9 host = 9.9.9.9
2.3 参数解读
(1)单位
μs要读作微秒,ns读作纳秒,ms读作毫秒,进率:
1s=1000ms
1ms=1000μs
1μs=1000ns
(2)rtt (Round-TripTime)
这个值就是数据包在源和监控点一个来回所需要用的时间,是判断网络运行状况的一个重要的参数。在网络中实时、准确测量大量的TCP设备和系统rtt参数也是网络管理的重要环节之一。smokeping就是向目标设备发送数据包,进行记录、展示rtt。
(3)media rtt (中间数)
它是中间数并不是平均值。Smokeping 有多种类型的探针,探针在默认的设置下,每 300 秒向目标设备发送 20 测探测数据包。假如这 20个数据包都返回的话,它就记录下了 20 个 rtt,那么media rtt 就是第十个包的 RTT;如果有5 个包丢失的话,那么media rtt 就是第八个返回的包的 rtt 值。
avg (rtt的平均值):它是每一个测试回合中所有的rtt算术平均值。
max、min、now
sd:standard deviation of the median中间数的标准偏差
am/s : ratio of average median vs standarddeviation平均中值和标准偏差的比值
(4)packetloss (丢包率)
通过ping包进行测试的进行测算。通过loss color进行展示。
(5)其它
浅蓝色表示20个包丢掉1个,绿色表示0丢包。绿色或蓝色线标示的是中间数的值(media rtt),其他数值则在中间数周围以灰色展示。灰度范围越小越好,起伏太大说明网络不稳定。那此图中一段灰度块比较集中,就表示那个时间段网络不太稳定。
作者:UStarGao
链接:https://www.starcto.com/nettool/169.html
来源:STARCTO
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
UCloud云平台推荐
随便看看
- 2021-04-04Linux服务器配置Google二次验证登录
- 2022-05-08Prometheus+Grafana监控Docker容器
- 2021-05-22MongoDB 集合与文档的相关操作
- 2021-09-14开源入侵检测系统OSSEC介绍
- 2024-09-12UCloud Centos7.x高内核降级到低内核及内核crash参数调整