相关文章推荐
眼睛小的番茄  ·  Postgres中的动态UNION ...·  2 月前    · 
含蓄的葡萄酒  ·  Python : ...·  1 年前    · 

mtr网络诊断

Linux mtr command provides both functionality of traceroute and ping commands. mtr can provide reports and xml, json, csv output. There is also Gtk interface provided for mtr .

Linux mtr 命令同时提供了 traceroute ping 命令的功能。 mtr 可以提供报告以及xml,json,csv输出。 还为 mtr 提供了Gtk接口。

交互式Traceroute ( Interactive Traceroute )

One of the simple use case for mtr is providing the remote hostname or IP address we want to traceroute. This will open a new interactive window which shows each intermediate hop. This will also send continuous ICMP packets to get new time and related metrics and show in the screen.

mtr 的简单用例之一就是提供我们要跟踪路由的远程主机名或IP地址。 这将打开一个新的交互式窗口,其中显示每个中间跃点。 这还将发送连续的ICMP数据包以获取新的时间和相关指标并显示在屏幕中。

$ mtr google.com
 

We can exit from this screen with CTRL+C

我们可以使用CTRL + C从此屏幕退出

显示Gtk界面(Show Gtk Interface)

mtr command can be used with GUI interface. We will provide –g in order to start with Gtk interface.

mtr命令可与GUI界面一起使用。 我们将提供– g ,以便从Gtk界面开始。

$ mtr -g google.com
 

CSV输出 (CSV Output)

We can create CSV type output. CSV type output will delimit the columns with , . We will provide --csv option with the remote hostname.

我们可以创建CSV类型的输出。 CSV类型的输出将与分隔列, 。 我们将为--csv选项提供远程主机名。

$ mtr --csv google.com
 

Xml输出(Xml Output)

Another supported output is xml . We can generate xml format output for the given remote hostname. We will use --xml option for this. Xml format is better suited for automated processing.

另一个受支持的输出是xml 。 我们可以为给定的远程主机名生成xml格式的输出。 我们将为此使用--xml选项。 Xml格式更适合自动处理。

$ mtr --xml google.com
 

杰森输出(Json Output)

We can also generate Json output. Json format is mainly used by Javascript applications. We can use --json option to generate JSON output.

我们还可以生成Json输出。 Json格式主要由Javascript应用程序使用。 我们可以使用--json选项生成JSON输出。

$ mtr --json google.com
 

设定Ping计数(Set Ping Count)

mtr command will generate ping packets continuously. We can specify the ping count with –c and the packet count. In this example we will set ping count to 5 .

mtr命令将连续生成ping数据包。 我们可以使用– c和数据包计数来指定ping计数。 在此示例中,我们将ping计数设置为5。

$ mtr -c 5 google.com
 

从文件读取主机名 (Read Hostnames From File)

We can provide multiple hostnames to ping. In order to provide multiple remote hosts we should put them in to a file line by line. Then we will read this file with -F option with the file name. In this example we will read remote hosts from file named ping.txt .

我们可以提供多个主机名来ping。 为了提供多个远程主机,我们应该将它们逐行放入一个文件中。 然后,我们将使用带有-F选项的文件名来读取该文件。 在此示例中,我们将从名为ping.txt文件中读取远程主机。

$ mtr -F ping.txt
 

不解析DNS (Do Not Resolve DNS)

Another standard feature of mtr is disabling DNS resolving. This will made operations faster because extra DNS resolving will create more traffic and wait time. We can disable DNS resolving with -n option.

mtr另一个标准功能是禁用DNS解析。 这将使操作更快,因为额外的DNS解析将创建更多的流量和等待时间。 我们可以使用-n选项禁用DNS解析。

$ mtr -n google.com
 

显示AS号 (Show AS Number)

Autonomous systems are cells in internet network each of them connects each other in a mesh way. During ping and traceroute operations send packets are transmitted trough these Autonomous systems. We can all intermediate hosts autonomous numbers with --aslookup option.

自治系统是Internet网络中的单元,每个单元都以网状方式相互连接。 在ping和traceroute操作期间,通过这些自治系统发送数据包。 我们可以使用--aslookup选项将所有中间主机的自治编号。

$ mtr --aslookup google.com
                    mtr网络诊断Linux mtrcommand provides both functionality of tracerouteand pingcommands. mtrcan provide reports and xml, json, csv output. There is also Gtk interface provided for mtr.Linux mtr命令同时提供了...
mtr 0.85查看帮助 
[root@localhost ~]# mtr -h  
usage: mtr [-BfhvrwctglxspQomniuT46] [–help] [–version] [–report] 
        [–report-wide] [–report-cycles=COU
​	MTR(My traceroute)是几乎所有Linux发行版本预装的网络测试工具,此工具也有对应的Windows版本,名称为WinMTR。
​	MTR工具将ping和traceroute、nslookup命令的功能并入了同一个工具中,实现更强大的功能。
mtr命令安装
1、	检测 mtr 命令是否安装
CentOS7
# rpm 
				
「椎锋陷陈」微信技术现已开通,为了获得第一手的技术文章推送,欢迎搜索关注! 一个App功能的整体表现,往往与用户当前的网络状况密不可分。通过为App引入一个轻量级的网络诊断模块,收集那些能够衡量当前网络状况的重要信息,然后在征得用户同意的情况下,将信息上报到服务端进行分析,可以有针对性地对网络链路中的薄弱环节进行优化。 众所周知,Android系统基于Linux内核的,Linux本身就提供了许多可用于检测网络状况的工具,熟练地运用这些工具,可以很轻松地达到我们网络诊断的目的。今天要分享的就是其中的两
as-override是用于MPLS/×××运营商和客户端运行BGP协议,同时允许二端的客户使用相同的AS。 allowas-in是用于允许一个AS接受一个存在自己AS的BGP更新,默认是不接收的 转载于:https://blog.51cto.com/junipers/931115...
因为 MTR 报告包括了丰富的信息,新手第一次阅读有点困难。下面是我本地到 google.com 的测试报告: $ mtr --report google.com HOST: example                  Loss%   Snt   Last   Avg  Best  Wrst StDev   1. inner-cake                    0.0%   
一般在windows 来判断网络连通性用ping 和tracert,ping的话可以来判断丢包率,tracert可以用来跟踪路由,在Linux中有一个更好的网络连通性判断工具,它可以结合ping nslookup tracert 来判断网络的相关特性,这个命令就是mtr [root@as34 ~]# mtr -h usage: mtr [-hvrctlsni46] [--help] [--ver