Nagios Installation procedure in Fedora/CentOS

nagios-core-logoNagios is a popular open source computer system monitor, network monitoring and infrastructure monitoring software application. Nagios offers complete monitoring and alerting for servers, switches, applications, and services and is considered the defacto industry standard in IT infrastructure monitoring. It watches hosts and services. It alerts users when things go wrong and alerts them again when those wrong things get better/resolved.

Prerequisites for the host Server.

During portions of the installation you’ll need to have root access to your machine.

Make sure you’ve installed the following packages on your Fedora installation before continuing.

You can use yum to install these packages by running the following commands (as root):

1) Create Account Information

Become the root user.

2) Download Nagios and the Plugins

Create a directory for storing the downloads.

Download the source pre tarballs of both Nagios and the Nagios plugins (visit for links to the latest versions). These directions were tested with Nagios 3.1.1 and Nagios Plugins 1.4.15.

3) Compile and Install Nagios

Extract the Nagios source pre tarball.

Don’t start Nagios yet – there’s still more that needs to be done…

4) Customize Configuration

Sample configuration files have now been installed in the /usr/local/nagios/etc directory. These sample files should work fine for getting started with Nagios. You’ll need to make just one change before you proceed…

Edit the /usr/local/nagios/etc/objects/contacts.cfg config file with your favorite editor and change the email address associated with the nagiosadmin contact definition to the address you’d like to use for receiving alerts.

5) Configure the Web Interface

Note: Consider implementing the ehanced CGI security measures described here to ensure that your web authentication credentials are not compromised.

6) Compile and Install the Nagios Plugins

Extract the Nagios plugins source pre tarball.

7) Start Nagios

Add Nagios to the list of system services and have it automatically start when the system boots.

8) Modify SELinux Settings

Fedora ships with SELinux (Security Enhanced Linux) installed and in Enforcing mode by default. This can result in “Internal Server Error” messages when you attempt to access the Nagios CGIs.

See if SELinux is in Enforcing mode.

To make this change permanent, you’ll have to modify the settings in /etc/selinux/config and reboot.

Instead of disabling SELinux or setting it to permissive mode, you can use the following command to run the CGIs under SELinux enforcing/targeted mode:

For information on running the Nagios CGIs under Enforcing mode with a targeted policy, visit the Nagios Support Portal or Nagios Community Wiki.

9) 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.

10) Other Modifications

Make sure your machine’s firewall rules are configured to allow access to the web server if you want to access the Nagios interface remotely.

Configuring email notifications is out of the scope of this documentation. While Nagios is currently configured to send you email notifications, your system may not yet have a mail program properly installed or configured. Refer to your system documentation, search the web, or look to the Nagios Support Portal or Nagios Community Wiki for specific instructions on configuring your system to send email messages to external addresses. More information on notifications can be found here.

Then we have to install nrpe plugin to monitor the different linux host.

Remote Host Setup

Download and Install NRPE Plugins.

Install xinetd:

Install and edit nrpe plugin:

Edit the /etc/services file then restart the xinetd service:

Now we have to add a iptable rule:

Edit the nrpe.cfg file to insert coustomize commands.

Add the below lines, then you will start getting data on your nagios server.



The following two tabs change content below.

Tapas Mishra

Sr. Engineer (DevOps)
Loves to work on Opensource products. Having experience on Linux environment. Knowledge on Public cloud services like AWS, Rackspace, DigitalOcean, Linode. Please don't hesitate to give a comment on the posts. Your comments are my strength.

3 thoughts on “Nagios Installation procedure in Fedora/CentOS

  1. Your blog appears to be having some compatibilty issues in
    my firefox browser. The content seems to be running off the webpage pretty bad.

    If you would like you can e-mail me at: rosauraroby@zoho.
    com and I will shoot you over a screenshot of the problem.

Leave a Reply