技术员联盟提供win764位系统下载,win10,win7,xp,装机纯净版,64位旗舰版,绿色软件,免费软件下载基地!

当前位置:主页 > 教程 > 服务器类 >

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

来源:技术员联盟┆发布时间:2018-10-22 18:20┆点击:

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

  安装所需组件

  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下监控网卡流量的软件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 %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 //默认监测eth0网卡流量