1. 程式人生 > >Centos 安裝iftop監控網路埠流量

Centos 安裝iftop監控網路埠流量

iftop跟top工具相似,主要是用於監控網路流量情況

一、iftop官網

二、安裝必要元件

官網裡有提示需要元件libpcap,libcurses (flex byacc)

yum install  libpcap ncurses ncurses-devel libpcap-devel gcc

1、下載安裝包

2、解壓

 #tar -zxvf iftop-1.0pre4.tar.gz

3、編譯安裝

#cd iftop-1.0pre4

#./configure

#make

#make install

以上,就安裝完成了。

# iftop -h iftop: display bandwidth usage on an interface by host

Synopsis: iftop -h | [-npblNBP] [-i interface] [-f filter code]                                [-F net/mask] [-G net6/mask6]

   -h                  display this message    -n                  don't do hostname lookups    -N                  don't convert port numbers to services    -p                  run in promiscuous mode (show traffic between other                        hosts on the same network segment)    -b                  don't display a bar graph of traffic    -B                  Display bandwidth in bytes    -i interface        listen on named interface    -f filter code      use filter code to select packets to count                        (default: none, but only IP packets are counted)    -F net/mask         show traffic flows in/out of IPv4 network    -G net6/mask6       show traffic flows in/out of IPv6 network    -l                  display and count link-local IPv6 traffic (default: off)    -P                  show ports as well as hosts    -m limit            sets the upper limit for the bandwidth scale    -c config file      specifies an alternative configuration file    -t                  use text interface without ncurses

   Sorting orders:    -o 2s                Sort by first column (2s traffic average)    -o 10s               Sort by second column (10s traffic average) [default]    -o 40s               Sort by third column (40s traffic average)    -o source            Sort by source address    -o destination       Sort by destination address

   The following options are only available in combination with -t    -s num              print one single text output afer num seconds, then quit    -L num              number of lines to print

iftop, version 1.0pre4 copyright (c) 2002 Paul Warren <[email protected]> and contributors