About Me

My photo
Hi Friends, I am Sandeep CC and some people know me as System Administrator. I have started my professional career from 2008. I have been working as System Administrator on Linux Server and Windows Client. I am here to share my Knowledge in which I have experienced and which I have come across till now, It could be help to you people. In case anything wrong or any improvements in my post steps, Please comment to the post, Feel free to contact me by posting comments on this blog. Thanks and Regards, Sandeep CC

Tuesday, February 14, 2012

Configure Of Nagios Monitoring tool in REDHAT LINUX-5


This Nagios Monitoring tools i have install and configured in my Office, and this article will support you to install and configure Nagios monitoring tool in Redhat Linux, Follow the simple steps which given below.

Server: sandeeplinux-server (192.168.4.1 Local Network IP & Connected to Internet)

Requirement Servers & Services:

1. Apache Click Here For Installation Steps
2. PHP Click Here For Installation Steps
3. GD [Install GD rpm -i (RPM_NAME)]
4. GCC [Install GCC rpm -i (RPM_NAME)]

Start HTTPD Service
[root@sandeeplinux-server ~]# service httpd start
Starting httpd:
[root@sandeeplinux-server ~]#

Above 4 services/server must need to install/configure then turn to Next

Download latest Nagios & Nagios-Plugins (I have experienced with below versions

Click Here To Download Nagios nagios-3.3.1.tar.gz
OR In CMD MODE

[root@sandeeplinux-server]# wget http://sourceforge.net/projects/nagios/files/nagios-3.x/nagios-3.3.1/nagios-3.3.1.tar.gz/download

Click Here To Download Nagios-Plugins nagios-plugins-1.4.15.tar.gz
OR In CMD MODE

[root@sandeeplinux-server]# wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz/download

Unzip Folders

[root@sandeeplinux-server Server]# tar -xzf nagios-3.3.1.tar.gz
[root@sandeeplinux-server Server]#
[root@sandeeplinux-server Server]# tar -xzf nagios-plugins-1.4.15.tar.gz
[root@sandeeplinux-server Server]#

Create Nagios User and Password, and add to Apache Group

[root@sandeeplinux-server ~]# useradd nagios
[root@sandeeplinux-server ~]# passwd nagios
Changing password for user nagios.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@sandeeplinux-server ~]#

[root@sandeeplinux-server ~]# usermod -a -G nagios apache
[root@sandeeplinux-server ~]#

Configuration Of Nagios

[root@sandeeplinux-server]# cd nagios
[root@sandeeplinux-server nagios]# ./configure
[root@sandeeplinux-server nagios]#
[root@sandeeplinux-server nagios]# make all
[root@sandeeplinux-server nagios]#
[root@sandeeplinux-server nagios]# make install
[root@sandeeplinux-server nagios]#
[root@sandeeplinux-server nagios]# make install-init
[root@sandeeplinux-server nagios]#
[root@sandeeplinux-server nagios]# make install-config
[root@sandeeplinux-server nagios]#
[root@sandeeplinux-server nagios]# make install-commandmode
[root@sandeeplinux-server nagios]#
[root@sandeeplinux-server nagios]# make install-webconf
[root@sandeeplinux-server nagios]#

Creating Admin Account For Nagios Login

[root@sandeeplinux-server nagios]# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
new password (Give Password For Nagios Login User)
[root@sandeeplinux-server nagios]#

Restart HTTPD Service:

[root@sandeeplinux-server ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@sandeeplinux-server ~]#

Configuration Of Nagios-Plugins

[root@sandeeplinux-server]# cd nagios-plugins-1.4.15
[root@sandeeplinux-server nagios-plugins-1.4.15]# ./configure
[root@sandeeplinux-server nagios-plugins-1.4.15]#
[root@sandeeplinux-server nagios-plugins-1.4.15]# make
[root@sandeeplinux-server nagios-plugins-1.4.15]#
[root@sandeeplinux-server nagios-plugins-1.4.15]# make install
[root@sandeeplinux-server nagios-plugins-1.4.15]#

Create Entry For Nagios in /etc/init.d/:

[root@sandeeplinux-server nagios-plugins-1.4.15]# chkconfig --add nagios
[root@sandeeplinux-server nagios-plugins-1.4.15]#
[root@sandeeplinux-server nagios-plugins-1.4.15]# chkconfig nagios on
[root@sandeeplinux-server nagios-plugins-1.4.15]#

Check Configured configuration's are correct with 0 errors:

[root@sandeeplinux-server ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
Total Warnings: 0
Total Errors: 0


Things look okay - No serious problems were detected during the pre-flight check
[root@sandeeplinux-server ~]#

Start Nagios Service (If It Is 0 Error then only start service)

[root@sandeeplinux-server ~]# service nagios start
Starting nagios: done.
[root@sandeeplinux-server ~]# service nagios status
nagios (pid 17436) is running...
[root@sandeeplinux-server ~]#

Now Login With Nagios In Browser

Login In Local System
Open Your Browser In Local System http://localhost/nagios
User Name: nagiosadmin
Password: nagiosadmin

Login In Remote System

Open Your Browser In Remote System http://192.168.4.1/nagios
User Name: nagiosadmin
Password: nagiosadmin

Now You will Get Nagios Home Page:


Technical Overview


Hosts


Services



Thanks & Regards,
Sandeep CC

10 comments: