nfsen-blackhole

记录

yum -y -q install monit tcsh  perl-Net-BGP
git clone https://github.com/zhecho/nfsen-blackhole 
cd nfsen-blackhole 
sed  -i "s#/usr/local/var/nfsen#/opt/nfsen/var/run#g" *
sed  -i "s#/usr/local/libexec/nfsen/plugins#/opt/nfsen/plugins#g" *
                          
install bgp_simple_restart.sh /opt/nfsen/plugins/
install blackHole.pm   /opt/nfsen/plugins/
install bgp_simple.pl  /opt/nfsen/plugins/
install blackHole.php  /opt/nfsen/www/plugins/
touch /opt/nfsen/var/run/{blackhole-pref.td2,blackHole.plugin.log}
chown nobody:nobody /opt/nfsen/var/run/{blackhole-pref.td2,blackHole.plugin.log}


Centos7 nfsen基础安装

yum -y -q install epel-release wget 
yum -y -q install nss curl  git nfdump perl gcc make libpcap-devel fprobe-ulog  rrdtool-devel rrdtool-perl  flex byacc perl 
yum -y -q install perl-MailTools perl-Socket6 perl-Sys-Syslog 'perl(Data::Dumper)' perl-DBD-MySQL
wget https://sourceforge.net/projects/nfsen/files/stable/nfsen-1.3.8/nfsen-1.3.8.tar.gz/download  -O -|tar xz
cd nfsen-1.3.8
#cat   etc/nfsen-dist.conf |grep -v ^#|grep -v ^$ >etc/nfsen.conf
wget dl.kvm.la/conf/nfsen/nfsen.conf -O  etc/nfsen.conf
perl install.pl etc/nfsen.conf
ln -s /opt/nfsen/bin/nfsen /usr/bin/
#安装PortTracker插件
install contrib/PortTracker/PortTracker.pm   /opt/nfsen/plugins/
install contrib/PortTracker/PortTracker.php  /opt/nfsen/plugins/
mkdir -p  /data/ports-db
chown -R nobody:nobody /data/ports-db  /opt/nfsen
sudo -u nobody nftrack -I -d /data/ports-db
wget dl.kvm.la/conf/nfsen/nfsen.init -O /etc/init.d/nfsen
chmod 755 /etc/init.d/nfsen
chkconfig nfsen on

#安装PortTracker插件

#安装PortTracker插件
install contrib/PortTracker/PortTracker.pm   /opt/nfsen/plugins/
install contrib/PortTracker/PortTracker.php  /opt/nfsen/plugins/
mkdir -p  /data/ports-db
chown -R nobody:nobody /data/ports-db  /opt/nfsen
sudo -u nobody nftrack -I -d /data/ports-db

正常使用还要http和php进行支持, sflow数据发送到nfsen进行分析,等等.