Thursday, October 14, 2010

How to install and configure Nagios Monitoring tool in redhat linux rhel5 or centos


This article will help you to install and configure Nagios monitoring tool in redhat linux or other redhat distributions like fedora, centos etc.
Nagios Installation :
Installing packages. Apache, PHP, GCC & GD

Installing Apache web server:
#yum -y install httpd*
set hostname in FQDN
#service httpd on

Installing PHP, GCC and GD:
#yum -y install php*
#yum -y install gcc*
#yum -y install gd*

Getting the package:
Get the latest packages from net. Mov it to some directory and untar them.

#mv nagios-3.2.0.tar.gz  /usr/local/src
#tar xvf nagios-3.2.0.tar.gz

#mv nagios-plugins-1.4.14.tar.gz/usr/local/src
#tar xvf nagios-plugins-1.4.14.tar.gz

Adding nagios user and setting password for that user:
#useradd nagios
#passwd nagios
usermod -a -G nagios apache              //To permit the commands through web interface.

Configuration of Nagios:
cd /usr/local/src/nagios-3.2.0

make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf

Admin account setting for nagios:
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin          /passwd  for web interface
give passwd
service httpd restart

Nagios Plugin installation:
install nagios - pluggin

cd /usr/local/src/nagios-plugins-1.4.14
make install

Creating entry in /etc/init.d/:
chkconfig --add nagios
chkconfig nagios on

Checking the configuration:
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

Nagios Alert Plugin - Mozilla Addon:
Name : Nagios Checker
[give name and url]

Configuring remotehost in nagios:
cp /usr/local/nagios/etc/objects/localhost.cfg  /usr/local/nagios/etc/objects/remotehost.cfg
[comment the hostgroup entries in order to prevent duplicate entries]
[change the localhost entries to the remote machine hostname and IP address.]

Recommended Reading

Nagios 3 Enterprise Network Monitoring: Including Plug-Ins and Hardware Devices
Building a Monitoring Infrastructure with Nagios
Learning Nagios 3.0


  1. this is very nice document.

    really iam very happy .

  2. this is very easiest way to
    understand & install.

  3. thanks ... its rely cool ,,,

  4. so easy to understand i need to try it.. :-)

  5. Thanks...easy to need to apply :-)

  6. nice document


    Pankaj Chamoli

  7. nice Document thanks.....

    Bharat Kumar

  8. Hi this is Raju working as a Unix Administrator.I am knew to LINUX environment. in my new org ..we have most of the servers are CENTOS..i want to install monitoring tools in enviroment..when i go to the google i have found Nagios is the best and free monitoring tool. May i know the what are requirements to install Nagios to my servers.


Be nice. That's all.