CentOS5 上安裝iftop工具

出自Centos

跳转到: 导航, 搜索

官方网站:http://www.ex-parrot.com/~pdw/iftop/ 图形模式下:http://etherape.sourceforge.net/

[编辑] 下载repo库包

[root@xingke ~]# wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
--21:57:20--  http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Resolving dag.wieers.com... 62.213.193.164
Connecting to dag.wieers.com|62.213.193.164|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://rpmforge.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm [following]
--21:57:21--  http://rpmforge.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Resolving rpmforge.sw.be... 130.133.35.16, 88.198.65.175
Connecting to rpmforge.sw.be|130.133.35.16|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 16698 (16K) [application/x-rpm]
Saving to: `rpmforge-release-0.3.6-1.el5.rf.i386.rpm'

100%[=====================================================================================================================>] 16,698      1.35K/s   in 12s

21:57:36 (1.35 KB/s) - `rpmforge-release-0.3.6-1.el5.rf.i386.rpm' saved [16698/16698]

[root@xingke ~]# rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Preparing...                ########################################### [100%]
        package rpmforge-release-0.3.6-1.el5.rf is already installed

通过yum安装iftop

[root@xingke ~]# yum -y install iftop
Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
 * rpmforge: fr2.rpmfind.net
 * base: centos.candishosting.com.cn
 * updates: centos.mirror.cdnetworks.com
 * addons: centos.candishosting.com.cn
 * extras: centos.candishosting.com.cn
rpmforge                  100% |=========================| 1.1 kB    00:00
base                      100% |=========================| 1.1 kB    00:00
updates                   100% |=========================|  951 B    00:00
addons                    100% |=========================|  951 B    00:00
extras                    100% |=========================| 1.1 kB    00:00
Setting up Install Process
Parsing package install arguments
Resolving Dependencies
--> Running transaction check
---> Package iftop.i386 0:0.17-1.el5.rf set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 iftop                   i386       0.17-1.el5.rf    rpmforge           45 k

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)

Total download size: 45 k
Downloading Packages:
(1/1): iftop-0.17-1.el5.r 100% |=========================|  45 kB    00:02
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing: iftop                        ######################### [1/1]

Installed: iftop.i386 0:0.17-1.el5.rf
Complete!

使用帮助

[root@xingke ~]# iftop -h
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
copyright (c) 2002 Paul Warren <pdw@ex-parrot.com> and contributors
[root@xingke ~]#

[编辑] 其他linux流量查看工具

nload–monitors network traffic and bandwidth usage http://www.roland-riegel.de/nload/index.html

iftraf–Linux Interface Traffic Monitor

http://freshmeat.net/projects/iftraf/


[编辑] 参考资料

http://www.xiaojb.com/archives/tips/linux-nic-traffic.shtml

个人工具