Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux綜合 >> 學習 Linux

CentOS 編譯安裝 iftop:即時監控伺服器端口流量

iftop 能即時監控伺服器各端口的流量,以下示範以編譯方式安裝。

1. 下載原始碼:

wget https://www.ex-parrot.com/~pdw/iftop/download/iftop-1.0pre4.tar.gz

2. 解壓並進入目錄:

tar -xvf iftop-1.0pre4.tar.gz
cd iftop-1.0pre4
ls

CentOS 編譯安裝 iftop:即時監控伺服器端口流量

3. 編譯安裝(指定安裝到 /usr/soft/iftop/):

./configure --prefix=/usr/soft/iftop/
make
make install

CentOS 編譯安裝 iftop:即時監控伺服器端口流量

安裝完成後,直接執行 iftop(可帶參數)即可進行流量監控。

CentOS 編譯安裝 iftop:即時監控伺服器端口流量


關於編譯安裝

前提是系統已具備編譯環境(gcc、perl、python、glibc、make、automake 等)。大多數 tar.gz 或 tar.bz2 打包的軟體,透過 ./configure、make、make install 三步驟即可安裝;少數軟體沒有 configure,直接 make 即可。

其中 --prefix 參數相當重要,可用來指定安裝目錄,日後不需要時直接刪除該目錄即可。

./configure --prefix=/usr/soft/iftop
Copyright © Linux教程網 All Rights Reserved