iftop编译安装

iftop编译安装

1、下载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

提示: configure: error: can’t find pcap.h You’re not going to get very far without libpcap. 需要先安装libpcap

2、安装libpcap

wget http://www.tcpdump.org/release/libpcap-1.5.3.tar.gz

tar -xzvf libpcap-1.5.3.tar.gz

cd libpcap-1.5.3/

./configure

提示:“Your operating system’s lex is insufficient to compile libpcap. flex is a lex replacement that has many advantages, including being able to compile libpcap. “ 系统中未安装flex,需要先安装

yum -y install flex

再次运行./configure命令,生成相应的Makefile文件,运行make报错:“yacc -d grammar.y make: yacc: Command not found make: *** [grammar.c] Error 127"

yum -y install byacc

重新运行 ./configure

make && make install #完成libpcap安装

3、重新编译iftop配置

cd iftop-0.17

./configure

提示: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. 找不到支持 mvchgat 的 curses 库,安装 ncurses。

yum -y install ncurses

yum -y install ncurses-devel

确保ncurses和ncurses-devel都装上

make && make install

安装完iftop工具后,直接输入iftop命令即可显示网卡实时流量信息

iftop详解:https://baijiahao.baidu.com/s?id=1694894374565529986&wfr=spider&for=pc

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值