本文共 17747 字,大约阅读时间需要 59 分钟。
[root@mantisbt01 ~]# yum install flex byacc libpcap ncurses ncurses-devel libpcap-devel
Loaded plugins: fastestmirrorLoading mirror speeds from cached hostfilePackage 14:libpcap-1.5.3-9.el7.x86_64 already installed and latest versionPackage ncurses-5.9-14.20130511.el7_4.x86_64 already installed and latest versionPackage ncurses-devel-5.9-14.20130511.el7_4.x86_64 already installed and latest versionResolving 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 ResolutionDependencies Resolved
Installing:
byacc x86_64 1.9.20130304-3.el7 base 65 kflex x86_64 2.5.37-3.el7 base 292 klibpcap-devel x86_64 14:1.5.3-9.el7 base 117 kInstall 3 Packages
Total 187 kB/s | 474 kB 00:02
Running transaction checkRunning transaction testTransaction test succeededRunning transactionInstalling : flex-2.5.37-3.el7.x86_64 1/3Installing : 14:libpcap-devel-1.5.3-9.el7.x86_64 2/3Installing : byacc-1.9.20130304-3.el7.x86_64 3/3Verifying : byacc-1.9.20130304-3.el7.x86_64 1/3Verifying : 14:libpcap-devel-1.5.3-9.el7.x86_64 2/3Verifying : flex-2.5.37-3.el7.x86_64 3/3Installed:
byacc.x86_64 0:1.9.20130304-3.el7 flex.x86_64 0:2.5.37-3.el7libpcap-devel.x86_64 14:1.5.3-9.el7Complete!
[root@mantisbt01 ~]#[root@mantisbt01 ~]#[root@mantisbt01 ~]# lsanaconda-ks.cfg CentOS7-Base-163.repo learning.py python software[root@mantisbt01 ~]# cd software/[root@mantisbt01 software]# wget --2018-04-04 15:17:12-- Resolving www.ex-parrot.com (www.ex-parrot.com)... 93.93.130.166, 2a00:1098:0:82:1000:0:1:2Connecting to www.ex-parrot.com (www.ex-parrot.com)|93.93.130.166|:80... connected.HTTP request sent, awaiting response... 200 OKLength: 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 printchecking...' messages<br/>--cache-file=FILE cache test results in FILE [disabled]<br/>-C, --config-cache alias for
--cache-file=config.cache'-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<br/>
/usr/local/bin', /usr/local/lib' etc. You can specify<br/>an installation prefix other than
/usr/local' using --prefix',<br/>for instance
--prefix=$HOME'.
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 namesSystem 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 modeto capture outgoing packetsOptional 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 multiplethreads.netdb_1thread use gethostbyaddr_r andassume it is not reentrant.ares use the MIT ARES asynchronousresolver library.forking use the REALLY SUCKY forking resolver.guess run experiments to guess areasonable value. Only works if youaren't cross-compiling. Thisis the default. guess willeither 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 orWHERE/include/pcap.default=look in standard locationsSome influential environment variables:
CC C compiler commandCFLAGS C compiler flagsLDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in anonstandard directory <lib dir>CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you haveheaders in a nonstandard directory <include dir>CPP C preprocessorUse 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/ | headtotal 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-gnuchecking host system type... x86_64-unknown-linux-gnuchecking target system type... x86_64-unknown-linux-gnuchecking for a BSD-compatible install... /usr/bin/install -cchecking whether build environment is sane... yeschecking for gawk... gawkchecking whether make sets ${MAKE}... yeschecking for gcc... gccchecking for C compiler default output... a.outchecking whether the C compiler works... yeschecking whether we are cross compiling... nochecking for suffix of executables...checking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether gcc accepts -g... yeschecking for gcc option to accept ANSI C... none neededchecking for style of include used by make... GNUchecking dependency style of gcc... gcc3checking how to run the C preprocessor... gcc -Echecking for egrep... grep -Echecking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking sys/ioctl.h usability... yeschecking sys/ioctl.h presence... yeschecking for sys/ioctl.h... yeschecking sys/time.h usability... yeschecking sys/time.h presence... yeschecking for sys/time.h... yeschecking sys/sockio.h usability... nochecking sys/sockio.h presence... nochecking for sys/sockio.h... nochecking for unistd.h... (cached) yeschecking for an ANSI C-conforming const... yeschecking for size_t... yeschecking whether time.h and sys/time.h may both be included... yeschecking sys/dlpi.h usability... nochecking sys/dlpi.h presence... nochecking for sys/dlpi.h... nochecking for regcomp... yeschecking for select... yeschecking for strdup... yeschecking for strerror... yeschecking for strspn... yeschecking for library containing socket... none requiredchecking for library containing log... -lmchecking for gethostbyname... yeschecking for library containing inet_aton... none requiredchecking for library containing inet_pton... none requiredchecking for inet_aton... yeschecking for inet_pton... yeschecking size of u_int8_t... 1checking size of u_int16_t... 2checking size of u_int32_t... 4checking for library containing getnameinfo... none requiredchecking for library containing gethostbyaddr_r... none requiredchecking how to call gethostbyaddr_r... 8 args, int returnchecking gethostbyaddr_r usability... yeschecking where to find pcap.h... /includechecking for pcap_open_live in -lpcap... yeschecking pcap.h usability... yeschecking pcap.h presence... yeschecking for pcap.h... yeschecking for a curses library containing mvchgat... -lcurseschecking POSIX threads compilation... CFLAGS= and LIBS=-lpthreadchecking POSIX threads usability... yeschecking if we need to enable promiscuous mode by default... noconfigure: creating ./config.statusconfig.status: creating Makefileconfig.status: creating config/Makefileconfig.status: creating config.hconfig.status: executing depfiles commands[root@mantisbt01 iftop-0.17]#[root@mantisbt01 iftop-0.17]# echo $?
0[root@mantisbt01 iftop-0.17]# makemake all-recursivemake[1]: Entering directory/root/software/iftop-0.17'<br/>Making all in config<br/>make[2]: Entering directory
/root/software/iftop-0.17/config'make[2]: Nothing to be done for all'.<br/>make[2]: Leaving directory
/root/software/iftop-0.17/config'make[2]: Entering directory /root/software/iftop-0.17'<br/>source='addr_hash.c' object='addr_hash.o' libtool=no \<br/>depfile='.deps/addr_hash.Po' tmpdepfile='.deps/addr_hash.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'addr_hash.c' || echo './'addr_hash.c<br/>source='edline.c' object='edline.o' libtool=no \<br/>depfile='.deps/edline.Po' tmpdepfile='.deps/edline.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'edline.c' || echo './'edline.c<br/>source='hash.c' object='hash.o' libtool=no \<br/>depfile='.deps/hash.Po' tmpdepfile='.deps/hash.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'hash.c' || echo './'hash.c<br/>source='iftop.c' object='iftop.o' libtool=no \<br/>depfile='.deps/iftop.Po' tmpdepfile='.deps/iftop.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'iftop.c' || echo './'iftop.c<br/>source='ns_hash.c' object='ns_hash.o' libtool=no \<br/>depfile='.deps/ns_hash.Po' tmpdepfile='.deps/ns_hash.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'ns_hash.c' || echo './'ns_hash.c<br/>source='options.c' object='options.o' libtool=no \<br/>depfile='.deps/options.Po' tmpdepfile='.deps/options.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'options.c' || echo './'options.c<br/>source='resolver.c' object='resolver.o' libtool=no \<br/>depfile='.deps/resolver.Po' tmpdepfile='.deps/resolver.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'resolver.c' || echo './'resolver.c<br/>source='screenfilter.c' object='screenfilter.o' libtool=no \<br/>depfile='.deps/screenfilter.Po' tmpdepfile='.deps/screenfilter.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'screenfilter.c' || echo './'screenfilter.c<br/>source='serv_hash.c' object='serv_hash.o' libtool=no \<br/>depfile='.deps/serv_hash.Po' tmpdepfile='.deps/serv_hash.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'serv_hash.c' || echo './'serv_hash.c<br/>source='sorted_list.c' object='sorted_list.o' libtool=no \<br/>depfile='.deps/sorted_list.Po' tmpdepfile='.deps/sorted_list.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'sorted_list.c' || echo './'sorted_list.c<br/>source='threadprof.c' object='threadprof.o' libtool=no \<br/>depfile='.deps/threadprof.Po' tmpdepfile='.deps/threadprof.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'threadprof.c' || echo './'threadprof.c<br/>source='ui.c' object='ui.o' libtool=no \<br/>depfile='.deps/ui.Po' tmpdepfile='.deps/ui.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'ui.c' || echo './'ui.c<br/>source='util.c' object='util.o' libtool=no \<br/>depfile='.deps/util.Po' tmpdepfile='.deps/util.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'util.c' || echo './'util.c<br/>source='addrs_ioctl.c' object='addrs_ioctl.o' libtool=no \<br/>depfile='.deps/addrs_ioctl.Po' tmpdepfile='.deps/addrs_ioctl.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'addrs_ioctl.c' || echo './'addrs_ioctl.c<br/>source='addrs_dlpi.c' object='addrs_dlpi.o' libtool=no \<br/>depfile='.deps/addrs_dlpi.Po' tmpdepfile='.deps/addrs_dlpi.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'addrs_dlpi.c' || echo './'addrs_dlpi.c<br/>source='dlcommon.c' object='dlcommon.o' libtool=no \<br/>depfile='.deps/dlcommon.Po' tmpdepfile='.deps/dlcommon.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'dlcommon.c' || echo './'dlcommon.c<br/>source='stringmap.c' object='stringmap.o' libtool=no \<br/>depfile='.deps/stringmap.Po' tmpdepfile='.deps/stringmap.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'stringmap.c' || echo './'stringmap.c<br/>source='cfgfile.c' object='cfgfile.o' libtool=no \<br/>depfile='.deps/cfgfile.Po' tmpdepfile='.deps/cfgfile.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'cfgfile.c' || echo './'cfgfile.c<br/>source='vector.c' object='vector.o' libtool=no \<br/>depfile='.deps/vector.Po' tmpdepfile='.deps/vector.TPo' \<br/>depmode=gcc3 /bin/sh ./config/depcomp \<br/>gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c
test -f 'vector.c' || echo './'vector.c<br/>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<br/>make[2]: Leaving directory
/root/software/iftop-0.17'make[1]: Leaving directory /root/software/iftop-0.17'<br/>[root@mantisbt01 iftop-0.17]# make install<br/>Making install in config<br/>make[1]: Entering directory
/root/software/iftop-0.17/config'make[2]: Entering directory /root/software/iftop-0.17/config'<br/>make[2]: Nothing to be done for
install-exec-am'.make[2]: Nothing to be done for install-data-am'.<br/>make[2]: Leaving directory
/root/software/iftop-0.17/config'make[1]: Leaving directory /root/software/iftop-0.17/config'<br/>make[1]: Entering directory
/root/software/iftop-0.17'make[2]: Entering directory /root/software/iftop-0.17'<br/>/bin/sh ./config/mkinstalldirs /opt/iftop/sbin<br/>mkdir -p -- /opt/iftop/sbin<br/>/usr/bin/install -c iftop /opt/iftop/sbin/iftop<br/>/bin/sh ./config/mkinstalldirs /opt/iftop/man/man8<br/>mkdir -p -- /opt/iftop/man/man8<br/>/usr/bin/install -c -m 644 ./iftop.8 /opt/iftop/man/man8/iftop.8<br/>make[2]: Leaving directory
/root/software/iftop-0.17'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]# iftopinterface: ens33IP address is: 192.168.2.180MAC address is: 00:0c:29:cc:cf:6f[root@mantisbt01 iftop-0.17]#转载于:https://blog.51cto.com/guanhaizhan/2094720