CentOS如何安装iftop来查看网络流量

之前有写过,但一些没有组件的无法安装,这里写下安装组件的

安装所需组件

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 http://www.ex-parrot.com/~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下监控网卡流量的软件iftop

官网上说使用iftop需要libpcap和libcurses这两个包。

用命令查找了一下

# rpm -qa | grep libpcap

libpcap-0.9.4-8.1

只找到了这个,缺少libpcap-devel-0.9.4就继续安装了。

出错了:configure: error: can’t find pcap.h You’re not going to get very far without libpcap.

我用的是Redhat EL5.3系统,从安装盘里找了libpcap的rpm包,安装后再编译,安装成功。

# rpm -ivh libpcap-devel-0.9.4-14.el5.i386.rpm

Libcurses这个包没装过,因为安装时也没出错,所以暂时就没装!

安装iftop:

# wget http://www.ex-parrot.com/%7Epdw/iftop/download/iftop-0.17.tar.gz

# tar zxvf iftop-0.17.tar.gz

# cd iftop-0.17

# ./configure –prefix=/usr/local/iftop && make && make install

# /usr/local/iftop/sbin/iftop //默认监测eth0网卡流量


© 2024 软件教程网 | 联系我们: webmaster# 3062.net.cn