monitoring tool

Step By Step method for installing Nagios in Amazon Linux

Step By Step method for installing Nagios in Amazon LinuxIn this blog, we will explain you Step By Step method for installing Nagios in Amazon Linux.

Nagios is very lightweight monitoring tool. We are using this tool for past 1-2 years but somehow one day it get crash and to setup/restore Nagios it took more than 4hours(on premises). so rather than running it on a machine that itself was constantly crashing I decided to move it onto Amazon Web Services EC2 platform using the Free Tier Entitlement you get when you first sign up. Therefore total cost to me to move it from home to the cloud was $0, at least for the first 12 months and not taking into account time.

Follow below steps to install Nagios Core on Amazon Linux on EC2.

To Start Nagios Core Installation you must have your EC2 instance up and run and have already configured SSH access to the instance.

Step 1: Install Prerequisite Software

Nagios requires the following packages are installed on your server prior to installing Nagios:

* Apache
* GCC compiler
* GD development libraries

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

Step 2: Create Account Information

You need to setup a Nagios user. Run the following commands:

Type the new password twice.

Step 3: Download Nagios Core and the Plugins

Create a directory for storing the downloads.

Download the source code tarballs of both Nagios and the Nagios plugins (visit for links to the latest versions).

Step 4: Compile and Install Nagios

Extract the Nagios source code tarball.

Run the configuration script with the name of the group which you have created in above step.

Compile the Nagios source code.

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

Step 5: Customize Configuration

Change E-Mail address with nagiosadmin contact definition you’d like to use for receiving Nagios alerts.

Step 6: Configure the Web Interface

Create a nagiosadmin account for logging into the Nagios web interface. Note the password you need it while login to nagios web console.

Step 7: Compile and Install the Nagios Plugins

Extract the Nagios plugins source code tarball.

Compile and install the plugins.

Step 8: Start Nagios

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

Verify the sample Nagios configuration files.

If there are no errors, start Nagios.

Step 9: Update AWS Security Group

you need to open port 80 on the new AWS EC2 server to incoming traffic so you can connect to the new Nagios webpage.

* From the EC2 console select Security Groups from the left navigation pane.
* Select the Security Group applicable for the instance that Nagios was installed on and open the Inbound tab
* If there is no rule to allow HTTP traffic on port 80 then click edit in the Inbound tab to add a new rule
* Click on New Rule button
* Scroll down to select HTTP from the list of Type
* If you want to be able to access Nagios from anywhere then select Save, otherwise enter the IP address or range of IP address you want to be able to access it from then select Save.

Step 10: Login to the Web Interface

access the Nagios web interface to do this you will need to know the Public DNS or IP for your instance, you can get this from the Instance section of the EC2 Console if you do not already know it. You’ll be prompted for the username (nagiosadmin) and password you specified earlier.


Read this also:

Simple Steps for Installing Munin Monitoring Tool

Steps to install Nagios in Amazon Linux

Add remote server in Nagios


Related Articles


  1. I got the error in step 4. I am using CentOS7.
    [root@nagios nagios-4.0.8]# make all
    cd ./base && make
    make[1]: Entering directory /root/downloads/nagios-4.0.8/base'
    make[1]: *** No rule to make target
    ../include/locations.h’, needed by nagios.o'. Stop.
    make[1]: Leaving directory
    make: *** [all] Error 2
    [root@nagios nagios-4.0.8]# pwd
    [root@nagios nagios-4.0.8]#

  2. For centos7/RHEL7
    #yum install httpd php php-cli gcc glibc glibc-common gd gd-devel net-snmp
    # service httpd start
    # cd /opt/
    # wget
    # tar zxvf nagios-4.3.4.tar.gz
    # cd nagios-4.0.8
    # ./configure –with-command-group=nagcmd
    # make all
    # make install
    # make install-init
    # make install-config
    # make install-commandmode
    # htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadminmake install-webconf
    # service httpd restart

Leave a Reply

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


Adblock Detected

Please consider supporting us by disabling your ad blocker
%d bloggers like this: