126. How to Setup/Config NFSen on Ubuntu Server



You can contact me: plus.google.com/+PhallaCCMT; youtube.com/phallaccmt; facebook.com/Phalla.CCMT; twitter.com/PhallaCCMT and Phalla.CCMT@gmail.com

Script:

10:14:09    'Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-87-generic i686)

10:14:35    'phalla@NFSen:~$ sudo apt update

10:15:13    'phalla@NFSen:~$ sudo shutdown -r now

10:16:16    'phalla@NFSen:~$ su root

10:16:30    'root@NFSen:/home/phalla# apt autoremove

10:18:12    'root@NFSen:/home/phalla# wget https://nchc.dl.sourceforge.net/project/nfsen/stable/nfsen-1.3.6p1/nfsen-1.3.6p1.tar.gz
  https://sourceforge.net/projects/nfsen/

10:20:04    'root@NFSen:/home/phalla# wget https://nchc.dl.sourceforge.net/project/nfdump/stable/nfdump-1.6.13/nfdump-1.6.13.tar.gz
  https://sourceforge.net/projects/nfdump/

10:21:11    'root@NFSen:/home/phalla# tar xzfv nfdump-1.6.13.tar.gz

10:21:16    'root@NFSen:/home/phalla# tar xzfv nfsen-1.3.6p1.tar.gz

10:22:11    'root@NFSen:/home/phalla# apt install make gcc flex rrdtool librrd-dev libpcap-dev php librrds-perl libsocket6-perl apache2 libapache2-mod-php7.0

10:26:01    'root@NFSen:/home/phalla# a2enmod php7.0

10:26:30    'root@NFSen:/home/phalla# vi /etc/apache2/mods-enabled/alias.conf
  Add Comment to this: #Alias /icons/ "/usr/share/apache2/icons/"

10:27:48    'root@NFSen:/home/phalla# cd nfdump-1.6.13

10:28:54    'root@NFSen:/home/phalla/nfdump-1.6.13# ./configure --enable-nsel --enable-nfprofile --enable-sflow --enable-readpcap --enable-nfpcapd

10:29:40    'root@NFSen:/home/phalla/nfdump-1.6.13# make

10:30:49    'root@NFSen:/home/phalla/nfdump-1.6.13# make install

10:31:42    'root@NFSen:/home/phalla/nfdump-1.6.13# cd ..

10:32:47    'root@NFSen:/home/phalla# cd nfsen-1.3.6p1

10:33:15    'root@NFSen:/home/phalla/nfsen-1.3.6p1# cpan App::cpanminus

10:33:55    'root@NFSen:/home/phalla/nfsen-1.3.6p1# cpanm Mail::Header

10:34:07    'root@NFSen:/home/phalla/nfsen-1.3.6p1# cpanm Mail::Internet

10:34:31    'root@NFSen:/home/phalla/nfsen-1.3.6p1# vi ./etc/nfsen-dist.conf
  # user and group of the web server process
  # All netflow processing will be done with this user
   $WWWUSER  = "www-data";
   $WWWGROUP = "www-data";
   #$PROFILERS = 2;
                                                                                               
10:38:51    'root@NFSen:/home/phalla/nfsen-1.3.6p1# useradd -M -s /bin/false -G www-data netflow

10:39:12    'root@NFSen:/home/phalla/nfsen-1.3.6p1# mkdir -p /data/nfsen

10:41:18    'root@NFSen:/home/phalla/nfsen-1.3.6p1# vi libexec/NfSenRRD.pm
  line 76, change 1.5 to 1.6
                                 
10:41:55    'root@NFSen:/home/phalla/nfsen-1.3.6p1# ./install.pl ./etc/nfsen-dist.conf

10:42:54    'root@NFSen:/home/phalla/nfsen-1.3.6p1# vi /etc/apache2/sites-enabled/000-default.conf
          DocumentRoot /var/www/nfsen
          DirectoryIndex nfsen.php
                                                                           
10:44:54    'root@NFSen:/home/phalla/nfsen-1.3.6p1# service apache2 restart

10:45:14    'root@NFSen:/home/phalla/nfsen-1.3.6p1# /data/nfsen/bin/nfsen start



Note:

In order to have nfsen start and stop automatically when the system starts, add a link to the init.d diretory pointing to the nfsen startup script:

$ sudo ln -s /data/nfsen/bin/nfsen /etc/init.d/nfsen
$ sudo update-rc.d nfsen defaults 20

Add Source:

$ sudo vi /data/nfsen/etc/nfsen.conf

$ sudo /etc/init.d/nfsen reconfig

Ref:
https://www.youtube.com/watch?v=rge1mBvzj5E

https://nsrc.org/workshops/2014/nsrc-tein-ait/raw-attachment/wiki/Agenda/exercise2-install-nfdump-nfsen.htm

http://nfsen.sourceforge.net/
Previous
Next Post »

5 comments

Write comments
Unknown
AUTHOR
March 2, 2018 at 11:14 PM delete

Thanks for this! Well done!

Reply
avatar
Unknown
AUTHOR
November 29, 2018 at 1:15 AM delete

Do you have any way to set authentication for the webpage?

Reply
avatar
Antony Nam
AUTHOR
April 27, 2019 at 8:46 AM delete

Hi Phalla. My name is Nam from VietNam. I have watched your video about " How to Setup/Config NFSen on Ubuntu Server". I already made it. But I have a problem. I dont know how to import Data from my router to nfdump and display it in nfsen web graphic. what I have to do? can you help me. Thanks you very much.

Reply
avatar
Anonymous
AUTHOR
July 4, 2019 at 2:24 PM delete

Hi Phalla ,

My Name is Hitesh Jethwa, i am using LibreNMS Software for Network & server Monitoring, I want to integrate NFsen With LibreNMS, can you please help me with that ....

Reply
avatar
Unknown
AUTHOR
March 15, 2023 at 8:31 PM delete

But Graph is not showing. I am also done all the setup but now graph is not showing any alternate option for resolved this issue.

Reply
avatar