My blog has moved! Redirecting...

You should be automatically redirected. If not, visit http://techienote.com and update your bookmarks.

Tech Resources

Tuesday, April 7, 2009

Installing Nagios on CentOS

Nagios is a popular open source computer system and network monitoring software application. It watches hosts and services, alerting users when things go wrong and again when they get better. Nagios was originally designed to run under Linux, but also runs well on other Unix variants. Nagios is free software licensed under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

Operating System:
CentOS5.2

Nagios:
Nagios 3.0.6

Prerequisites:
Installing prerequisites on your CentOS box.

# yum install -y httpd gcc glibc glibc-common gd gd-devel

Downloading & Installing nagios and its plugin:

Creating user

#/usr/sbin/useradd -m nagios
#/usr/sbin/groupadd nagcmd
#/usr/sbin/usermod -G nagios,nagcmd nagios
#/usr/sbin/usermod -G nagios,nagcmd apache

Assigning password for user nagios

#passwd nagios

Downloading nagios

#cd /usr/local/src/
#wget http://ovh.dl.sourceforge.net/sourceforge/nagios/nagios-3.0.6.tar.gz
#tar -xzf nagios-3.0.6.tar.gz

Installing Nagios

#cd /usr/local/src/nagios-3.0.6
#./configure --prefix=/usr/local/nagios --with-command-group=nagcmd --enable-nanosleep --enable-event-broker
#make all
#make install
#make install-init
#make install-commandmode
#make install-config
#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 -bc /usr/local/nagios/etc/htpasswd.users nagiosadmin urpassword

Installing nagios plugin

#cd /usr/local/src
#wget http://ovh.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz
#tar -xzf nagios-plugins-1.4.13.tar.gz
#cd nagios-plugins-1.4.13
#./configure --with-nagios-user=nagios --with-nagios-group=nagios
#make
#make install

Restart Apache to take effect all the changes.
#service httpd restart

Starting Nagios:
#service nagios start
Fireup your web browser and go to http://your_server_ip/nagios

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.

Labels: ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home