大纲
一、前言
二、ntopng 简介
三、ntopng 功能说明
四、ntopng 安装详解
五、ntopng 配置详解
六、ntopng 使用详解
注,操作系统 CentOS 5.5 X86_64,软件版本 ntopng-1.1.1。( 所以软件请点击这里下载:http://yunpan.cn/QUxy45R7m4VaD)
一、前言
最近公司换了几台服务器,把旧服务器上的服务往新服务器上迁移,发现在旧服务器的ntop太老了,就决定啊更新一下。到官网(http://www.ntop.org/products/ntop/)看了一下ntop不更新了,现在出ntopng了,然后就安装配置了一下,在这个过程中发现一些问题,然后到网上搜索了一下发现在这方面的资料不多,所以呢?把这几天的使用心得与大家分享一下,哈哈。
二、ntopng 简介
ntopng 高速的基于Web的流量分析与集流工具。ntopng是NTOP的新一代版本,官方原先版本的NTOP已经不再更新。ntopng是原ntop下一代版本,网络流量实时监控显示。ntop是基于Libpcap和它被写在一个可移植的方式来运行在UNIX平台上,MacOSX和Win32一样。
ntopng 用户可以使用一个网页浏览器浏览的ntop(即作为一个Web服务器)流量信息和得到网络状态转储。在后一种情况下,ntop可以看出具有一个嵌入式网络接口作为一个简单的的类远程监控剂。使用:
三、ntopng 功能说明
1.常用功能
2.支持平台
3.Web图形用户界面
4.支持协议
5.可扩展性
四、ntopng 安装详解
1.实验拓扑

2.安装yum源
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
[root@ntopng ~]
Linux ntopng. test .com 2.6.18-194.el5
[root@ntopng ~]
LSB Version: :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: CentOS
Description: CentOS release 5.5 (Final)
Release: 5.5
Codename: Final
[root@ntopng ~]
[root@ntopng ~]
[root@ntopng src]
[root@ntopng src]
warning: epel-release-5-4.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 217521f6
Preparing...
1:epel-release
You have new mail in /var/spool/mail/root
[root@ntopng src]
|
3.同步时间
1
2
3
4
|
[root@ntopng ~]
[root@ntopng ~]
22 Nov 11:33:42 ntpdate[12584]: step time server 202.120.2.101 offset 33865.699182 sec
[root@ntopng ~]
|
4.升级库文件
注,新版的ntopng主要依赖两个库文件一个是glibc-2.7以上版,另一个是libstdc4.3.2以上版。(其中glibc编译安装,libstdc用RPM包安装,编译安装glibc时间要长一点,估计有5分钟左右。)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
[root@ntopng src]
[root@ntopng src]
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBC_2.2.5
GLIBC_2.3
GLIBC_2.4
GLIBCXX_FORCE_NEW
GLIBCXX_DEBUG_MESSAGE_LENGTH
|
注,ntopng主要依赖GLIBCXX_3.4.9。
1
2
3
4
5
6
|
[root@ntopng src]
[root@ntopng src]
[root@ntopng glibc-2.7]
[root@ntopng glibc-2.7]
[root@ntopng glibc_build]
[root@ntopng glibc_build]
|
5.安装ntopng的依赖包
1
2
3
|
[root@ntopng ~]
[root@ntopng ~]
Starting redis-server: [确定]
|
6.安装ntopng
1
2
3
4
5
6
7
8
9
10
11
12
13
|
[root@ntopng src]
warning: ntopng-1.1.1_6986-6986.x86_64.rpm: Header V4 DSA signature: NOKEY, key ID 7921df34
error: Failed dependencies:
libc.so.6(GLIBC_2.7)(64bit) is needed by ntopng-1.1.1_6986-6986.x86_64
[root@ntopng src]
warning: ntopng-1.1.1_6986-6986.x86_64.rpm: Header V4 DSA signature: NOKEY, key ID 7921df34
Preparing...
1:ntopng
Setting up redis auto startup
[root@ntopng src]
warning: ntopng-data-1.0.9_6921-6921.x86_64.rpm: Header V4 DSA signature: NOKEY, key ID 7921df34
Preparing...
1:ntopng-data
|
好了,到这里我们就安装完成了,下面我们来说一下ntopng配置文件。
五、ntopng 配置详解
1.查看默认配置文件
1
2
3
|
[root@ntopng src]
[root@ntopng ntopng]
ntopng.conf.sample ntopng.start
|
注,ntopng.conf.sample 文件是配置文件样例,ntopng.start是ntopng启动时需要的配置文件。下面我们来查看一下具体文件,
1
2
|
[root@ntopng ntopng]
-G= /var/tmp/ntopng .gid
|
注,-G指定运行所用进程号文件。
1
2
3
|
[root@ntopng ntopng]
-- local -networks “192.168.1.0”
--interface 0
|
注,--local-network指定本地子网段,--interface 0 指定监听eth0网卡上的流量。我们来可以配置ntopng运行甩使用的账户、指定web服务端口,如果不指定默认为3000。
2.配置ntopng
注,我们可以将所以的配置文件都放存ntopng.conf的配置文件中。
1
2
3
4
5
6
7
|
[root@ntopng ntopng]
[root@ntopng ntopng]
-G= /var/tmp/ntopng .gid
-- local -networks "192.168.18.0/24"
--interface eth0
--user nobody
--http-port 8888
|
注,配置文件说明 。
3.启动ntopng服务
注,在运行ntopng之前,要确认先启动redis服务,redis为ntopng提供键值存储。我们这边重新启动一下redis服务。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
[root@ntopng ntopng]
Stopping redis-server: [确定]
Starting redis-server: [确定]
[root@ntopng ntopng]
Starting ntopng
[root@ntopng ntopng]
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID /Program name
tcp 0 0 127.0.0.1:6379 0.0.0.0:* LISTEN 28069 /redis-server
tcp 0 0 0.0.0.0:779 0.0.0.0:* LISTEN 2717 /rpc .statd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 2674 /portmap
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 3013 /sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 3026 /cupsd
tcp 0 0 0.0.0.0:8888 0.0.0.0:* LISTEN 28084 /ntopng
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 3051 /sendmail
tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 3247 /sshd
tcp 0 0 127.0.0.1:6011 0.0.0.0:* LISTEN 21756 /sshd
tcp 0 0 :::22 :::* LISTEN 3013 /sshd
tcp 0 0 ::1:6010 :::* LISTEN 3247 /sshd
tcp 0 0 ::1:6011 :::* LISTEN 21756 /sshd
udp 0 0 0.0.0.0:773 0.0.0.0:* 2717 /rpc .statd
udp 0 0 0.0.0.0:776 0.0.0.0:* 2717 /rpc .statd
udp 0 0 0.0.0.0:48354 0.0.0.0:* 3162 /avahi-daemon
udp 0 0 0.0.0.0:5353 0.0.0.0:* 3162 /avahi-daemon
udp 0 0 0.0.0.0:111 0.0.0.0:* 2674 /portmap
udp 0 0 0.0.0.0:631 0.0.0.0:* 3026 /cupsd
udp 0 0 :::59191 :::* 3162 /avahi-daemon
udp 0 0 :::5353 :::* 3162 /avahi-daemon
|
4.测试访问一下
(1).http://192.168.18.201:8888,默认的用户名和密码是admin。

(2).默认的界面

六、ntopng 使用详解
注,ntopng的使用是非常简单的我在这里就不多说废话了,给大家截些图片。
1.查看实流量
![_thumb2[1] _thumb2[1]](http://freeloda.blog.51cto.com/attachment/201311/26/2033581_1385438716VZUD.png)
2.查看所有流量

3.查看所有主机

4.查看接口流量

5.查看管理界面

好了,到这里我们的ntopng的讲解就全部完成了,最后希望大家有所收获吧!^_^……
本文转自陈明乾51CTO博客,原文链接:http://blog.51cto.com/freeloda/1331617,如需转载请自行联系原作者