mtr是一个很好的调试网络丢包的工具。下面是mtr输出的示例。My traceroute [v0.85] myserver.com (0.0.0.0) Thu Jan 19 04:10:04 2017 Resolver: Received error response 2. (server failure)er of fields quit Packets Pings Host Loss% Snt Last Avg Best Wrst StDev 1. 192.168.104.23 0.0% 11 0.6 0.6 0.5 0.8 0.0 2. machine1.com 0.0% 11 8.5 12.4 2.0 20.5 5.5 3. mchine2.org.com 0.0% 11 1.2 1.0 0.8 1.8 0.0 4. machine3.orgcom 0.0% 11 0.8 0.9 0.7 1.1 0.0
但是,在服务器上运行mtr时,您无法注销服务器。
我需要mtr到output to a textfile和类似于nohup命令的run in background。
我还应该能够查看报告,类似于对输出文件使用tail -f。
发布于 2017-01-22 10:08:39
mtr提供了-r选项,使mtr进入报告模式。在此模式下,mtr将运行-c选项指定的周期数,然后打印统计信息并退出。因此,我们可以创建一个脚本来运行该命令,并将该脚本放入您的计划中的cron条目。例如:
/usr/sbin/mtr -r -c 2 www.google.com >> /home/mtr.logCron入口,每分钟运行一次:
* * * * * sh /path/to/script然后,您可以对输出文件执行tail -f。
https://stackoverflow.com/questions/41741588
复制相似问题