Ubuntu怎样监控流量
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
- Sunmover
- 帖子: 2339
- 注册时间: 2010-05-24 13:02
- 来自: 星城长沙
Ubuntu怎样监控流量
最近发现Ubuntu疯狂上传(没开P2P软件),开始以为是虚拟机里面的程序,但是关闭虚拟机仍然上传并且上传非常有规律,从添加到面板上的“系统监视器”的图形就像一把梳子。
我怀疑系统是不是被黑了注了病毒在我系统里。。。
所以,希望各位介绍一款流量监控软件,可以监控系统里哪个程序在偷偷上传数据,哪个程序在下载数据。
没有软件的话,命令也可以。只要能监控哪个程序在访问网络,最好是知道各个访问网络的程序下载/上传的速率是多少。。。
谢谢解答!
我怀疑系统是不是被黑了注了病毒在我系统里。。。
所以,希望各位介绍一款流量监控软件,可以监控系统里哪个程序在偷偷上传数据,哪个程序在下载数据。
没有软件的话,命令也可以。只要能监控哪个程序在访问网络,最好是知道各个访问网络的程序下载/上传的速率是多少。。。
谢谢解答!
- astolia
- 论坛版主
- 帖子: 6703
- 注册时间: 2008-09-18 13:11
Re: Ubuntu怎样监控流量
这个看当前有网络连接的程序
代码: 全选
sudo netstat -autlnp
- momova
- 帖子: 3381
- 注册时间: 2007-07-11 21:43
- 系统: archlinux
- 来自: 东江边
- momova
- 帖子: 3381
- 注册时间: 2007-07-11 21:43
- 系统: archlinux
- 来自: 东江边
- eexpress
- 帖子: 58428
- 注册时间: 2005-08-14 21:55
- 来自: 长沙
- Sunmover
- 帖子: 2339
- 注册时间: 2010-05-24 13:02
- 来自: 星城长沙
Re: Ubuntu怎样监控流量
正看netstat命令的用法,谢谢!astolia 写了: sudo netstat -autlnp
netstat 写了: 功能说明:显示网络状态。
语 法:netstat [-acCeFghilMnNoprstuvVwx][-A<网络类型>][--ip]
补充说明:利用netstat指令可让你得知整个Linux系统的网络情况。
参 数:
-a或--all 显示所有连线中的Socket。
-A<网络类型>或--<网络类型> 列出该网络类型连线中的相关地址。
-c或--continuous 持续列出网络状态。
-C或--cache 显示路由器配置的快取信息。
-e或--extend 显示网络其他相关信息。
-F或--fib 显示FIB。
-g或--groups 显示多重广播功能群组组员名单。
-h或--help 在线帮助。
-i或--interfaces 显示网络界面信息表单。
-l或--listening 显示监控中的服务器的Socket。
-M或--masquerade 显示伪装的网络连线。
-n或--numeric 直接使用IP地址,而不通过域名服务器。
-N或--netlink或--symbolic 显示网络硬件外围设备的符号连接名称。
-o或--timers 显示计时器。
-p或--programs 显示正在使用Socket的程序识别码和程序名称。
-r或--route 显示Routing Table。
-s或--statistice 显示网络工作信息统计表。
-t或--tcp 显示TCP传输协议的连线状况。
-u或--udp 显示UDP传输协议的连线状况。
-v或--verbose 显示指令执行过程。
-V或--version 显示版本信息。
-w或--raw 显示RAW传输协议的连线状况。
-x或--unix 此参数的效果和指定"-A unix"参数相同。
--ip或--inet 此参数的效果和指定"-A inet"参数相同。
相当给力呀!(虽然还不怎么会用,呵呵)momova 写了:最好的是nethogs

代码: 全选
sudo apt-get install nethogs
sudo nethogs ppp0
man nethogs
nethogs -h
nethogs 写了: 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.
-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
谢谢,两个命令功能一点都不逊啊eexpress 写了:iptraf 、 iftop

sudo apt-get install iftopsudo apt-get install iptraf
sudo iptraf -h <-----看下帮助都要root权限,真邪门×_×|||
iptraf 写了:Syntax:
iptraf [ -f ] [ -u ] [ { -i iface | -g | -d iface | -s iface | -z iface |
-l iface } [ -t timeout ] [ -B ] [ -L logfile ] [-I interval] ]
Issue the iptraf command with no parameters for menu-driven operation.
These options can also be supplied to the command:
-i iface - start the IP traffic monitor (use "-i all" for all interfaces)
-g - start the general interface statistics
-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 ("-l all" for all LAN interfaces)
-B - run in background (use only with one of the above parameters)
-t timeout - when used with one of the above parameters, tells
the facility to run only for the specified number of
minutes (timeout)
-L logfile - specifies an alternate log file for any direct invocation
of a facility from the command line. The log is placed in
/var/log/iptraf if path is not specified.
-I interval - specifies the log interval for all facilities except the IP
traffic monitor. Value is in minutes.
-f - clear all locks and counters. Use with great caution.
Normally used to recover from an abnormal termination.
-u - allow use of unsupported interfaces as ethernet devices.
iftop -h
iftop 写了:iftop: display bandwidth usage on an interface by host
Synopsis: iftop -h | [-npbBP] [-i interface] [-f filter code] [-N net/mask]
-h display this message
-n don't do hostname lookups
-N don't convert port numbers to services
-p run in promiscuous mode (show traffic between other
hosts on the same network segment)
-b don't display a bar graph of traffic
-B Display bandwidth in bytes
-i interface listen on named interface
-f filter code use filter code to select packets to count
(default: none, but only IP packets are counted)
-F net/mask show traffic flows in/out of network
-P show ports as well as hosts
-m limit sets the upper limit for the bandwidth scale
-c config file specifies an alternative configuration file
iftop, version 0.17
总之,谢谢各位关注本帖的朋友,还有方案尽可能拿出来分享,无论是否完美,就当是复习知识吧,呵呵。

- momova
- 帖子: 3381
- 注册时间: 2007-07-11 21:43
- 系统: archlinux
- 来自: 东江边
Re: Ubuntu怎样监控流量
nethogs也不是最好的,是最直观的吧,能满足一般需要。
用法有
最简单的用法是:
比如我用的是无线路由上网的:
这样就可以了。如果没指定设备,那默认的是eth0。

用法有
最简单的用法是:
代码: 全选
sudo nethogs 网络设置
代码: 全选
sudo nethogs wlan0
我来了,我看见了,我征服了!
求勾搭,不管饭。
求勾搭,不管饭。
- momova
- 帖子: 3381
- 注册时间: 2007-07-11 21:43
- 系统: archlinux
- 来自: 东江边
-
- 帖子: 18311
- 注册时间: 2008-01-09 22:41
- onshoestring
- 论坛版主
- 帖子: 4666
- 注册时间: 2009-09-06 5:53
- momova
- 帖子: 3381
- 注册时间: 2007-07-11 21:43
- 系统: archlinux
- 来自: 东江边
-
- 帖子: 1
- 注册时间: 2009-11-15 9:44
Re: Ubuntu怎样监控流量
我还是觉得netspeed在平时用好些,如果想监控的话当然还是nethogs.
再在上面面板上右键--->添加到面板--->网络监视器 添加就OK了。
代码: 全选
sudo apt-get install netspeed
- Sunmover
- 帖子: 2339
- 注册时间: 2010-05-24 13:02
- 来自: 星城长沙
Re: Ubuntu怎样监控流量
记得AWN自带这个东东。。。Netspeed看起来有点像360的流量监控条,用惯了那个家伙看见类似的就有查看的冲动但是Netspeed却没有这个功能。。。那心里痒的呀。。。受不了dpeal 写了:我还是觉得netspeed在平时用好些,如果想监控的话当然还是nethogs.再在上面面板上右键--->添加到面板--->网络监视器 添加就OK了。代码: 全选
sudo apt-get install netspeed
BTW:现在在面板上我添加了“系统监视器”可以检测“处理器”、“内存”、“网络”、“交换空间”、"负载”、“硬盘”一系列参数。遗憾的是,不能直接显示相应的数值(-->Graph)。。。
- shuizhongyu
- 帖子: 287
- 注册时间: 2012-11-06 12:43
- 系统: arch,ubuntu
- 来自: 安徽合肥
- 联系: