Install ntop on Ubuntu/Linux Mint

ntop graphIn a previous post, I wrote about how I setup a transparent bridge computer, which is able to monitor all network traffic passed through it. It works great, but to make it really useful, it needs some software that can report on the monitored network traffic in a useful manner. I decided to use ntop for this purpose, as it provides powerful reporting on bandwidth usage, which is exactly what I’m after. I’m not a regular Linux user, so I usually take the easy approach and install software through whatever GUI-based software manager is included. When I did this in Linux Mint however, I found the version available was not the latest, which is 5.0.1. I also learned that ntop has since been replaced by ntopng, which wasn’t available through the GUI. I’ve had some college courses in Linux/Unix administration, so I figured I could handle installing it “the hard way”. In this post, I’ll cover how I got ntop 5.0.1 running on my bridge computer.

First, a note about my choice. I went with ntop 5.0.1 rather than the newer ntopng. The reason is simple: I found more documentation on installing ntop than I did for ntopng. Primarily, I relied on these two articles: nTop vs darkstat, and Install ntop on RH Enterprise Linux / CentOS Linux.

Starting with my bridge computer that I already setup (with the bridge interface being br0), here’s what I did. I’ve tested this on both Linux Mint 15 xfce 32-bit and Ubuntu Server 12.04.3 LTS 32-bit.

Install the dependencies:

sudo apt-get install libpcap-dev libgdbm-dev libevent-dev 
    librrd-dev python-dev libgeoip-dev automake libtool subversion

Then download ntop 5.0.1 from SourceForge, uncompress it, build it, install it and copy the necessary files:

wget --trust-server-name http://sourceforge.net/projects/ntop/files/ntop/Stable/
    ntop-5.0.1.tar.gz/download
tar xzvf ntop-5.0.1.tar.gz
cd ntop-5.0.1/
./autogen.sh
make
sudo make install
sudo cp /usr/local/lib/libntop* /usr/lib/

Before running ntop, I created an ntop user and setup the appropriate permissions:

sudo useradd -M -s /sbin/nologin -r ntop
sudo chown -R ntop:root /usr/local/var/ntop
sudo chown -R ntop:ntop /usr/local/share/ntop

Now set the administrator password for ntop’s web interface:

sudo ntop --set-admin-password=1234

And it’s ready for testing. Start ntop:

sudo ntop -i "br0" -d -L -u ntop -P /usr/local/var/ntop --skip-version-check
    -use-syslog=daemon

Open a web browser and try http://localhost:3000. It works!

Finally, I want it to startup automatically, so i added the following line to /etc/rc.local:

/usr/local/bin/ntop -i "br0" -d -L -u ntop -P /usr/local/var/ntop --skip-version-check
    -use-syslog=daemon

Rebooted and tested it again, it works! The only other thing I did for the Linux Mint computer was to install SSH, since it’s not installed automatically:

Sudo apt-get install openssh-server
/etc/init.d/ssh start

The resulting ntop bridge works great. I’ve had in place at work for over a week without any problems, and it’s helped identify some bandwidth hogs on our network.

10 thoughts to “Install ntop on Ubuntu/Linux Mint”

    1. Sorry, but I’m not sure what you’re looking for – the only file I edited was /etc/rc.local, which is mentioned in the article.

  1. I found these instructions and they worked great. However I am having a problem logging into the web configuration. I’m a newb with Linux and nTop but I’m trying to learn. I can go to the URL on port 3000 and look at all the information but if I try to go to Admin –> Preferences it asks me for a login but nothing works. I’ve seen where others have had this problem and they say delete the passwd.db file but i’m having a problem finding it. If you can help it would be much appreciated. Thank you.

    1. Scot, maybe you can run sudo ntop –set-admin-password=1234 again to reset the password? Change 1234 to whatever password you want it to be. Other than that, I’m not sure. When I set it using that command it was okay when I logged in. Good luck!

  2. I am trying to install not 5.0.1 on Linux Mint 13.
    Everything worked great until I got to:
    ./autogen.sh

    That’s when I got an error something about
    needing to update something. I’ll try to recreate the error so I can post it.

  3. /autogen.sh

    Starting ntop automatic configuration system v.0.2.3

    Please be patient, there is a lot to do…

    1. Testing gnu tools….

    You must have libtool installed to compile ntop.
    Download the appropriate package for your distribution, or get the
    source tarball from ftp://ftp.gnu.org/pub/gnu/libtool
    We require version 1.4 or higher
    We recommend version 1.5 or higher

    You must have automake installed to compile ntop.
    Download the appropriate package for your distribution, or get the
    source tarball from ftp://ftp.gnu. org/pub/gnu/automake
    We recommend version 1.6.3 or higher

    You must have autoconf installed to compile autogen.sh.
    Download the appropriate package for your distribution, or get the
    source tarball from ftp://ftp.gnu.org/pub/gnu/autoconf
    We recommend version 2.53 or higher

    1. It sounds like the gnu tools required to build ntop are either missing or outdated. I am not a linux expert, but I think most every linux distro has them, so maybe they’re outdated. I see you’re using an older version of Mint, maybe that has something to do with it. I’m not sure though. I’ve never run into this error with software builds, it’s always worked for me. Maybe you can try a newer distro or find out about updating the gnu tools? Good luck!

      1. Thanks for the information.
        After rereading the ‘message’ I will try and install
        the three recommended items:
        a. libtool – version 1.5 or higher
        b. automake – version 1.6.3 or higher
        c. autoconf – version 2.53 or higher
        Then I will try to run ./autogen.sh

        I wonder why the installation of the dependencies (see below) worked
        but I still need the files above.

        Install the dependencies:
        sudo apt-get install libpcap-dev libgdbm-dev libevent-dev
        librrd-dev python-dev libgeoip-dev automake libtool subversion

  4. @autoconfigure I get the following error:

    bla bla

    checking for net/ethernet.h… yes
    checking for zlibVersion in -lz… yes
    checking for main in -lrrd_th… no
    configure: error: Unable to find RRD at /usr/local: please use –with-rrd-home=DIR

Leave a Reply

Your email address will not be published. Required fields are marked *