觀察網絡流量的工具-iptraf-ng


最近看到vmlinux大神介紹了一款網絡查看工具,感覺很好用,下面進行簡要摘錄:

iptraf-ng 可以方便查看當前服務器網絡狀況:CentOS 7.0,采用了衍生版本iptraf-ng 。

iptraf-ng -h
usage: iptraf-ng [options]
   or: iptraf-ng [options] -B [-i <iface> | -d <iface> | -s <iface> | -z <iface> | -l <iface> | -g]

    -h, --help            show this help message

    -i <iface>            start the IP traffic monitor (use '-i all' for all interfaces)
    -d <iface>            start the detailed statistics facility on an interface
    -s <iface>            start the TCP and UDP monitor on an interface
    -z <iface>            shows the packet size counts on an interface
    -l <iface>            start the LAN station monitor (use '-l all' for all LAN interfaces)
    -g                    start the general interface statistics

    -B                    run in background (use only with one of the above parameters
    -f                    clear all locks and counters
    -t <n>                run only for the specified <n> number of minutes
    -L <logfile>          specifies an alternate log file

簡要步驟:

“iptraf -g” 顯示每一個網卡上的流量:

 

“iptraf -d eth0” 顯示指定網卡上的流量統計,總體流量、流入量、流出量、以及按協議分類的流量統計:

 “iptraf -s eth0” 統計各port的流量:

“iptraf -i eth0” 查看遠程主機端口:

“iptraf -i eth0” 的輸出分為兩個窗口,上面是TCP socket pairs,下面是UDP。我們根據端口號 使用 lsof 可以找到對應的進程號; 

參考文件:

http://linuxperf.com/?p=11 

觀察網絡性能時如何選擇工具


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM