2015年(68)
分类: 系统运维
2015-08-31 19:38:33
LINUX上有不少好用的实时查看网络流量的开源工具,像iptraf、iftop、ifstat等,只是这些工具一般都是查看网络的总体概况。如果系统上部有有多个应用,想知道各应用的实时流量,这时nethogs就派上用场了。
安装:
[root@localhost ~]# yum install nethogs
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package nethogs.x86_64 0:0.7-3.20080627cvs.el5 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
========================================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================================
Installing:
nethogs x86_64 0.7-3.20080627cvs.el5 epel 28 k
Transaction Summary
========================================================================================================================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 28 k
Is this ok [y/N]: y
使用:
[root@localhost ~]#nethogs
详细用法:
[root@localhost ~]# nethogs -h
usage: nethogs [-V] [-b] [-d seconds] [-t] [-p] [device [device [device ...]]]
-V : prints version.
-d : delay for update refresh rate in seconds. default is 1. //刷新间隔
-t : tracemode. //trace模式
-b : bughunt mode - implies tracemode. //调试模式
-p : sniff in promiscious mode (not recommended).
device : device(s) to monitor. default is eth0 //监控网卡
When nethogs is running, press:
q: quit
m: switch between total and kb/s mode
如
[root@localhost ~]# nethogs -d 5 eth0