CentOS 6U4 and Nagios+Nagios-plugins

How to set up Nagios 4.0.2 on CentOS 6U4 server.

A necessary starup :
Apache
PHP
GCC compiler
GD development libraries
And all of this is installed like this :
# yum install httpd php
# yum install gcc glibc glibc-common
# yum install gd gd-devel
Make a necessary user and group :
# useradd -m nagios
# passwd nagios
…..
# groupadd nagcmd
# usermod -a -G nagcmd nagios
# usermod -a -G nagcmd apache
Download Nagios and Nagios-plugins :
# wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-xxx
# wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-xxx

Nagios installation
# tar xvfz nagios-4.0.2.tar.gz
# cd nagios-4.0.2
# ./configure –with-command-group=nagcmd
# make all
# make install
# make install-init
# make install-config
# make install-commandmode
Look closely, if any error pops up. If not, all is well!
Put up a valid e-mail address in configuration file :
# vi /usr/local/nagios/etc/objects/contacts.cfg
Web interface installation :
# make install-webconf
/usr/bin/install -c -m 644 sample-config/httpd.conf /etc/httpd/conf.d/nagios.conf
*** Nagios/Apache conf file installed ***
Set up user for Nagios web access :
# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
# service httpd restart

Nagios-plugins
# tar xvfz nagios-plugins-1.5.tar.gz
# ./configure –with-nagios-user=nagios –with-nagios-group=nagios
# cd nagios-plugins-1.5
# ./configure –with-nagios-user=nagios –with-nagios-group=nagios
# make
# make install

Starting Nagios
Check the configuration :
# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
…..
Total Warnings: 0
Total Errors: 0
Service starting :
# service nagios start
How to access the service :
http://IP-address-of-server/nagios/

This entry was posted in Linux and tagged , . Bookmark the permalink.

Comments are closed.