Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1284877
  • 博文数量: 161
  • 博客积分: 10192
  • 博客等级: 上将
  • 技术积分: 2165
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-27 17:09
文章分类

全部博文(161)

文章存档

2012年(2)

2011年(13)

2010年(137)

2009年(5)

2008年(4)

我的朋友

分类: LINUX

2010-08-28 21:10:37

iftop
查看实时的网络流量,监控TCP/IP连接等,类似于top的实时流量监控工具。也类似iptraf.
HomePage:~pdw/iftop/
1。安装
CentOS5.5下
yum install iftop
2.运行

直接运行: iftop

效果如下图:

界面上面显示的是类似刻度尺的刻度范围,为显示流量图形的长条作标尺用的。

中间的<= =>这两个左右箭头,表示的是流量的方向。

TX:发送流量
RX:接收流量
TOTAL:总流量
Cumm:运行iftop到目前时间的总流量
peak:流量峰值
rates:分别表示过去 2s 10s 40s 的平均流量

3。参数

常用的参数

-i设定监测的网卡,如:# iftop -i eth1

-B 以bytes为单位显示流量(默认是bits),如:# iftop -B

-n使host信息默认直接都显示IP,如:# iftop -n

-N使端口信息默认直接都显示端口号,如: # iftop -N

-F显示特定网段的进出流量,如# iftop -F 10.10.1.0/24或# iftop -F 10.10.1.0/255.255.255.0

-h(display this message),帮助,显示参数信息

-p使用这个参数后,中间的列表显示的本地主机信息,出现了本机以外的IP信息;

-b使流量图形条默认就显示;

-f这个暂时还不太会用,过滤计算包用的;

-P使host信息及端口信息默认就都显示;

-m设置界面最上边的刻度的最大值,刻度分五个大段显示,例:# iftop -m 100M

进入iftop画面后的一些操作命令(注意大小写)

h切换是否显示帮助;

n切换显示本机的IP或主机名;

s切换是否显示本机的host信息;

d切换是否显示远端目标主机的host信息;

t切换显示格式为2行/1行/只显示发送流量/只显示接收流量;

N切换显示端口号或端口服务名称;

S切换是否显示本机的端口信息;

D切换是否显示远端目标主机的端口信息;

p切换是否显示端口信息;

P切换暂停/继续显示;

b切换是否显示平均流量图形条;

B切换计算2秒或10秒或40秒内的平均流量;

T切换是否显示每个连接的总流量;

l打开屏幕过滤功能,输入要过滤的字符,比如ip,按回车后,屏幕就只显示这个IP相关的流量信息;

L切换显示画面上边的刻度;刻度不同,流量图形条会有变化;

j或按k可以向上或向下滚动屏幕显示的连接记录;

1或2或3可以根据右侧显示的三列流量数据进行排序;

<根据左边的本机名或IP排序;

>根据远端目标主机的主机名或IP排序;

o切换是否固定只显示当前的连接;

f可以编辑过滤代码,这是翻译过来的说法,我还没用过这个!

!可以使用shell命令,这个没用过!没搞明白啥命令在这好用呢!

q退出监控。

--------------------------------------

dstat:


Usage: dstat [-afv] [options..] [delay [count]]
Versatile tool for generating system resource statistics

Dstat options:
  -c, --cpu              enable cpu stats
     -C 0,3,total           include cpu0, cpu3 and total
  -d, --disk             enable disk stats
     -D total,hda           include hda and total
  -g, --page             enable page stats
  -i, --int              enable interrupt stats
     -I 5,eth2              include int5 and interrupt used by eth2
  -l, --load             enable load stats
  -m, --mem              enable memory stats
  -n, --net              enable network stats
     -N eth1,total          include eth1 and total
  -p, --proc             enable process stats
  -s, --swap             enable swap stats
     -S swap1,total         include swap1 and total
  -t, --time             enable time/date output
  -T, --epoch            enable time counter (seconds since epoch)
  -y, --sys              enable system stats
  --ipc                  enable ipc stats
  --lock                 enable lock stats
  --raw                  enable raw stats
  --tcp                  enable tcp stats
  --udp                  enable udp stats
  --unix                 enable unix stats

  -M stat1,stat2         enable external stats
     --mods stat1,stat2

  -a, --all              equals -cdngy (default)
  -f, --full             expand -C, -D, -I, -N and -S discovery lists
  -v, --vmstat           equals -pmgdsc -D total

  --integer              show integer values
  --nocolor              disable colors (implies --noupdate)
  --noheaders            disable repetitive headers
  --noupdate             disable intermediate updates
  --output file          write CSV output to file

  delay is the delay in seconds between each update
  count is the number of updates to display before exiting
  The default delay is 1 and count is unspecified (unlimited)
-------------------------------------------------------------

mtr: my traceroute

阅读(1496) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-08-30 21:50:48

Download More than 1000 free IT eBooks: http://free-ebooks.appspot.com

chinaunix网友2010-08-30 21:50:48

Download More than 1000 free IT eBooks: http://free-ebooks.appspot.com