zoukankan      html  css  js  c++  java
  • linux6 安装 ntopng

    linux6 安装 ntopng

    来自维基百科的知识“ntop是一个网络探测器,它以与top显示进程般类似的方式显示网络使用率。在交互模式中,它显示了用户终端上的网络状态。在网页模式中,它作为网络服务器,创建网络状态的HTML转储文件。它支持NetFlow/sFlowemitter/collector,这是一个基于HTTP的客户端界面,用于创建ntop为中心的监控应用,并使用RRD来持续存储通信数据”。

     GitHub地址:https://github.com/ntop/ntopng/tree/dev/

     官网:https://www.ntop.org/products/traffic-analysis/ntop/

    Ntopng是一个基于网页的高速通信分析器和流量收集器。Ntopng基于ntop,它运行于所有Unix平台、MacOS X和Windows。

     

     1、环境安装

    ntopng是基于web框架的,先搭建好LNMP环境。

    安装开发工具

    # yum groupindatll 'Development Tools'

    安装各种依赖库

    #  yum install -y rrdtool*  tcl   GeoIP-devel GeoIP automake makecache gcc gcc-c++
    #  yum install -y libpcap* libcurl* sqlite-devel libxml2* glib2* numactl

    安装redis

    2、安装ntopng

    #  wget  https://sourceforge.net/projects/ntop/files/ntopng/ntopng-2.4-stable.tar.gz/download
    #  tar -zxvf ntopng-2.4-stable.tar.gz
    #  cd ntopng-2.4-stable
    #  ./configure
    #  make
    #  make install

    过程忘记截图了,安装的时候可能会报各种缺少依赖库,缺啥装啥就是了。

    3、配置文件

    在./configure时,默认 redis和ntopng将安装到/usr/local/文件夹。接下来,我们需要为ntopng创建配置文件。

    # cd /usr/local/etc
    # mkdir ntopng
    # cd ntopng
    # vi ntopng.start

    加入:

    --local-network "192.168.10.0/24"
    --interface 1

    参数解释

    -G  指定运行所用进程号文件
    --local-network  指定本地子网段
    --interface eth2  指定监听eth2网卡上的流量
    --user ntopng    指定运行服务所使用账户
    --http-port 3333  指定web展现的服务端口,如果不指定默认为3000

    建立pid文件

    # vi ntopng.pid
    
    -G=/var/run/ntopng.pid

    4、运行ntopng

    先运行redis

    # /usr/local/bin/redis-server &
    [1] 2351
    # [2351] 16 Dec 08:03:12.666 # Warning: no config file specified, using the default config. In order to specify a config file use /usr/local/bin/redis-server /path/to/redis.conf
    [2351] 16 Dec 08:03:12.667 * Max number of open files set to 10032
                    _._                                                  
               _.-``__ ''-._                                             
          _.-``    `.  `_.  ''-._           Redis 2.6.17 (00000000/0) 64 bit
      .-`` .-```.  ```/    _.,_ ''-._                                   
     (    '      ,       .-`  | `,    )     Running in stand alone mode
     |`-._`-...-` __...-.``-._|'` _.-'|     Port: 6379
     |    `-._   `._    /     _.-'    |     PID: 2351
      `-._    `-._  `-./  _.-'    _.-'                                   
     |`-._`-._    `-.__.-'    _.-'_.-'|                                  
     |    `-._`-._        _.-'_.-'    |           http://redis.io        
      `-._    `-._`-.__.-'_.-'    _.-'                                   
     |`-._`-._    `-.__.-'    _.-'_.-'|                                  
     |    `-._`-._        _.-'_.-'    |                                  
      `-._    `-._`-.__.-'_.-'    _.-'                                   
          `-._    `-.__.-'    _.-'                                       
              `-._        _.-'                                           
                  `-.__.-'                                               
    
    [2351] 16 Dec 08:03:12.675 # Server started, Redis version 2.6.17
    [2351] 16 Dec 08:03:12.677 * The server is now ready to accept connections on port 6379

    然后,运行ntopng

    # /usr/local/bin/ntopng 
    16/Dec/2019 08:03:29 [Ntop.cpp:1121] Setting local networks to 127.0.0.0/8
    16/Dec/2019 08:03:29 [Redis.cpp:92] Successfully connected to redis 127.0.0.1:6379@0
    [NDPI] ndpi_init_protocol_defaults(missing protoId=226) INTERNAL ERROR: not all protocols have been initialized
    [NDPI] ndpi_init_protocol_defaults(missing protoId=226) INTERNAL ERROR: not all protocols have been initialized
    16/Dec/2019 08:03:32 [PcapInterface.cpp:85] Reading packets from interface eth0...
    16/Dec/2019 08:03:32 [Ntop.cpp:1267] Registered interface eth0 [id: 0]
    [NDPI] ndpi_init_protocol_defaults(missing protoId=226) INTERNAL ERROR: not all protocols have been initialized
    16/Dec/2019 08:03:32 [PcapInterface.cpp:85] Reading packets from interface virbr0...
    16/Dec/2019 08:03:32 [Ntop.cpp:1267] Registered interface virbr0 [id: 1]
    [NDPI] ndpi_init_protocol_defaults(missing protoId=226) INTERNAL ERROR: not all protocols have been initialized

    5、验证进程

    # ps -ef | grep ntopng
    nobody    2373  2358  1 08:03 pts/1    00:02:17 /usr/local/bin/ntopng
    root     12575 12239  0 10:02 pts/2    00:00:00 grep ntopng
    # 
    # netstat -lantup | grep ntopng
    tcp        0      0 0.0.0.0:3000                0.0.0.0:*                   LISTEN      2373/ntopng         
    tcp        0      0 127.0.0.1:48272             127.0.0.1:6379              ESTABLISHED 2373/ntopng 

     6、浏览器使用

     现在,你可以通过访问http://yourserver.name:3000来测试ntopng应用,你将会看到ntopng登录页面。首次登录,你可以使用用户‘admin’和密码‘admin’。

     

     登陆后

  • 相关阅读:
    ubuntu server 14.04和18.04挂载vmware共享文件夹
    Ubuntu 无法进行SSH连接,开启22端口
    ubuntu切换到root用户
    VMware Workstation 15 Pro 永久激活密钥
    idea静态资源的访问问题,如HTML,css,js的加载
    idea在Tomcat服务器加载html文件出现乱码的解决方案
    html,js 打开时出现 Uncaught TypeError: Cannot read property 'addEventListener' of null at register.js:24错误的解决方法
    js判断input输入是不是含有中文,或者判断输入是不是全是中文
    PHP连接前端from数据的错误,如源服务器未能找到目标资源的表示或者是不愿公开一个已经存在的资源表示。
    PHP与Tomcat运行前的配置。
  • 原文地址:https://www.cnblogs.com/zwj-linux/p/12050448.html
Copyright © 2011-2022 走看看