Nagios Installation and Configuration: Part Two

NagiosIn the previous article, we introduced Nagios and began covering installation. In this article, we will continue our look at Nagios, covering configuration and installation of plugins.

Nagios Configuration

Now that Nagios has been installed, it’s time to configure it. Sample configuration files have been installed in the /usr/local/nagios/etc directory. For the most part, the settings in the sample files should work fine for getting started with Nagios. You should, however change the e-mail address associated with the nagiosadmin contact definition to the address you’d like to use for receiving alerts. To do so, you change the email field in /usr/local/nagios/etc/objects/contacts.cfg with your favorite editor.

Next, install the Nagios web config file in the Apache conf.d directory:

make install-webconf

Create a nagionsadmin account for logging into the Nagios web interface. Remember the password you assign to this account.

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

Now restart Apache to make the new settings take effect.

/etc/init.d/apache2 reload

Next, extract the Nagios plugins source code tarball:

tar xzf nagios-plugins-2.0.3.tar.gz

cd nagios-plugins-2.0.3

Compile and install the plugins:

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


make install

Now configure nagios to automatically start when the system boots:

ln -s /etc/init.d/nagios /etc/rc5.d/599nagios

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

You should now be able to access the Nagios web interface at the URL below. You’ll be promoted 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.

If you want to receive e-mail notifications for Nagios alerts, you need to install the mailx (Postfix) package:

sudo apt-get install mailx

sudo apt-get install postfix

You’ll have to edit the Nagios e-mail notification commands found in /usr/local/nagios/etc/objects/commands.cfg and change and /bin/mail references to /usr/bin/mail. Once you do that, you’ll need to restart Nagios to make the configuration changes live:

sudo /etc/init.d/nagios restart

In the next article, we’ll access Nagios via the web interface and configure it to work with pfSense.

External Links:

The official Nagios site

Nagios on Wikipedia

Nagios Installation and Configuration: Part One


Nagios is an open source computer system monitoring, network monitoring and infrastructure monitoring software application. It enables organizations to identify and resolve IT infrastructure problems before they affect critical business processes, … [Continue reading]

netio: A Network Benchmark Tool


netio is a network benchmark utility for OS/2 2.x, Windows, Linux and Unix. It measures the net throughput of a network via TCP and UDP protocols using various different packet sizes. For netio to run a benchmark, one instance has to be run on one … [Continue reading]

HAProxy Load Balancing: Part Three


In the previous two articles in this series, we introduced HAProxy and began looking at configuration of HAProxy under pfSense. In this article, we conclude our look at HAProxy configuration. In the HAProxy Listener configuration tab, we had … [Continue reading]

Amazon Affiliate Purchases: October 2014

Here are some of the items readers bought through my Amazon affiliate links: Coolerguys Programmable Thermal Fan Controller with LED Display EnGenius Technologies Dual Band 2.4/5 GHz Wireless AC1200 Router with Gigabit and USB (ESR1200) Fan … [Continue reading]

HAProxy Load Balancing: Part Two


In the previous article, we introduced HAProxy as a load balancing solution for TCP and HTTP-based applications. In this article, we will continue our look at HAProxy configuration. The next setting in the "Settings" tab is "Global Advanced pass … [Continue reading]

New Python Site Launched

Anyone who has an interest in the Python programming language might want to take a look at my latest site, I only have a few articles posted so far, but I am setting a goal of posting at least two articles a week. As someone whose … [Continue reading]

HAProxy Load Balancing: Part One


HAProxy is an application offering high-availability, load balancing and proxying for TCP and HTTP-based applications. It is particularly suited for high traffic web sites, and is used by a number of high-profile websites including GitHub, Stack … [Continue reading]

Bandwidth Monitoring with BandwidthD

BandwidthD tracks usage of TCP/IP subnets and builds HTML files with graphs to display utilization. Charts are built for individual IP addresses, and by default display utilization over 2 day, 8 day, 40 day, and 400 day periods. Furthermore, each IP … [Continue reading]

Data Link Layer Advertising with ladvd


ladvd sends LLDP (Link Layer Discovery Protocol) advertisements on all available interfaces. This makes connected hosts visible on managed switches. By default, it will run as a privilege-separated daemon. In addition to LLDP, ladvd also supports the … [Continue reading]

© 2013 David Zientara. All rights reserved. Privacy Policy