Installing Nagios made easy
February 6, 2010 Leave a comment
Installing nagios by hand is good but not recommended.Instead use a small script to do the job for you…because being an system admin you have lot of thing to take care…so the time will be crucial factor. But having said I have had no intention to make it a point that you automate whatever you want. Sometime the automation has the adverse effect on system.You do automation when it must require and need.
So the script for installing Nagios and it’s plugins from source is below…u can also enhance it if you want…
# This script will install Nagios from source along with the plugins.
wget -c http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0.6.tar.gz
wget -c http://osdn.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz
mkdir -p $dir
grep -i “red hat” /etc/issue>/dev/null2>&1
if [ `echo $? ` = 0 ];then
useradd -G nagios nagios
tar xzf nagios-plugins-1.4.11.tar.gz
./configure –prefix=/usr/local/nagios –enable-redhat-pthread-workaround
tar xzf nagios-3.0.6.tar.gz
# make sure xinetd is installed.
echo ” nrpe 5666/tcp #nrpe” >> /etc/services
chown -R nagios.nagios /usr/local/nagios
service xinetd […]
But one word caution for heaven’s sake please investigate manually or put some mechanism within the script to check that everything done as required.
Hope this will help.