Ntopng 是一套开源的网络流量监察工具, 也是 ntop 的新一代版本, 可以通过网页接口实时检视网络使用量。以下是在 RHEL 7 及 CentOS 7 安装 Ntopng 的方法。
用 yum 安装 Ntopng 需要使用 EPEL Repo, 如果没有安装 EPEL 需要先安装:
- # yum install epel-release -y
然后建立 ntop repo, 建立档案 /etc/yum.repos.d/ntop.repo:
- # vi /etc/yum.repos.d/ntop.repo
加入以下内容:
[ntop]
name=ntop packages
baseurl=http://www.nmon.net/centos-stable/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.nmon.net/centos-stable/RPM-GPG-KEY-deri
[ntop-noarch]
name=ntop packages
baseurl=http://www.nmon.net/centos-stable/$releasever/noarch/
enabled=1
gpgcheck=1
gpgkey=http://www.nmon.net/centos-stable/RPM-GPG-KEY-deri
name=ntop packages
baseurl=http://www.nmon.net/centos-stable/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.nmon.net/centos-stable/RPM-GPG-KEY-deri
[ntop-noarch]
name=ntop packages
baseurl=http://www.nmon.net/centos-stable/$releasever/noarch/
enabled=1
gpgcheck=1
gpgkey=http://www.nmon.net/centos-stable/RPM-GPG-KEY-deri
在 vi 储存盘案及离开:
:wq
执行以下指令安装 Ntopng 及 Redis:
- # yum –enablerepo=epel install redis ntopng -y
安装好 Ntopng h 后, 需要安装 hiredis-devel 套件, 而且在启动 Ntopng 前要先启动 Redis:
- # yum –enablerepo=epel install hiredis-devel
启动 Redis 及设定开机自动启动:
-
# systemctl start redis.service
# systemctl enable redis.service
现在可以启动 Ntopng:
Let’s start ntopng and add the service to start at boot time:
-
# systemctl start ntopng.service
# systemctl enable ntopng.service
Ntopng 的设定档默认在 /etc/ntopng/ntopng.conf, 开启这个设定档:
- # vi /etc/ntopng/ntopng.conf
加入以下两行:
-G=/var/tmp/ntopng.pid\
–community
–community
在 vi 储存盘案及离开, 重新启动 Ntopng:
- # systemctl restart ntopng
Ntopng 默认使用 port 3000, 需要在 firewalld 开通 port 3000:
- # firewall-cmd –permanent –add-port=3000/tcp
重新加载 Firewalld:
- # firewall-cmd –reload
完成后, 可以尝试用浏览器开启 Ntopng 的网页接口, 在浏览器进入主机的 IP, 并在后加指令使用 port 3000:
http://your.server.ip:3000
默认使用者名称及密码均是 “admin”, 登入后会提示修改密码, 修改密码后便安装完成了。