之前有寫過,但一些沒有組件的無法安裝,這里寫下安裝組件的
安裝所需組件
yum list | grep libp
yum install libp*
wget ftp://ftp.lmd.ens.fr/pub/devil/devel/sources/1.2/libpcap-0.9.8.tar.gz
安裝iftop
wget ~pdw/iftop/download/iftop-0.17.tar.gz
tar zxvf iftop-0.17.tar.gz
cd iftop-0.17
./configure
make
make install
安裝完后使用命令
iftop -i eth0 -n 查看eth0的流量
退出按q
卸載:make clean iftop-0.17
Linux下監(jiān)控網(wǎng)卡流量的軟件iftop
官網(wǎng)上說使用iftop需要libpcap和libcurses這兩個(gè)包。
用命令查找了一下
# rpm -qa | grep libpcap
libpcap-0.9.4-8.1
只找到了這個(gè),缺少libpcap-devel-0.9.4就繼續(xù)安裝了。
出錯(cuò)了:configure: error: can’t find pcap.h You’re not going to get very far without libpcap.
我用的是Redhat EL5.3系統(tǒng),從安裝盤里找了libpcap的rpm包,安裝后再編譯,安裝成功。
# rpm -ivh libpcap-devel-0.9.4-14.el5.i386.rpm
Libcurses這個(gè)包沒裝過,因?yàn)榘惭b時(shí)也沒出錯(cuò),所以暫時(shí)就沒裝!
安裝iftop:
# wget %7Epdw/iftop/download/iftop-0.17.tar.gz
# tar zxvf iftop-0.17.tar.gz
# cd iftop-0.17
# ./configure –prefix=http://www.3lian.com/usr/local/iftop && make && make install
# /usr/local/iftop/sbin/iftop //默認(rèn)監(jiān)測(cè)eth0網(wǎng)卡流量