Mar 07

linux — install iftop in cent os

iftop is similar as top.top was used to show usage on cpu but iftop show statics on network stream.

 [~]# wget http://www.ex-parrot.com/~pdw/iftop/download/iftop-0.17.tar.gz
–2012-09-07 05:01:03–  http://www.ex-parrot.com/~pdw/iftop/download/iftop-0.17.tar.gz
Resolving www.ex-parrot.com… 93.93.130.44
Connecting to www.ex-parrot.com|93.93.130.44|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 160381 (157K) [application/gzip]
Saving to: `iftop-0.17.tar.gz’

100%[===================================================================================================================>] 160,381      215K/s   in 0.7s

2012-09-07 05:01:04 (215 KB/s) – `iftop-0.17.tar.gz’ saved [160381/160381]

[~]# tar -xvzf iftop-0.17.tar.gz

[~]# cd iftop-0.17

[~/iftop-0.17]# ./configure
checking for library containing gethostbyaddr_r… none required
checking how to call gethostbyaddr_r… 8 args, int return
checking gethostbyaddr_r usability… yes
checking where to find pcap.h… no idea
configure: error: can’t find pcap.h
You’re not going to get very far without libpcap.

[~/iftop-0.17]# yum install libpcap
[~/iftop-0.17]# yum install libpcap-devel.x86_64

Running Transaction
Installing     : libpcap                                                                                                                               1/1

Installed:
libpcap.i386 14:0.9.4-15.el5

Complete!
[~/iftop-0.17]# ./configure –with-libpcap=/usr
[~/iftop-0.17]# make