Installing Nagios on Ubuntu 10


Hello there,

I’ve just finished my struggle installing this bitch to my como (my lovely notebook ^^D).
Alhamdulillah.. thats what I said, after about 2 weeks i have no progress with my final project because of this nagios stuff.
So, before i forget all of the step by step nagios instalation that finally success, i will marked this forever in my blog! haha..
Now here we go.. Mollie’s version of nagios installation..
Seat back, relax, and enjoy your installation.. ^_^

1. After you download Nagios from here, you should directly point to installation guide in html/docs/quickstart.html

2. After reading this file, I started to main setup by first creating a base directory for Nagios

sudo mkdir /usr/local/nagios

Then I added a user for Nagios to run as a normal user

sudo /usr/sbin/adduser nagios

3. I ran the configure script to initialize variables and create a Makefile by running

./configure –prefix=/usr/local/nagios –with-cgiurl=/nagios/cgi-bin –with-htmurl=/nagios/ –with-nagios-user=nagios –with-nagios-grp=nagios

Below was the configuration summary that was displayed at the end:

*** Configuration summary for nagios 3.2.1 03-09-2010 ***:

General Options:
Nagios executable: nagios
Nagios user/group: nagios,nagios
Command user/group: nagios,nagios
Embedded Perl: no
Event Broker: yes
Install ${prefix}: /usr/local/nagios
Lock file: ${prefix}/var/nagios.lock
Check result directory: ${prefix}/var/spool/checkresults
Init directory: /etc/init.d
Apache conf.d directory: /etc/apache2/conf.d
Mail program: /bin/mail
Host OS: linux-gnu

Web Interface Options:
HTML URL: http://localhost/nagios//
CGI URL: http://localhost/nagios/cgi-bin/
Traceroute (used by WAP):

4. Compile the Nagios source code.

make all

Install binaries, init script, sample config files and set permissions on the external command directory.

    • make install (instead of using this, i used checkinstall so that i could easily removed nagios if something bad, like failed installation, happened, and yes it did!)
      make install-init
      make install-commandmode
      make install-config
  • I then changed to the Nagios installation directory to see if everything looked like it install

    cd /usr/local/nagios

    Everything looked ok with the correct 5 directories showing up (bin etc sbin share var)

    5. Configure the Web Interface.
    After above configurations, I then looked at the directions for setting up the web interface (

    I then edited the httpd.conf file (gedit /etc/apache2/httpd.conf) and added the lines below:

    (ALIAS information added FOR CGI)

    ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/

    AllowOverride AuthConfig
    Options ExecCGI
    Order allow,deny
    Allow from all

    (ALIAS information added FOR HTTP)

    Alias /nagios/ /usr/local/nagios/share/

    Options None
    AllowOverride AuthConfig
    Order allow,deny
    Allow from all

    6. Compile and Install the Nagios Plugins
    What is so exciting about Nagios?
    Nagios use plugins to all of it functionality. So in my imagination, the work load will be devided very well on each plugin so that the main core doesn’t have to work alone. Nobody wants to work alone right! 🙂
    Plugins allow you to monitor hosts, devices, services, protocols, and applications with Nagios.

    After you have downloaded it there,
    Extract the Nagios plugins source code tarball.

    cd ~/downloads
    tar xzf nagios-plugins-1.4.15.tar.gz
    cd nagios-plugins-1.4.15

    After that, simply compile and install the plugins.

    ./configure –with-nagios-user=nagios –with-nagios-group=nagios


    make install (same as my suggestion before, better using checkinstall then only make install to avoid the confuseness facing the uninstallation things later..

    7. So now, you have already installed Nagios and Nagios Plugins. Don’t waste much time, straightly Start Nagios!
    Configure Nagios to automatically start when the system boots.

    ln -s /etc/init.d/nagios /etc/rcS.d/S99nagios

    Then verify the sample Nagios configuration files.

    /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

    If there are no errors, start Nagios.

    /etc/init.d/nagios start

    i want to give little note here. What makes installing Nagios so painfull was, after above steps, i can’t find the /usr/local/nagios/bin/nagios in my directories. Since i am a very beginner in Linux and scripting, i have a thousand zero experience and idea how to solve this problem. Finally, tired of re-installing my linux many time only because of this reason, i downloaded a fresh new package and re-installed the Nagios.
    Voila! Problem solved! ^_^

    8. Login to the Web Interface
    You should now be able to access the Nagios web interface at the URL below. You’ll be prompted for the username (nagiosadmin) and password you specified earlier.


    Click on the “Service Detail” navbar link to see details of what’s being monitored on your local machine. It will take a few minutes for Nagios to check all the services associated with your machine, as the checks are spread out over time.

    That’s all for a very simple Mollie’s version of Nagios installation.
    You can now browse anything you want from this Nagios.
    Have Fun! ^_^

    nagios overview

    here are links from where i got these brillian idea :

  • Advertisements

    Leave your tread here please :)

    Fill in your details below or click an icon to log in: Logo

    You are commenting using your account. Log Out /  Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )

    Connecting to %s

    This site uses Akismet to reduce spam. Learn how your comment data is processed.