Quickly install Nagios on Ubuntu - gHacks Tech News

Quickly install Nagios on Ubuntu

Nagios is not just a tool, it's one of the best open source network monitors available. Nagios has a simple plug-in design that allows administrators to easily create their own checks and monitors. The problem that so many see with Nagios is that it is supposedly so difficult to install. That is not the case. In fact, with the help of the Synaptic package manager, Nagios is simple to install and get up and running.

In this article I will show you how to quickly get Nagios up and running. In no time you will have Nagios up and running and monitoring your network.

Features of Nagios

Before we get to the installation, let's take a look at the features of Nagios. Nagios can:

  • Monitor network services (SMTP, POP3, HTTP, NNTP, PING, etc.)
  • Monitor host resources (processor load, disk usage, etc.)
  • Allow for simple plugin design
  • Do parallelized service checks
  • Define a network host hierarchy using
  • Contact administrators when service or host problems occur
  • Define event handlers to be run during service or host events for proactive problem resolution
  • Automatd log file rotation
  • Support the implementation of redundant monitoring hosts
  • Offer an optional web interface for viewing current network status, notification and problem history, log file, etc

Sold yet? You should be, especially considering this tool is free and open source! Now, let's get on with the installation.

Installation

Follow these simple steps to installing Nagios:

  1. Fire up Synaptic.
  2. Search for "nagios" (no quotes)
  3. Mark nagios3 for installation (this will also pick up all of the dependencies)
  4. Click Apply to install

During the installation you will be asked for an administrator password. This will be the password for the nagiosadmin user that will have access to the web interface. Once the installation is complete, you need to run a check to make sure everything is okay. The command for this check is:

sudo nagios3 -v /etc/nagios3/nagios.cfg

When this command runs you will see something like:

Nagios 3.0.2
Copyright (c) 1999-2008 Ethan Galstad (http://www.nagios.org)
Last Modified: 05-19-2008
License: GPL

Reading configuration data…

Running pre-flight check on configuration data…

Checking services…
Checked 7 services.
Checking hosts…
Checked 2 hosts.
Checking host groups…
Checked 5 host groups.
Checking service groups…
Checked 0 service groups.
Checking contacts…
Checked 1 contacts.
Checking contact groups…
Checked 1 contact groups.
Checking service escalations…
Checked 0 service escalations.
Checking service dependencies…
Checked 0 service dependencies.
Checking host escalations…
Checked 0 host escalations.
Checking host dependencies…
Checked 0 host dependencies.
Checking commands…
Checked 142 commands.
Checking time periods…
Checked 4 time periods.
Checking for circular paths between hosts…
Checking for circular host and service dependencies…
Checking global event handlers…
Checking obsessive compulsive processor commands…
Checking misc settings…

Total Warnings: 0
Total Errors:   0

With the results giving 0 errors and 0 warnings, you are ready to log in.

Logging in

Figure 1

Fire up your web browser and point it to http://IP_TO_SERVER/nagios3 at which point you will be asked for login credentials. Remember that password you gave during installation? That is the password you will use to login (with the user nagiosadmin).

When you log in you will be greeted with the Nagios welcome screen (see Figure 1), at which point you are ready to start monitoring.

Final thoughts

Wasn't so bad was it? And you though Nagios was impossible to install. Fortunately it's not. And even more fortunately is how powerful Nagios is. You will be blown away at how useful this tool is.

We need your help

Advertising revenue is falling fast across the Internet, and independently-run sites like Ghacks are hit hardest by it. The advertising model in its current form is coming to an end, and we have to find other ways to continue operating this site.

We are committed to keeping our content free and independent, which means no paywalls, no sponsored posts, no annoying ad formats or subscription fees.

If you like our content, and would like to help, please consider making a contribution:

Comments

  1. Jitendra Kumar said on March 27, 2010 at 2:41 pm
    Reply

    Good piece of information! Will give it a try..

Leave a Reply

Check the box to consent to your data being stored in line with the guidelines set out in our privacy policy

Please note that your comment may not appear immediately after you post it.