Nethogs - 网络流量监控工具

命令iftop来检查带宽使用状况、netstat用来查看接口统计报告、还有其余的一些工具Bandwidthd、Speedometer、Nethogs、Darkstat、jnettop、ifstat、iptraf、nload和ntop等。可是这些工具都是统计网卡的进出数据,若是你想要找一个像windows上360安全卫士那样,可以按进程实时统计每一个程序网络带宽利用率,那么NetHogs就是你所须要的惟一工具。c++

一、下载 
地址: http://jaist.dl.sourceforge.net/project/nethogs/nethogs/0.8/nethogs-0.8.0.tar.gz
下载安装包:nethogs-0.8.0.tar.gz (38.0 kB)ubuntu

二、安装windows

yum install -y gcc gcc-c++ libpcap* libpcap-devel* ncurses* 安全

tar -zxvf nethogs-0.8.0.tar.gz 
cd nethogs 
make && make install网络

三、问题dom

若是在执行nethogs时出现:ioctl failed while establishing local IP for selected device eth0. You may specify the device on the command line.工具

须要找对接口:ip route show | grep default 查看一下是eth0 仍是eth1ui

而后在执行:nethogs eth1.net

问题原文:https://askubuntu.com/questions/261024/nethogs-ioctl-failed-while-establishing-local-ip命令行

四、命令行参数

 如下就是NetHogs命令行的参数,用’-d’来添加刷新频率参数,`device name` 用来检测给定的某个或者某些设备的带宽(默认是eth0).例如:设置5秒钟的刷新频率,键入以下命令便可:

# nethogs -d 5 

若是只用来监视设备(eth0)的网络带宽可使用以下命令:

# nethogs eth0 

若是要同时监视eth0和eth1接口,使用如下命令便可:

# nethogs eth0 eth1 

 

其余参数和用法:

-d:delay for refresh rate,default is 1. 

-h:display available commands usage. 

-p:sniff in promiscious mode (not recommended). 

-t:tracemode. 

-b:bughunt mode - implies tracemode.

-V:prints Version info.

  

NetHogs 交互控制

如下是NetHogs的一些颇有用的交互控制(键盘快捷键):

m:cycle between display modes (kb/s, kb, b, mb)

r:sort by 'received’

s:sort by 'sent’

q:quit

相关文章
相关标签/搜索