Nagios installation and SMS alert using clickatell

Installing nagios:-

I used this script for installing nagios



# 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
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 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



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: