[root@mantisbt01 ~]# 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
Install 3 Packages
Total download size: 474 k
Installed size: 1.0 M
Is this ok [y/d/N]: y
Downloading packages:
(1/3): byacc-1.9.20130304-3.el7.x86_64.rpm | 65 kB 00:00:01
(2/3): flex-2.5.37-3.el7.x86_64.rpm | 292 kB 00:00:01
(3/3): libpcap-devel-1.5.3-9.el7.x86_64.rpm | 117 kB 00:00:00
Total 187 kB/s | 474 kB 00: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!
[root@mantisbt01 ~]#
[root@mantisbt01 ~]#
[root@mantisbt01 ~]# ls
anaconda-ks.cfg CentOS7-Base-163.repo learning.py python software
[root@mantisbt01 ~]# cd software/
[root@mantisbt01 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) [application/gzip]
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 [160381/160381]
[root@mantisbt01 software]# tar -xf iftop-0.17.tar.gz
[root@mantisbt01 software]# chown -R root.root iftop-0.17
[root@mantisbt01 software]# cd iftop-0.17
[root@mantisbt01 iftop-0.17]# ./configure --help
`configure' configures this package to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
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=config.cache'
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or `..']
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[/usr/local]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, make install' will install all the files in
/usr/local/bin', /usr/local/lib' etc. You can specify
/usr/local' using
an installation prefix other than--prefix',
--prefix=$HOME'.
for instance
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--datadir=DIR read-only architecture-independent data [PREFIX/share]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--infodir=DIR info documentation [PREFIX/info]
--mandir=DIR man documentation [PREFIX/man]
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 [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
--target=TARGET configure for building compilers for TARGET [HOST]
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--disable-dependency-tracking Speeds up one-time builds
--enable-dependency-tracking Do 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 [ARG=yes]
--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_1thread use 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 installed in 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
nonstandard directory
CPPFLAGS C/C++ preprocessor flags, e.g. -I
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.
[root@mantisbt01 iftop-0.17]# ./configure --prefix=/opt/iftop --bindir=/usr/bin/^C
[root@mantisbt01 iftop-0.17]# ls -ltr /usr/bin/ | head
total 547436
-rwxr-xr-x 1 root root 86504 Jun 10 2014 yacc
-rwxr-xr-x. 1 root root 11004 Jun 10 2014 pod2text
-rwxr-xr-x. 1 root root 13581 Jun 10 2014 pod2man
-rwxr-xr-x. 1 root root 271 Jun 10 2014 neqn
-rwxr-xr-x. 1 root root 3392 Jun 10 2014 nroff
-rwxr-xr-x. 1 root root 525272 Jun 10 2014 troff
-rwxr-xr-x. 1 root root 118744 Jun 10 2014 tbl
-rwxr-xr-x. 1 root root 33368 Jun 10 2014 soelim
-rwxr-xr-x. 1 root root 88312 Jun 10 2014 pre-grohtml
[root@mantisbt01 iftop-0.17]# ./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
[root@mantisbt01 iftop-0.17]#
[root@mantisbt01 iftop-0.17]# echo $?
0
[root@mantisbt01 iftop-0.17]# make
make all-recursive
make[1]: Entering directory /root/software/iftop-0.17'
/root/software/iftop-0.17/config'
Making all in config
make[2]: Entering directory
make[2]: Nothing to be done for all'.
/root/software/iftop-0.17/config'
make[2]: Leaving directory
make[2]: Entering directory /root/software/iftop-0.17'
test -f 'addr_hash.c' || echo './'
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 -caddr_hash.c
test -f 'edline.c' || echo './'
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 -cedline.c
test -f 'hash.c' || echo './'
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 -chash.c
test -f 'iftop.c' || echo './'
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 -ciftop.c
test -f 'ns_hash.c' || echo './'
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 -cns_hash.c
test -f 'options.c' || echo './'
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 -coptions.c
test -f 'resolver.c' || echo './'
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 -cresolver.c
test -f 'screenfilter.c' || echo './'
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 -cscreenfilter.c
test -f 'serv_hash.c' || echo './'
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 -cserv_hash.c
test -f 'sorted_list.c' || echo './'
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 -csorted_list.c
test -f 'threadprof.c' || echo './'
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 -cthreadprof.c
test -f 'ui.c' || echo './'
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 -cui.c
test -f 'util.c' || echo './'
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 -cutil.c
test -f 'addrs_ioctl.c' || echo './'
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 -caddrs_ioctl.c
test -f 'addrs_dlpi.c' || echo './'
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 -caddrs_dlpi.c
test -f 'dlcommon.c' || echo './'
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 -cdlcommon.c
test -f 'stringmap.c' || echo './'
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 -cstringmap.c
test -f 'cfgfile.c' || echo './'
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 -ccfgfile.c
test -f 'vector.c' || echo './'
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 -cvector.c
/root/software/iftop-0.17'
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
make[1]: Leaving directory /root/software/iftop-0.17'
/root/software/iftop-0.17/config'
[root@mantisbt01 iftop-0.17]# make install
Making install in config
make[1]: Entering directory
make[2]: Entering directory /root/software/iftop-0.17/config'
install-exec-am'.
make[2]: Nothing to be done for
make[2]: Nothing to be done for install-data-am'.
/root/software/iftop-0.17/config'
make[2]: Leaving directory
make[1]: Leaving directory /root/software/iftop-0.17/config'
/root/software/iftop-0.17'
make[1]: Entering directory
make[2]: Entering directory /root/software/iftop-0.17'
/root/software/iftop-0.17'
/bin/sh ./config/mkinstalldirs /opt/iftop/sbin
mkdir -p -- /opt/iftop/sbin
/usr/bin/install -c iftop /opt/iftop/sbin/iftop
/bin/sh ./config/mkinstalldirs /opt/iftop/man/man8
mkdir -p -- /opt/iftop/man/man8
/usr/bin/install -c -m 644 ./iftop.8 /opt/iftop/man/man8/iftop.8
make[2]: Leaving directory
make[1]: Leaving directory `/root/software/iftop-0.17'
[root@mantisbt01 iftop-0.17]#
[root@mantisbt01 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)
[root@mantisbt01 iftop-0.17]# ln -s /opt/iftop/sbin/iftop /usr/bin/iftop
[root@mantisbt01 iftop-0.17]# which iftop
/usr/bin/iftop
[root@mantisbt01 iftop-0.17]#
[root@mantisbt01 iftop-0.17]#
[root@mantisbt01 iftop-0.17]# iftop
interface: ens33
IP address is: 192.168.2.180
MAC address is: 00:0c:29:cc:cf:6f
[root@mantisbt01 iftop-0.17]#