Linux服务器---流量监控ntop

Ntop

Ntop 是一款类似于sniffer的流量监控工具,它显示出的流量信息比mrtg更加详细。

1 、安装一些依赖软件

[root@localhost bandwidthd]#  yum install -y gcc libpcap-devel libpcap libtool automake autoconf gdbm gdbm-devel libevent libevent-devel rrdtool rrdtool-devel zlib zlib-devel

2 、安装geoip软件,此软件有多个依赖,可以在 https://centos.pkgs.org 下载。几个rpm包要同时安装

[root@localhost wj]#  rpm -ivh GeoIP-1.6.9-2857.el6.art.i686.rpm GeoIP-GeoLite-data-2017.05-1.el6.art.noarch.rpm GeoIP-GeoLite-data-extra-2017.05-1.el6.art.noarch.rpm geoipupdate-2.2.2-2.el6.art.i686.rpm 

Preparing...               ########################################### [100%]

   1:GeoIP-GeoLite-data-extr########################################### [ 25%]

   2:GeoIP-GeoLite-data    ########################################### [ 50%]

   3:geoipupdate           ########################################### [ 75%]

   4:GeoIP                 ########################################### [100%]

 

3 、下载ntop软件( https://sourceforge.net/projects/ntop/files/ntop/ntop-4.0.1/ntop-4.0.1.tar.gz/download 

4 、解压bandwidthd。

[root@localhost ~]#  tar -xzvf ntop-4.0.1.tar.gz

5 、安装。ntop需要进行编译安装,首先要执行autogen.sh文件,生成makefile,然后在编译、安装

[root@localhost ntop-4.0.1]# ./autogen.sh

[root@localhost ntop-4.0.1]# make

[root@localhost ntop-4.0.1]# make install

6 、配置防火墙,增加tcp的3000端口

[root@localhost GeoIP-1.4.8]#  gedit /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 3000 -j ACCEPT

 

[root@localhost GeoIP-1.4.8]# service iptables restart

iptables :将链设置为政策  ACCEPT : filter nat                [ 确定 ]

iptables :清除防火墙规则:                                  [ 确定 ]

iptables :正在卸载模块:                                    [ 确定 ]

iptables :应用防火墙规则:                                  [ 确定 ]

iptables :载入额外模块: nf_conntrack_ftp                   [ 确定 ]

7 、启动ntop

[root@localhost GeoIP-1.4.8]#  /usr/local/bin/ntop -d -L -u root -P /usr/local/var/ntop --skip-version-check --use-syslog=daemon

8 、在浏览器输入“127.0.0.1:3000”打开ntop。

 

原文地址:https://www.cnblogs.com/wj78080458/p/10280404.html