centos系統下網絡連通測試工具mtr

永久鏈接: http://liuyi201407313018.iteye.com/blog/2400635
centos系統下網絡連通測試工具mtr

簡介
Mtr是 Linux系統中一個非常棒的網絡連通性判斷工具,它結合了ping, traceroute,nslookup 的相關特性。
A、install software
[root@localhost ~]# yum -y install mtr
[root@localhost ~]# yum info mtr
Loaded plugins: fastestmirror, priorities, security
Loading mirror speeds from cached hostfile

  • webtatic: sp.repo.webtatic.com
    Installed Packages
    Name : mtr
    Arch : x86_64
    Epoch : 2
    Version : 0.75
    Release : 5.el6
    Size : 96 k
    Repo : installed
    From repo : anaconda-CentOS-201303050102.x86_64
    Summary : A network diagnostic tool
    URL : http://www.BitWizard.nl/mtr
    License : GPLv2+
    Description : Mtr is a network diagnostic tool that combines ping and traceroute
    : into one program. Mtr provides two interfaces: an ncurses interface,
    : useful for using Mtr from a telnet session; and a GTK+ interface for X
    : (provided in the mtr-gtk package).

[root@localhost ~]# mtr -h
usage: mtr [-hvrwctglspniu46] [--help] [--version] [--report]
[--report-wide] [--report-cycles=COUNT] [--curses] [--gtk]
[--raw] [--split] [--no-dns] [--address interface]
[--psize=bytes/-s bytes]
[--interval=SECONDS] HOSTNAME [PACKETSIZE]

mtr常用的幾個參數:

-v:查看當前版本號;

-r:以報告模式顯示,不加-r會動態的顯示;

-c:設置每秒發送數據包的數量,默認值是10;

-s:指定ping數據包的大小;

-n:相當於--no-dns 不解析dns;
B、test

[root@localhost ~]# mtr www.baidu.com
[root@localhost ~]# mtr 119.29.29.29
My traceroute [v0.75]
localhost.localdomain (0.0.0.0) Thu Nov 23 15:31:12 2017
Resolver error: No error returned but no answers given. of fields quit
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev

第一列:host顯示的是IP地址和本機域名,這點和tracert很像;

第二列:loss%就是對應IP行的丟包率了,需要注意的是有些丟包是由於icmp的保護機製造成的,並不 代表真的丟包;

第三列:snt每秒發送數據包的數量,默認值是10,窩這裏通過參數 -c來指定發送15個包;

第四列:Last顯示的最近一次的返回時延;
第五列:Avg是平均值 這個應該是發送ping包的平均時延;
第六列:Best是最好或者說時延最短的;
第七列:Wrst是最差或者說時延最常的;
第八列:StDev是標準偏差,統計學名詞,一種量度數據分佈的分散程度標準,用以衡量數據值偏離算術平均值的程度。標準偏差越小,這些值偏離平均值就越少。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章