简介:为了对网速有监控,安装iftop,查看网速及流量
1、检查iftop是否安装
whereis iftop
当然,还没安装,以下通过yum源安装iftop。
在这里记得先ping mirrors.163.com看下源的host能否ping通。
不行的话,通过service network restart重启eth0
2、安装iftop相关组件
yum -y install flex byacc libpcap ncurses ncurses-devel libpcap-devel
3、安装iftop
因为我的系统中没有安装wget,所以我在windows先下载iftop的安装包
http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz
之后通过samba的共享文件夹,拷贝到centos中
用tar -zxf xxx.tar.bz2
然后就报这个错。
gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error exit delayed from previous errors
一开始我以为是压缩包坏的,去下其他的。下下来也是一样。然后仔细看了一下,原来这个压缩包没有用gzip格式压缩 所以解压的时候也不用加上z 。直接tar -xf 就可以了。
cd iftop-0.17 进入目录
./configure 使用默认配置
make && make install 编译并安装
yum命令不支持
yum -y install gcc automake autoconf libtool make
4、打开iftop查看网速
此时通过 /usr/local/iftop/sbin/iftop -B,查看网速