最小化安装centos后安装iftop
下载iftop软件
tar -zxvf iftop-0.17.tar.gz
cd iftop-0.17
./configure
./configure过程中出现类似下文错误
(1)checking whether make sets ${MAKE}... no
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
没有安装gcc导致该问题,yum -y install gcc 安装gcc即可
(2)重新./configure又报如下错误
checking where to find pcap.h... no idea
configure: error: can't find pcap.h
You're not going to get very far without libpcap.
缺少libpcap libpcap-devel这两个包,
yum -y install libpcap libpcap-devel 进行安装
(3)再次编译报如下错误
checking for a curses library containing mvchgat... none found
configure: error: Curses! Foiled again!
(Can't find a curses library supporting mvchgat.)
Consider installing ncurses.
yum -y install ncurses-devel安装缺少文件
-bash: make: command not found
没有安装make导致该问题,yum -y install make 安装make即可
yum安装完make之后,执行make命令如果出错,重新.configure文件,make && make install
最后iftop命令查看网卡流量信息