iftop这个小工具是Linux和unix下的top命令升级版,功能相对较强,界面易懂。今天安装了CentOS6.5的最新版,装个小工具检查下系统运行性能。
官网:http://www.ex-parrot.com/~pdw/iftop/
但现在进入到iftop的官网查看还是跟以前的介绍一样 目前最稳定的版本还是0.17帮 注:
Download
The latest stable version of iftop is 0.17. Older and newer (pre-release) version are available from the downloads directory. I am always keen to hear of any problems with the latest pre-release versions (that's what they're there for) so please do try them. N.B. these are versioned as pre-releases, so 0.17 is the final release, and comes after 0.17pre*
Download: iftop-0.17.tar.gz or iftop-1.0pre3.tar.gz.
If you wish to be notified of new releases of iftop then please subscribe to the Freshmeat project, or the mailing list. If you're using Freshmeat, please consider adding a rating or comment to the project.
所以选择0,。17版本 安装方式当然有两种 源码和rpm包。(Centos 的yum源里默认没有iftop这个工具)
当然在安装前需要几个依赖包的支持,flex byacc ncurses ncurses-devel libpcap
上面两个安装包有版本要求需要是libpcap-0.9.4-14.el5.x86_64.rpm 0.9.4版本的libpcap包 当然如果你是x86的系统需要安装i386的rpm包
关于如何下载到这个rpm包 你可以用Google搜索引擎 去找到相应的源下载地址。
我贴上一个 i386的下载地址列表 http://rpm.pbone.net/index.php3/stat/4/idpl/15976291/dir/scientific_linux_5/com/libpcap-0.9.4-15.el5.i386.rpm.html
安装libpcap
首先查看是否已经有高版本的libpcap
rpm -qa | grep libpcap
如果有可以运行 rpm -ef libpcap
再次确认rpm -qa | grep libpcap
没有就可以安装了
rpm -ivh libpcap-0.9.4-15.el5.i386.rpm
安装完成后就可以安装iftop了
如果有rpm版的直接运行
rpm -ivh iftop-0.17-1.el5.rf.i386.rpm
安装成功后就可以运行 iftop命令了
如果是源码包
tar zxvf iftop-0.17.tar.gz
cd iftop-0.17
./configure
make && make install