1.安装iftop
# wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz
# yum install libpcap-devel -y
# cd iftop-0.17
# ./configure --prefix=/usr/local/iftop ;make ;make install
# ln -s /usr/local/iftop/sbin/iftop /usr/local/bin/
2.运行iftop命令
# iftop -n -i eth0 -P
3.遇到的报错
执行make & make install安装时报错:
Can't find a curses library supporting mvchgat
原因:缺少curses相关组件
解决:确保ncurses和ncurses-devel都装上,rpm -qa查询ncurses-devel没有安装上
# rpm -qa | grep ncurse*
ncurses-5.9-13.20130511.el7.x86_64ncurses-libs-5.9-13.20130511.el7.x86_64
ncurses-base-5.9-13.20130511.el7.noarch
安装ncurses-devel
# yum install -y ncurses-devel
# rpm -qa | grep ncurse*
ncurses-5.9-13.20130511.el7.x86_64ncurses-devel-5.9-13.20130511.el7.x86_64
ncurses-libs-5.9-13.20130511.el7.x86_64
ncurses-base-5.9-13.20130511.el7.noarch
#