Installing nagios:-
I used this script for installing nagios
================================================================
#!/bin/sh
# Any Failing Command Will Cause The Script To Stop
set -e
# Treat Unset Variables As Errors
set -u
echo “***** Starting Nagios Quick-Install: ” `date`
echo “***** Installing pre-requisites”
yum -y install httpd
yum -y install gcc
yum -y install glibc glibc-common
yum -y install gd gd-devel
echo “***** Setting up the environment”
useradd -m nagios
echo “bharathi” |passwd –stdin nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache
echo “***** Getting the Nagios Source and Plug-Ins”
cd /usr/local/src
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.0.tar.gz
wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.14.tar.gz
tar xzf nagios-3.2.0.tar.gz
tar xzf nagios-plugins-1.4.14.tar.gz
echo “***** Installing Nagios”
cd /usr/local/src/nagios-3.2.0
./configure –with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
echo “***** Setting up htpasswd auth”
htpasswd -nb nagiosadmin bharathi > /usr/local/nagios/etc/htpasswd.users
service httpd restart
echo “***** Setting up Nagios Plug-Ins”
cd /usr/local/src/nagios-plugins-1.4.13
./configure –with-nagios-user=nagios –with-nagios-group=nagios
make
make install
echo “***** Fixing SELinux”
chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
chcon -R -t httpd_sys_content_t /usr/local/nagios/share/
echo “***** Starting Nagios”
chkconfig –add nagios
chkconfig nagios on
service nagios start
echo “***** Done: ” `date`
=====================================================================
After executing the above script you can get the nagios installed in /usr/local/nagios/. Check the localhost.cfg file and you can get the remote host configuration. What I did is I created a domain template file having the file
I had a hell out of time for the configuration of nagios and clickatell SMS gateway configuration…Finally I made it…:)
You can get the latest template based configuration from the URL
http://nagios.manubulon.com/traduction/docs14en/xodtemplate.html
===================================================================