For those that may have this issue in the future, here is the guide I worked up with the help of several other online guides to get this installed and running properly on Ubuntu. The steps should work on almost any Debian Linux as well I would think. Hopefully this will help some people down the road.

== Step 1 ==
Install some of the precompiled packages from the repository. There are a few more available, but it is better to build them from source so we can specify a few more options with them than what comes with the repository. We also need a C compiler and some development packages for nfdump to compile correctly, so we get them as well.

sudo apt-get install rrdtool librrds-perl perl5 flex php5 libmailtools-perl libapache2-mod-php5 gcc librrd-dev

== Step 2==
Next we need to download both nfsen and nfdump.
http://sourceforge.net/projects/nfdump/
http://sourceforge.net/projects/nfsen/
sudo wget http://sourceforge.net/projects/nfdump/files/stable/nfdump-1.6.1/nfdump-1.6.1.tar.gz/download sudo wget http://sourceforge.net/projects/nfsen/files/stable/nfsen-1.3.4/nfsen-1.3.4.tar.gz/download

== Step 3 ==
Since both of these download are in .tar format we need to unpack them.
 tar -xvf nfsen-1.3.4.tar.gz
 tar -xvf nfdump-1.6.1.tar.gz

== Step 4 ==
After this we need to make and install these packages, first we want to make nfdump. Change directories to the nfdump download
 cd ./nfdump-1.6.1

=== Step 4.1 ===
We need to make sure that nfdump can run the make files so first we need to configure it. We need to enable nfprofile so we can make new profiles other than live. If this runs successfully, then we can make the install files and install them.
 sudo ./configure --enable-nfprofile --enable-sflow
 sudo make
 sudo make install

== Step 5 ==
If all of these have run successfuly then we can move onto installing and setting up nfsen. First make a directory for nfsen to store all of it's data in. We will also have to change it's owner and it's group so that nfsen can write and read to the file. We can set the owner and group to www-data which is the Debian version of the apache user. We also need to modify the permissions on the folder.
 sudo mkdir /data
 sudo chown www-data /data
 sudo chgrp www-data /data
 sudo chmod 775 /data

== Step 6 ==
Now we can change directories to nfsen and move forward from there.
 cd ..
 cd ./nfsen-1.3.4

=== Step 6.1 ===
We need to change the name of the nfsen options file and edit it to fit our needs.
 sudo cp ./etc/nfsen-dist.conf ./etc/nfsen.conf
 sudo nano ./etc/nfsen.conf

=== Step 6.2 ===
Now we need to change the file a bit to meet our install needs. The most important ones to change are the $USER, $WWWUSER, and $WWWGROUP. The others can be modified to what you want, this is just where I have chosen to install nfsen.

 $BASEDIR = "/data/nfsen";
 $BINDIR="/usr/bin";
 $USER    = "www-data";
 $WWWUSER  = "www-data";
 $WWWGROUP = "www-data";

=== Step 6.3 ===
Still in the nfsen.conf we add in our sources of netflows so it knows what ports to listen on. Keep in mind there is a 19 character limit on what you can specify for source names. Each new source needs it's own unique port number to listen on.

 # Netflow sources
 # Define an ident string, port and colour per netflow source
 #
 # Required parameters:
 #    ident   identifies this netflow source. e.g. the router name,
 #            Upstream provider name etc.
 #    port    nfcapd listens on this port for netflow data for this source
# set port to '0' if you do not want a collector to be started
 #    col     colour in nfsen graphs for this source
 #
 # Optional parameters
# type Collector type needed for this source. Can be 'netflow' or 'sflow'. Default is netflow
 #        optarg  Optional args to the collector at startup
 #
 # Syntax:
# 'ident' => { 'port' => '<portnum>', 'col' => '<colour>', 'type' => '<type>' } # Ident strings must be 1 to 19 characters long only, containing characters [a-zA-Z0-9_].

 %sources = (
'upstream1' => { 'port' => '9995', 'col' => '#0000ff', 'type' => 'netflow' },
    'peer1'        => { 'port' => '9996', 'IP' => '172.16.17.18' },
    'peer2'        => { 'port' => '9996', 'IP' => '172.16.17.19' },
);

You can change the colors later on within nfsen but those changes won't be reflected in this file. And whenever you use that source for a different profile it will revert back to it's color in this file. So makes things a bit easier on yourself and choose the colors as you enter them in. It is a massive pain to change them from the web UI.
=== Step 6.4 ===
Now that this file as been edited to fit our install needs, we can install nfsen on our server.
 sudo ./install.pl etc/nfsen.conf

== Step 7 ==
Next you will probably need to restart the apache server so that you can get to your new netflows collector. You may also need to tell nfsen to start after this install has taken place for the first time.
 sudo /etc/init.d/apache2 restart
 sudo nfsen stop
 sudo nfsen start

=== Step 7.1 ===
Now you should be able to get to your collectors web site.
http://(Domain-or-IP-address)/nfsen/nfsen.php

== Step 8 ==
Congratulations you now have a working nfsen server. Last, we'll want to set up nfsen to start automagically whenever the server is rebooted. We'll need to make a startup script.
 sudo nano /etc/init.d/nfsen

 #!/bin/sh
 nfsen start

=== Step 8.1 ===
Now we'll want to get the script to run at start time and change it so it runs a bit earlier than other things that may get in the way. We also need to make it exacuteable.
 sudo chmod +x /etc/init.d/nfsen
 sudo update-rc.d nfsen defaults
 cd /etc/rc2.d/
 sudo mv S20nfsen S10nfsen
 cd /etc/rc3.d/
 sudo mv S20nfsen S10nfsen
 cd /etc/rc4.d/
 sudo mv S20nfsen S10nfsen
 cd /etc/rc5.d/
 sudo mv S20nfsen S10nfsen

Adam Osterlund
Network Engineer
Wi-Fi Guys, LLC.
Office: 218-353-7798 x 107


On 7/19/2010 12:03 PM, Adam Osterlund wrote:
I believe I worked out what was causing my issues.

The the folder that nfsen was installed in belonged to root. So I changed the user and the group of the folder over to www-data (Ubuntu's apache user) and it began to work fine for me. I modified the nfsen configuration to run under the www-data user as well.

If interested I can post my step by step guide I worked up for Ubunutu to get it running.
Adam Osterlund
Network Engineer
Wi-Fi Guys, LLC.
Office: 218-353-7798 x 107

On 7/19/2010 11:17 AM, Benjamin . wrote:
Hello,

I have the problem you mentionned in the first part of your email. My live pipe 
is populated
and displays data, but my profiles, whatever theirs configuration are (shadowed 
etc...), are not populated.



I'm currently running Ubuntu 9.10 as well and NfSen 1.3.4. NfProfile and NfDump 
seems to be working fine.

Any help would be much appreciated.

Benjamin,



------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first --http://p.sf.net/sfu/sprint-com-first


_______________________________________________
Nfsen-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nfsen-discuss
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Nfsen-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nfsen-discuss

Reply via email to