Install and Setup Nagios 3.4.4 on CentOS 6.3 / RHEL 6.3

ADVERTISEMENT

Nagios is the most widely used open source monitoring tools which help us to monitor the services and application that run’s on Windows,Linux,Routers and other network devices. With the help of Nagios you can monitor basic services and attributes. We can access the Nagios using web interface coming with the bundle and configuration need to be done on the file level ( Editing the conf file using the VI editor).

Services List:

This Tutorial describes how can you monitor “private” services and attributes of Linux/UNIX servers, such as:

ADVERTISEMENT
Article will continue after the ad

Attributes:

  • CPU load
  • Memory usage
  • Disk usage
  • Logged in users
  • Running processes
  • etc.

Private Services:

  • HTTP
  •  FTP
  • SSH
  • SMTP
  •  etc

Prerequisites:

Before installing the Nagios, system need to meet the requirements for installing Nagios; So install the Web Server (httpd) , PHP ,compilers and development libraries. Install all with single command.
yum install httpd php gcc glibc glibc-common gd

User Account:

We required to create the user account for accessing the Nagios installation and configuration files. Before starting become the root user.

su -l

Create a new user in the name of “nagios” and give it a password.

useradd nagios

Set the password.

passwd nagios

Create a new group called nagcmd for allowing the external commands to be excuted through the web interface. change nagios and apache user to the created group.

groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache

Download Nagios & Plugin:

Download the Nagios and the Nagios plugins using the following command ( For latest version Visit Nagios WebSite )

wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.4.4.tar.gz
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.16.tar.gz

Install Nagios:

Extract Nagios archive.

tar -zxvf nagios-3.4.4.tar.gz
cd nagios

Run the Nagios configure script, with the group mentioned.

./configure --with-command-group=nagcmd

Compile the Nagios source code.

make all

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

make install
make install-init
make install-config
make install-commandmode

Configure Nagios:

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.

vi /usr/local/nagios/etc/objects/contacts.cfg

Change the Email address field to receive the notification.

define contact{
contact_name    nagiosadmin   ; Short name of userus
generic-contact                     ; Inherit default values from generic-contact template (defined above)
alias   Nagios Admin           ; Full name of useremail
root@itzgeek.com         ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******

Configure Web Interface:

Install the Nagios web config file in the Apache conf.d directory.

make install-webconf

Create a nagiosadmin account for logging into the Nagios web interface. Remember the password you assign to this account – you’ll need it later.

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

Restart Apache to make the new settings take effect.

service httpd restart

Install the Nagios Plugins:

Extract the Nagios plugins source code tarball.

tar -zxvf nagios-plugins-1.4.16.tar.gz
cd nagios-plugins-1.4.16

Compile and install the plugins. While compiling i got an errorfor SSL Verison; here is the Nagios troubleshooting.

./configure --with-nagios-user=nagios --with-nagios-group=nagios
make
make install

Starting Nagios:

Add it on system start-up using the following command

chkconfig nagios on

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.

service nagios start

SELinux Settings:

See if SELinux is in Enforcing mode.

getenforce

Put SELinux on Permissive mode.

setenforce 0

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

Access Web Interface:

Now access the Nagios web interface using the following URL. You’ll be prompted for the username (nagiosadmin) and password you specified earlier.

http://localhost/nagios/

 

You will redirect to the home page, Click on the Services to view Status of Hosts.

That’s All.
Search Term:

Install Nagios

Install Nagios 3.4.4

Install Nagios on CentOS

Install Nagios on CentOS 6

Install Nagios on Redhat

Install Nagios on RHEL 6

Setup Nagios on CentOS

Configure Nagios on CentOS 6

Configire Nagios on RHEL 6

Install Nagios on Fedora

Step by Step Nagios installation

ADVERTISEMENT

POSTS YOU MAY LIKE -:)

Share This Post

Shares