smokeping(网络性能监控工具Smokeping「建议收藏」)

发布时间:2025-12-10 19:26:47 浏览次数:2

网络性能监控工具Smokeping「建议收藏」-smokeping的描述是错误的

网络性能监控工具Smokeping「建议收藏」什么是Smokeping?SmokePing是一款监控网络状态和稳定性的开源软件(它是RRDTool的作者开发的),通过它可以监控如延时,丢包率,是否BGP多线等网络状况;smokeping会向目标设备和系统发送各种类型的测试数据包,测量、记录,并通过图形化地展示网络的时延情况,进而能够清楚的判断出网络的即时通信情况;可以用于监控群晖主机的网络状态,也可以用于监控多台vps的运行状态,支持通过邮件报警。安装在群晖上以Docker方式安装。在注册表中搜索smokepi.

什么是 Smokeping ?

SmokePing 是一款监控网络状态和稳定性的开源软件(它是 RRDTool 的作者开发的),通过它可以监控如延时,丢包率,是否 BGP 多线等网络状况;smokeping 会向目标设备和系统发送各种类型的测试数据包,测量、记录,并通过图形化地展示网络的时延情况,进而能够清楚的判断出网络的即时通信情况;

可以用于监控群晖主机的网络状态,也可以用于监控多台 vps 的运行状态,支持通过邮件报警。

安装

在群晖上以 Docker 方式安装。

在注册表中搜索 smokeping ,选择第一个 linuxserver/smokeping,版本选择 latest

docker 文件夹中,创建一个新文件夹,并将其命名为 smokeping,并在 smokeping 中建两个子目录,分别命名为 configdata

文件夹 装载路径 备注
/docker/smokeping/data /data 数据库和应用数据目录
/docker/smokeping/config /config 配置文件目录

端口

端口不能冲突

本地端口 容器端口 类型
8580 80 TCP

环境

可变
TZ 设置为 Asia/Shanghai
PGID <gid> 设为 1000
PUID <uid> 设为 1000

运行

在浏览器中输入 http://群晖IP:8580,就能看到主界面了

配置文件

配置文件在 /docker/smokeping/config 目录中,知道了用途可以方便后面的修改

文件 用途
Alerts 报警设置
Database 采样频率设置
General 常规设置
httpd.conf Apache Web 服务器设置
pathnames 路径设置
Presentation 模板文件
Probes 探针设置
Slaves 主从模式时,从机设置
ssmtp.conf 邮件服务器设置
Targets 监控目标设置

Database

打开 smokeping/config/Database 文件,全部采用了默认值,也就是 300 秒(5 分钟)ping 20 次

Probes

编辑 smokeping/config/Probes 文件,将 dns 中的 google.com 改为了 baidu.com,其他都是默认的

邮件报警

第一步、编辑 ssmtp.conf

配置生效需要重启容器

除了密码都在下面????

Debug=YES# Config file for sSMTP sendmail## The person who gets all mail for userids < 1000# Make this empty to disable rewriting.root=wbsu2003@88.com# The place where the mail goes. The actual machine name is required no# MX records are consulted. Commonly mailhosts are named mail.domain.commailhub=smtp.88.com:465AuthUser=wbsu2003@88.comAuthPass=88邮箱设置的专用密码UseSTARTTLS=NOUseTLS=YES# Where will the mail seem to come from?rewriteDomain=88.com# The full hostnamehostname=linuxserver-smokeping1# Are users allowed to set their own From: address?# YES - Allow the user to specify their own From: address# NO - Use the system generated From: addressFromLineOverride=YES

是否还在为Ide开发工具频繁失效而烦恼,来吧关注以下公众号获取最新激活方式。亲测可用!

为防止网络爬虫,请关注公众号回复”口令”

激活idea 激活CLion DataGrip DataSpell dotCover dotMemory dotTrace GoLand PhpStorm PyCharm ReSharper ReShaC++ Rider RubyMine WebStorm 全家桶 刷新

【正版授权,激活自己账号】:Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛

【官方授权 正版激活】:官方授权 正版激活 自己使用,支持Jetbrains家族下所有IDE…

老苏用的是 88 邮箱,相关参数可以在 设置 中找到

设置完成后,可以通过 『终端机』 进入容器内进行 Email 发送调试,命令行下输入 ssmtp -v wbsu2003@hotmail.com ,再依次输入:

To: wbsu2003@hotmail.comFrom: wbsu2003@88.comSubject: alert <回车2次>test123 <ctrl+D>

去收件箱查看邮件

第二步、编辑 Alerts

修改红框部分

to:接收报警的邮箱,也可以是自定义脚本; from:发送报警信息的邮箱,也就是上一步在 ssmtp.conf 中设置的邮箱;

下面是报警触发的条件

设的比较低是想更容易触发报警,实际应用延时可以设在 200ms

*** Alerts ***to = wbsu2003@hotmail.comfrom = wbsu2003@88.com +rttdetecttype = rttpattern = <20,<20,<20,<20,<20,>20,>20,>20comment = 连续3次延时20以上+lossdetecttype = losspattern = ==0%,==0%,==0%,==0%,==0%,>0%,>0%,>0%comment = 突然有丢包

Targets

Internet Sites 基本上是我们正常无法访问的站点,所以需要进行修改,不然会没有数据

编辑 smokeping/config/Targets 文件

编辑之前请先做好备份

格式一目了然,采用了是分层结构,用+表示,例如第一层“+”,第二层“++”一次类推可以增加也可以修改

下面????这段来自 https://wzfou.com/smokeping/,但根据我们前面设置的 ProbesAlerts进行了微调

+ Othermenu = 三大网络监控title = 监控统计probe = FPing++ dianxinmenu = 电信网络监控title = 电信网络监控列表host = /Other/dianxin/dianxin-bj /Other/dianxin/dianxin-hlj /Other/dianxin/dianxin-tj /Other/dianxin/dianxin-sc /Other/dianxin/dianxin-sh /Other/dianxin/dianxin-gz+++ dianxin-bjmenu = 北京电信title = 北京电信host = 202.96.199.133alerts = rttdetect,lossdetect +++ dianxin-hljmenu = 黑龙江电信title = 黑龙江电信host = 219.147.198.242alerts = rttdetect,lossdetect +++ dianxin-tjmenu = 天津电信title = 天津电信host = 219.150.32.132alerts = rttdetect,lossdetect +++ dianxin-scmenu = 四川电信title = 四川电信host = 61.139.2.69alerts = rttdetect,lossdetect +++ dianxin-shmenu = 上海电信title = 上海电信host = 116.228.111.118alerts = rttdetect,lossdetect +++ dianxin-gzmenu = 广东电信title = 广东电信host = 113.111.211.22alerts = rttdetect,lossdetect ++ liantongmenu = 联通网络监控title = 联通网络监控列表host = /Other/liantong/liantong-bj /Other/liantong/liantong-hlj /Other/liantong/liantong-tj /Other/liantong/liantong-sc /Other/liantong/liantong-sh /Other/liantong/liantong-gz +++ liantong-bjmenu = 北京联通title = 北京联通host = 61.135.169.121alerts = rttdetect,lossdetect +++ liantong-hljmenu = 黑龙江联通title = 黑龙江联通host = 202.97.224.69alerts = rttdetect,lossdetect +++ liantong-tjmenu = 天津联通title = 天津联通host = 202.99.96.68alerts = rttdetect,lossdetect +++ liantong-scmenu = 四川联通title = 四川联通host = 119.6.6.6alerts = rttdetect,lossdetect +++ liantong-shmenu = 上海联通title = 上海联通host = 210.22.84.3alerts = rttdetect,lossdetect +++ liantong-gzmenu = 广东联通title = 广东联通host = 221.5.88.88alerts = rttdetect,lossdetect ++ yidongmenu = 移动网络监控title = 移动网络监控列表host = /Other/yidong/yidong-bj /Other/yidong/yidong-hlj /Other/yidong/yidong-tj /Other/yidong/yidong-sc /Other/yidong/yidong-sh /Other/yidong/yidong-gz  +++ yidong-bjmenu = 北京移动title = 北京移动host = 221.130.33.52alerts = rttdetect,lossdetect +++ yidong-hljmenu = 黑龙江移动title = 黑龙江移动host = 211.137.241.35alerts = rttdetect,lossdetect +++ yidong-tjmenu = 天津移动title = 天津移动host = 211.137.160.5alerts = rttdetect,lossdetect +++ yidong-scmenu = 四川移动title = 四川移动host = 218.201.4.3alerts = rttdetect,lossdetect +++ yidong-shmenu = 上海移动title = 上海移动host = 117.131.19.23alerts = rttdetect,lossdetect +++ yidong-gzmenu = 广东移动title = 广东移动host = 211.136.192.6alerts = rttdetect,lossdetect

因为有中文,要使用 utf-8 格式

配置生效需要重启容器

如果是用默认的 GB18030 编码保存,中文会乱码

而正常显示应该是这样的

随着时间的推移,逐步会产生数据

当触发了设定的延迟( rttdetect )或者丢包( lossdetect )条件时,会收到邮件提醒

而如果邮件设置有问题,会在 config 目录中生成 dead.letter 文件,用于记录触发过的报警

下载之后打开文件内容是下面????这样的

参考文档

oetiker/SmokePing: The Active Monitoring System
地址:https://github.com/oetiker/SmokePing

SmokePing – About SmokePing
地址:https://oss.oetiker.ch/smokeping/

How to install SmokePing – sleeplessbeastie’s notes
地址:https://sleeplessbeastie.eu/2020/06/19/how-to-install-smokeping/

Smokeping安装与配置-免费开源网络性能监控工具可视化主/从部署 – 挖站否-挖掘建站的乐趣
地址:https://wzfou.com/smokeping/

ssmtp-命令行发送邮件 | Hom
地址:https://gohom.win/2016/10/07/ssmtp/

需要做网站?需要网络推广?欢迎咨询客户经理 13272073477