2013年10月23日 星期三

RedHat 5.5 64 Bit 安裝 iftop


以下這一個檔案不分32Bit or 64Bit
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

checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets ${MAKE}... yes
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/sockio.h usability... no
checking sys/sockio.h presence... no
checking for sys/sockio.h... no
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking sys/dlpi.h usability... no
checking sys/dlpi.h presence... no
checking for sys/dlpi.h... no
checking for regcomp... yes
checking for select... yes
checking for strdup... yes
checking for strerror... yes
checking for strspn... yes
checking for library containing socket... none required
checking for library containing log... -lm
checking for gethostbyname... yes
checking for library containing inet_aton... none required
checking for library containing inet_pton... none required
checking for inet_aton... yes
checking for inet_pton... yes
checking size of u_int8_t... 1
checking size of u_int16_t... 2
checking size of u_int32_t... 4
checking for library containing getnameinfo... none required
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.

你需要安裝 libpcap-devel


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.

你需要將 ncurses和ncurses-devel都装上


make && make install

make  all-recursive
make[1]: Entering directory `/root/iftop-0.17'
Making all in config
make[2]: Entering directory `/root/iftop-0.17/config'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/iftop-0.17/config'
make[2]: Entering directory `/root/iftop-0.17'
source='addr_hash.c' object='addr_hash.o' libtool=no \
       depfile='.deps/addr_hash.Po' tmpdepfile='.deps/addr_hash.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'addr_hash.c' || echo './'`addr_hash.c
source='edline.c' object='edline.o' libtool=no \
       depfile='.deps/edline.Po' tmpdepfile='.deps/edline.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'edline.c' || echo './'`edline.c
source='hash.c' object='hash.o' libtool=no \
       depfile='.deps/hash.Po' tmpdepfile='.deps/hash.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'hash.c' || echo './'`hash.c
source='iftop.c' object='iftop.o' libtool=no \
       depfile='.deps/iftop.Po' tmpdepfile='.deps/iftop.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'iftop.c' || echo './'`iftop.c
source='ns_hash.c' object='ns_hash.o' libtool=no \
       depfile='.deps/ns_hash.Po' tmpdepfile='.deps/ns_hash.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'ns_hash.c' || echo './'`ns_hash.c
source='options.c' object='options.o' libtool=no \
       depfile='.deps/options.Po' tmpdepfile='.deps/options.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'options.c' || echo './'`options.c
source='resolver.c' object='resolver.o' libtool=no \
       depfile='.deps/resolver.Po' tmpdepfile='.deps/resolver.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'resolver.c' || echo './'`resolver.c
source='screenfilter.c' object='screenfilter.o' libtool=no \
       depfile='.deps/screenfilter.Po' tmpdepfile='.deps/screenfilter.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'screenfilter.c' || echo './'`screenfilter.c
source='serv_hash.c' object='serv_hash.o' libtool=no \
       depfile='.deps/serv_hash.Po' tmpdepfile='.deps/serv_hash.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'serv_hash.c' || echo './'`serv_hash.c
source='sorted_list.c' object='sorted_list.o' libtool=no \
       depfile='.deps/sorted_list.Po' tmpdepfile='.deps/sorted_list.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'sorted_list.c' || echo './'`sorted_list.c
source='threadprof.c' object='threadprof.o' libtool=no \
       depfile='.deps/threadprof.Po' tmpdepfile='.deps/threadprof.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'threadprof.c' || echo './'`threadprof.c
source='ui.c' object='ui.o' libtool=no \
       depfile='.deps/ui.Po' tmpdepfile='.deps/ui.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'ui.c' || echo './'`ui.c
source='util.c' object='util.o' libtool=no \
       depfile='.deps/util.Po' tmpdepfile='.deps/util.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'util.c' || echo './'`util.c
source='addrs_ioctl.c' object='addrs_ioctl.o' libtool=no \
       depfile='.deps/addrs_ioctl.Po' tmpdepfile='.deps/addrs_ioctl.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'addrs_ioctl.c' || echo './'`addrs_ioctl.c
source='addrs_dlpi.c' object='addrs_dlpi.o' libtool=no \
       depfile='.deps/addrs_dlpi.Po' tmpdepfile='.deps/addrs_dlpi.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'addrs_dlpi.c' || echo './'`addrs_dlpi.c
source='dlcommon.c' object='dlcommon.o' libtool=no \
       depfile='.deps/dlcommon.Po' tmpdepfile='.deps/dlcommon.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'dlcommon.c' || echo './'`dlcommon.c
source='stringmap.c' object='stringmap.o' libtool=no \
       depfile='.deps/stringmap.Po' tmpdepfile='.deps/stringmap.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'stringmap.c' || echo './'`stringmap.c
source='cfgfile.c' object='cfgfile.o' libtool=no \
       depfile='.deps/cfgfile.Po' tmpdepfile='.deps/cfgfile.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'cfgfile.c' || echo './'`cfgfile.c
source='vector.c' object='vector.o' libtool=no \
       depfile='.deps/vector.Po' tmpdepfile='.deps/vector.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'vector.c' || echo './'`vector.c
gcc  -g -O2    -o iftop  addr_hash.o edline.o hash.o iftop.o ns_hash.o options.o resolver.o screenfilter.o serv_hash.o sorted_list.o threadprof.o ui.o util.o addrs_ioctl.o addrs_dlpi.o dlcommon.o stringmap.o cfgfile.o vector.o  -lpcap -lm  -lcurses -lpthread
make[2]: Leaving directory `/root/iftop-0.17'
make[1]: Leaving directory `/root/iftop-0.17'
Making install in config
make[1]: Entering directory `/root/iftop-0.17/config'
make[2]: Entering directory `/root/iftop-0.17/config'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/iftop-0.17/config'
make[1]: Leaving directory `/root/iftop-0.17/config'
make[1]: Entering directory `/root/iftop-0.17'
make[2]: Entering directory `/root/iftop-0.17'
/bin/sh ./config/mkinstalldirs /usr/local/sbin
 /usr/bin/install -c iftop /usr/local/sbin/iftop
/bin/sh ./config/mkinstalldirs /usr/local/man/man8
mkdir -p -- /usr/local/man/man8
/usr/bin/install -c -m 644 ./iftop.8 /usr/local/man/man8/iftop.8
make[2]: Leaving directory `/root/iftop-0.17'
make[1]: Leaving directory `/root/iftop-0.17'
[root@aps24 iftop-0.17]# iftop
interface: eth0
Unable to get IP address for interface: eth0
ioctl(SIOCGIFADDR): Cannot assign requested address
MAC address is: 5c:f3:fc:4b:fa:76

以上這樣就可以使用,在任何位置輸入iftop 即可

沒有留言: