Linux NetHogs監控工具介紹,linuxnethogs

來源:互聯網
上載者:User

Linux NetHogs監控工具介紹,linuxnethogs

NetHogs介紹

NetHogs是一款開源、免費的,終端下的網路流量監控工具,它可監控Linux的進程或應用程式的網路流量。NetHogs只能即時監控進程的網路頻寬佔用情況。NetHogs支援IPv4和IPv6協議,支援本地網卡以及PPP連結。

官方介紹如下:

NetHogs is a small 'net top' tool. Instead of breaking the traffic down per protocol or per subnet, like most tools do, it groups bandwidth by process. NetHogs does not rely on a special kernel module to be loaded. If there's suddenly a lot of network traffic, you can fire up NetHogs and immediately see which PID is causing this. This makes it easy to indentify programs that have gone wild and are suddenly taking up your bandwidth.

 

NetHogs下載

NetHogs的開原始碼在sourceforge上提供下載,它只提供原始碼下載。http://sourceforge.net/projects/nethogs/?source=directory。如果你需要下載RPM安裝包,可以去這個網址下載

 

Ubuntu下NetHogs安裝

sudo apt-get install nethogs

ReadHat下NetHogs安裝

[root@localhost tmp]# rpm -ivh nethogs-0.8.0-1.el6.x86_64.rpm 
warning: nethogs-0.8.0-1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...                ########################################### [100%]
   1:nethogs                ########################################### [100%]
[root@localhost tmp]# 

  源碼安裝由於測試過程安裝失敗,再次不做講述

 

NetHogs使用

 

[root@localhost tmp]# nethogs

NetHogs提供互動式控制指令:

m : Cycle between display modes (kb/s, kb, b, mb) 切換網速顯示單位

r : Sort by received. 按接收流量排序

s : Sort by sent. 按發送流量排序

q : Quit and return to the shell prompt. 退出NetHogs命令工具

 

NetHogs 命令列參數

常用的參數:

-d delay for refresh rate. 資料重新整理時間 如nethogs -d 1 就是每秒重新整理一次

-h display available commands usage. 顯示命名協助、使用資訊

-p sniff in promiscious mode (not recommended).

-t tracemode.

-V prints Version info.

示範例子:

#5秒重新整理一次資料

nethogs -d 5

#監控網卡eth0資料

nethogs eth0

#同時監視eth0和eth1介面

nethogs eth0 eth1

#將監控日誌寫入記錄檔
nethogs >>test.log

 

參考資料:

http://rpm.pbone.net/index.php3/stat/4/idpl/17273936/dir/redhat_el_6/com/nethogs-0.8.0-1.el6.x86_64.rpm.html

http://sourceforge.net/projects/nethogs/?source=directory

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.