发表于 2019-2-17 07:34:27

centos7 安装iftop

  # yum install flex byacc libpcap ncurses ncurses-devel libpcap-devel
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Package 14:libpcap-1.5.3-9.el7.x86_64 already installed and latest version
Package ncurses-5.9-14.20130511.el7_4.x86_64 already installed and latest version
Package ncurses-devel-5.9-14.20130511.el7_4.x86_64 already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package byacc.x86_64 0:1.9.20130304-3.el7 will be installed
---> Package flex.x86_64 0:2.5.37-3.el7 will be installed
---> Package libpcap-devel.x86_64 14:1.5.3-9.el7 will be installed
--> Finished Dependency Resolution
  Dependencies Resolved
========================================================================================
Package                Arch            Version                     Repository   Size
  Installing:
byacc                  x86_64          1.9.20130304-3.el7          base         65 k
flex                   x86_64          2.5.37-3.el7                base          292 k
libpcap-devel          x86_64          14:1.5.3-9.el7            base          117 k
Transaction Summary
  Install3 Packages
Total download size: 474 k
Installed size: 1.0 M
Is this ok : y
Downloading packages:
(1/3): byacc-1.9.20130304-3.el7.x86_64.rpm                     |65 kB00:00:01
(2/3): flex-2.5.37-3.el7.x86_64.rpm                              | 292 kB00:00:01
(3/3): libpcap-devel-1.5.3-9.el7.x86_64.rpm                      | 117 kB00:00:00
  Total                                                      187 kB/s | 474 kB00:02
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : flex-2.5.37-3.el7.x86_64                                             1/3
Installing : 14:libpcap-devel-1.5.3-9.el7.x86_64                                  2/3
Installing : byacc-1.9.20130304-3.el7.x86_64                                    3/3
Verifying: byacc-1.9.20130304-3.el7.x86_64                                    1/3
Verifying: 14:libpcap-devel-1.5.3-9.el7.x86_64                                  2/3
Verifying: flex-2.5.37-3.el7.x86_64                                             3/3
  Installed:
byacc.x86_64 0:1.9.20130304-3.el7               flex.x86_64 0:2.5.37-3.el7
libpcap-devel.x86_64 14:1.5.3-9.el7
  Complete!
#
#
# ls
anaconda-ks.cfgCentOS7-Base-163.repolearning.pypythonsoftware
# cd software/
# wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz
--2018-04-04 15:17:12--http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz
Resolving www.ex-parrot.com (www.ex-parrot.com)... 93.93.130.166, 2a00:1098:0:82:1000:0:1:2
Connecting to www.ex-parrot.com (www.ex-parrot.com)|93.93.130.166|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 160381 (157K)
Saving to: ‘iftop-0.17.tar.gz’
  100%[==============================================>] 160,381      101KB/s   in 1.5s
  2018-04-04 15:17:15 (101 KB/s) - ‘iftop-0.17.tar.gz’ saved
  # tar -xfiftop-0.17.tar.gz
# chown -R root.root iftop-0.17
# cd iftop-0.17
# ./configure --help
`configure' configures this package to adapt to many kinds of systems.
  Usage: ./configure ... ...
  To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.See below for descriptions of some of the useful variables.
  Defaults for the options are specified in brackets.
  Configuration:
-h, --help            display this help and exit
--help=short      display options specific to this package
--help=recursive    display the short help of all the included packages
-V, --version         display version information and exit
-q, --quiet, --silent   do not print checking...' messages--cache-file=FILE   cache test results in FILE -C, --config-cache      alias for--cache-file=config.cache'
-n, --no-create         do not create output files
--srcdir=DIR      find the sources in DIR
  Installation directories:
--prefix=PREFIX         install architecture-independent files in PREFIX

--exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX

  By default, make install' will install all the files in/usr/local/bin', /usr/local/lib' etc.You can specifyan installation prefix other than/usr/local' using --prefix',for instance--prefix=$HOME'.
  For better control, use the options below.
  Fine tuning of the installation directories:
--bindir=DIR         user executables
--sbindir=DIR          system admin executables
--libexecdir=DIR       program executables
--datadir=DIR          read-only architecture-independent data
--sysconfdir=DIR       read-only single-machine data
--sharedstatedir=DIR   modifiable architecture-independent data
--localstatedir=DIR    modifiable single-machine data
--libdir=DIR         object code libraries
--includedir=DIR       C header files
--oldincludedir=DIR    C header files for non-gcc
--infodir=DIR          info documentation
--mandir=DIR         man documentation
  Program names:
--program-prefix=PREFIX            prepend PREFIX to installed program names
--program-suffix=SUFFIX            append SUFFIX to installed program names
--program-transform-name=PROGRAM   run sed PROGRAM on installed program names
  System types:
--build=BUILD   configure for building on BUILD
--host=HOST       cross-compile to build programs to run on HOST
--target=TARGET   configure for building compilers for TARGET
  Optional Features:
--disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG]include FEATURE
--disable-dependency-tracking Speeds up one-time builds
--enable-dependency-trackingDo not reject slow dependency extractors
--enable-default-promiscuous If enabled, iftop will operate in promiscuous mode
to capture outgoing packets
  Optional Packages:
--with-PACKAGE[=ARG]    use PACKAGE
--without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
--with-resolver=TYPE    Technique iftop should use for name resolution.
Valid options are:
netdb          use gethostbyaddr_r in multiple
threads.
netdb_1threaduse gethostbyaddr_r and
assume it is not reentrant.
ares         use the MIT ARES asynchronous
resolver library.
forking      use the REALLY SUCKY forking resolver.
guess          run experiments to guess a
reasonable value.Only works if you
aren't cross-compiling.This
is the default.guess will
either select netdb or netdb_1thread.
none         don't do name resolution.
--with-libpcap=WHERE    Where the libpcap packet-capture library is found.
The pcap library should be installedin WHERE/lib,
and the header file in either WHERE/include or
WHERE/include/pcap.
default=look in standard locations
  Some influential environment variables:
CC          C compiler command
CFLAGS      C compiler flags
LDFLAGS   linker flags, e.g. -L if you have libraries in a
nonstandard directory
CPPFLAGS    C/C++ preprocessor flags, e.g. -I if you have
headers in a nonstandard directory
CPP         C preprocessor
  Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
  # ./configure --prefix=/opt/iftop --bindir=/usr/bin/^C
# ls -ltr /usr/bin/ | head
total 547436
-rwxr-xr-x1 root root      86504 Jun 102014 yacc
-rwxr-xr-x. 1 root root      11004 Jun 102014 pod2text
-rwxr-xr-x. 1 root root      13581 Jun 102014 pod2man
-rwxr-xr-x. 1 root root      271 Jun 102014 neqn
-rwxr-xr-x. 1 root root       3392 Jun 102014 nroff
-rwxr-xr-x. 1 root root   525272 Jun 102014 troff
-rwxr-xr-x. 1 root root   118744 Jun 102014 tbl
-rwxr-xr-x. 1 root root      33368 Jun 102014 soelim
-rwxr-xr-x. 1 root root      88312 Jun 102014 pre-grohtml
# ./configure --prefix=/opt/iftop --bindir=/usr/bin/
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-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... /include
checking for pcap_open_live in -lpcap... yes
checking pcap.h usability... yes
checking pcap.h presence... yes
checking for pcap.h... yes
checking for a curses library containing mvchgat... -lcurses
checking POSIX threads compilation... CFLAGS= and LIBS=-lpthread
checking POSIX threads usability... yes
checking if we need to enable promiscuous mode by default... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config/Makefile
config.status: creating config.h
config.status: executing depfiles commands
#
  # echo $?
0
# make
makeall-recursive
make: Entering directory /root/software/iftop-0.17'Making all in configmake: Entering directory/root/software/iftop-0.17/config'
make: Nothing to be done for all'.make: Leaving directory/root/software/iftop-0.17/config'
make: Entering directory /root/software/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-ctest -f 'addr_hash.c' || echo './'addr_hash.csource='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-ctest -f 'edline.c' || echo './'edline.csource='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-ctest -f 'hash.c' || echo './'hash.csource='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-ctest -f 'iftop.c' || echo './'iftop.csource='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-ctest -f 'ns_hash.c' || echo './'ns_hash.csource='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-ctest -f 'options.c' || echo './'options.csource='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-ctest -f 'resolver.c' || echo './'resolver.csource='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-ctest -f 'screenfilter.c' || echo './'screenfilter.csource='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-ctest -f 'serv_hash.c' || echo './'serv_hash.csource='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-ctest -f 'sorted_list.c' || echo './'sorted_list.csource='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-ctest -f 'threadprof.c' || echo './'threadprof.csource='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-ctest -f 'ui.c' || echo './'ui.csource='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-ctest -f 'util.c' || echo './'util.csource='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-ctest -f 'addrs_ioctl.c' || echo './'addrs_ioctl.csource='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-ctest -f 'addrs_dlpi.c' || echo './'addrs_dlpi.csource='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-ctest -f 'dlcommon.c' || echo './'dlcommon.csource='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-ctest -f 'stringmap.c' || echo './'stringmap.csource='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-ctest -f 'cfgfile.c' || echo './'cfgfile.csource='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-ctest -f 'vector.c' || echo './'vector.cgcc-g -O2    -o iftopaddr_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 -lpthreadmake: Leaving directory/root/software/iftop-0.17'
make: Leaving directory /root/software/iftop-0.17'# make installMaking install in configmake: Entering directory/root/software/iftop-0.17/config'
make: Entering directory /root/software/iftop-0.17/config'make: Nothing to be done forinstall-exec-am'.
make: Nothing to be done for install-data-am'.make: Leaving directory/root/software/iftop-0.17/config'
make: Leaving directory /root/software/iftop-0.17/config'make: Entering directory/root/software/iftop-0.17'
make: Entering directory /root/software/iftop-0.17'/bin/sh ./config/mkinstalldirs /opt/iftop/sbinmkdir -p -- /opt/iftop/sbin/usr/bin/install -c iftop /opt/iftop/sbin/iftop/bin/sh ./config/mkinstalldirs /opt/iftop/man/man8mkdir -p -- /opt/iftop/man/man8/usr/bin/install -c -m 644 ./iftop.8 /opt/iftop/man/man8/iftop.8make: Leaving directory/root/software/iftop-0.17'
make: Leaving directory `/root/software/iftop-0.17'
#
  # which iftop
/usr/bin/which: no iftop in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/local/python3/bin:/root/bin)
  # ln -s /opt/iftop/sbin/iftop /usr/bin/iftop
# which iftop
/usr/bin/iftop
#
#
# iftop
interface: ens33
IP address is: 192.168.2.180
MAC address is: 00:0c:29:cc:cf:6f
#



页: [1]
查看完整版本: centos7 安装iftop