Smokeping 是一个很好用的网络监测工具,主要用途是测量与目标主机的网络延迟。
像 Pi-Hole 或 Smokeping 这些对硬件要求不高的工具,除非已经有一台 24/7 运行的机器,否则我认为使用低功耗的 Raspberry Pi 运行是很不错的选择。
在 Raspberry Pi 安装 Smokeping 十分简单,只需一行指令:
$ sudo apt install apache2 fping curl smokeping libapache2-mod-fcgid
开启 smokeping 的 apache 设定档:
$ sudo a2enconf smokeping
启动并设定 Apache 及 Smoke 开机自动执行:
|
1 2 |
$ systemctl enable --now apache2 $ systemctl enable --now smokeping |
这时便可以透过以下网址打开 smokeping 的页面:
http://raspberry-pi-ip/smokeping
现在可以设定要测的主机:
$ sudo nano /etc/smokeping/config.d/Targets
以下是监测的例子:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
*** Targets *** probe = FPing menu = Top title = Network Latency Grapher remark = Welcome to the SmokePing website of xxx Company. \ Here you will learn all about the latency of our network. + Internet menu = Network Latency title = Network Latency (ICMP Ping) ++ Google_DNS menu = Google DNS title = Google DNS 8.8.8.8 host = 8.8.8.8 ++ Cloudflare_DNS menu = Cloudflare title = Cloudflare DNS 1.1.1.1 host = 1.1.1.1 ++ China menu = China title = TsingHua University (China) host = mirrors.tuna.tsinghua.edu.cn ++ Japan menu = Japan title = FreeBSD Mirror at Japan host = ftp.jp.FreeBSD.org ++ Singapore menu = Singapore title = Arch Linux Mirror at Singapore host = mirror.sg.gs ++ USA menu = USA title = FreeBSD Mirror at New York, USA host = pkg0.nyi.freebsd.org ++ Germany menu = Germany title = FreeBSD Mirror at Germany host = ftp.de.FreeBSD.org ++ UK menu = UK title = FreeBSD Mirror at UK host = ftp.uk.FreeBSD.org |
最后重启 smokeping:
$ sudo systemctl restart smokeping
等 5 至 10 分钟再查看 smokeping 的页面,便会看到更新了。