Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Linux 系統教學 >> 關於 Linux

CentOS 6.4 64位安裝配置 ntopng 網路流量即時監控完整實戰

編輯:關於 Linux

ntopng 是 ntop 重寫版,提供 Web 介面即時顯示網路流量、協定分佈、主機通訊、GeoIP 地理位置、應用層識別 (nDPI),支援 Redis 快取、RRD 歷史圖表、REST API。

環境準備:更換國內 Yum 源與 EPEL

# 1. 備份並替換 CentOS-Base.repo (阿里雲鏡像)
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.def
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo

# 2. 安裝 EPEL 並替換鏡像
wget https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
wget -O /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-6.repo

yum makecache

安裝相依套件與 ntopng 專用庫

# 基礎相依
yum install libpcap-devel glib2-devel GeoIP GeoIP-devel libxml2-devel redis wget rrdtool

# libzmq3 (ntopng 要求 >= 3.2.2)
wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/openSUSE/repositories/home:/jblunck:/messaging/CentOS_CentOS-6/x86_64/libzmq3-3.2.2-5.1.x86_64.rpm
rpm -ivh libzmq3-3.2.2-5.1.x86_64.rpm

下載並安裝 ntopng RPM

wget https://www.nmon.net/packages/rpm/x86_64/ntopng/ntopng-1.2.2-8420.x86_64.rpm
wget https://www.nmon.net/packages/rpm/x86_64/ntopng-data/ntopng-data-1.2.2-8420.noarch.rpm
rpm -ivh ntopng-1.2.2-8420.x86_64.rpm
rpm -ivh ntopng-data-1.2.2-8420.noarch.rpm

配置 ntopng (/etc/ntopng/ntopng.conf)

-G=/var/tmp/ntopng.pid
--local-networks "10.1.1.0/24"
--interface eth1
--user nobody
--http-port 8888

啟動服務與驗證

service redis start
service ntopng start
# 瀏覽 https://server-ip:8888
# 預設帳號/密碼:admin / admin

ntopng Web 介面

避坑指南: (1) 必須先啟動 Redis,否則 ntopng 秒退;(2) --interface 指定監聽網卡,錯誤會導致無流量;(3) 防火牆需開放 8888 埠;(4) nDPI 需額外編譯啟用應用層識別;(5) 生產環境建議修改預設密碼、啟用 HTTPS、限制存取 IP。
Copyright © Windows教程網 All Rights Reserved