Nfdump是linux下netflow数据采集分析工具,Nfsen是基于nfdump是web界面工具,服务器需先安装web服务器和php环境。
安装rrdtool及所需组件:yum install perl-rrdtool rrdtool rrdtool-devel rrdutils flex byacc
安装所需perl模块:yum install perl-Socket6 perl-MailTools perl-Mail-Sender
安装Nfdump工具:cd /usr/local/src/
wget http://downloads.sourceforge.net/project/nfdump/stable/nfdump-1.6.6/nfdump-1.6.6.tar.gz
tar zxvf nfdump-1.6.6.tar.gz
cd nfdump-1.6.6/
./configure --enable-nfprofile --with-rrdpath=/usr/bin
make
make install
cd ../
下载配置Nfsen:mkdir -p /usr/local/nfsen
wget http://downloads.sourceforge.net/project/nfsen/stable/nfsen-1.3.6p1/nfsen-1.3.6p1.tar.gz
tar zxvf nfsen-1.3.6p1.tar.gz
cd nfsen-1.3.6p1/
cp etc/nfsen-dist.conf etc/nfsen.conf
修改Nfsen配置文件:cat etc/nfsen.conf
#https://www.haiyun.me
$BASEDIR = "/usr/local/nfsen";
$HTMLDIR = "/var/www/html/nfsen/";
$USER = "apache";
$WWWUSER = "apache";
$WWWGROUP = "apache";
%sources = (
'upstream1' => { 'port' => '9995', 'col' => '#0000ff', 'type' => 'netflow' },
);
安装Nfsen:./install.pl etc/nfsen.conf
启动Nfsen:/usr/local/nfsen/bin/nfsen start
配置路由或交换机将netflow数据发送到nfsen配置的端口,然后访问www.haiyun.me/nfsen/nfsen.php即可通过Nfsen浏览netflow数据。