Script for Nagios installation

script for Nagios installation
#!/bin/bash
dir=/usr/local/nagios
wget http://osdn.dl.sourceforge.net/sourceforge/nagios/nagios-3.0.6.tar.gz
wget 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 nagios
else
groupadd nagios
useradd -G nagios nagios
fi
tar xzf nagios-plugins-1.4.11.tar.gz
cd nagios-plugins-1.4.11
./configure –prefix=/usr/local/nagios –enable-redhat-pthread-workaround
make
make install
cd ..
tar xzf nagios-3.0.6.tar.gz
cd nagios-3.0.6
./configure –prefix=/usr/local/nagios
make install
make install-init
make install-config
make install-commandmode
make install-webconf
# make sure xinetd is installed.
echo ” nrpe      5666/tcp      #nrpe” >> /etc/services
chown -R nagios.nagios /usr/local/nagios
service xinetd restart
test=`/usr/local/nagios/libexec/check_nrpe -H 127.0.0.1`
teststr=”NRPE v2.8.1″
if [ "$test"="$teststr" ] ;then
echo -e “install success!!”
else
echo -e “install error!!!”
fi

Read On »

fix for ‘Missing Dependency : libttf.so.2 is needed by package Nagios’

 If you involve with the following errors. here is the fix for it.
” Missing Dependency : libttf.so.2 is needed by package Nagios”
http://dag.wieers.com/rpm/FAQ.php#B
#  Red Hat Enterprise Linux 5 / i386:
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
# Red Hat Enterprise Linux 5 / x86_64:
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
# Red Hat Enterprise Linux 4 / i386:
rpm -Uhv http://apt.sw.be/redhat/el4/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el4.rf.i386.rpm
# Red Hat Enterprise Linux 4 / x86_64:
rpm -Uhv http://apt.sw.be/redhat/el4/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el4.rf.x86_64.rpm
# Red Hat Enterprise Linux 3 / i386:
rpm -Uhv http://apt.sw.be/redhat/el3/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el3.rf.i386.rpm
# Red Hat Enterprise Linux 3 / x86_64:
rpm -Uhv http://apt.sw.be/redhat/el3/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el3.rf.x86_64.rpm
# Red Hat Enterprise Linux …

Read On »

yum-priorities on CentOS-5 and yum-plugin-priorities on CentOS-4, adding new repositories

Setting up Yum-priorities on CentOS-5 and yum-plugin-priorities on CentOS-4
1. CentOS 5
You should make sure that you have Priorities installed.
1.1. Priorities
yum-priorities is available in the CentOS 5 repositories:
yum install yum-priorities
Plugins are enabled in CentOS 5 by default.
Make sure that yum-priorities is enabled by editing the /etc/yum/pluginconf.d/priorities.conf file, and ensuring that it contains the following lines:
[main]
enabled=1
Edit the .repo files in /etc/yum.repos.d/ and set up priorities by adding the line:
priority=N
to a repository entry, where N is an integer number from 1 to 99.
The …

Read On »

Install Awstats

Install it with yum (needs rpmforge repo -> http://geekzine.org/2009/01/26/how-to-add-rpmforge-repository-to-centos-52/):
yum install awstats
Now you need to configure the apache permissions:
vi /etc/httpd/conf.d/awstats.conf
You can configure your allow from like this:
allow from 192.168.
Save the file
Then, reload apache config:
/etc/init.d/httpd reload
You need to create a default config for awstats
cd /etc/awstats
cp awstats.model.conf awstats.conf
You can edit the HostAliases Line to put your server name.
HostAliases=”localhost 127.0.0.1″
also, edit the line SiteDomain to full machine name:
SiteDomain=”webserver.example.com”
The  default configuration is now done!
Now you can access your stats on:
http://IpofTheMachine/awstats/awstats.pl

Read On »

 Page 2 of 3 « 1  2  3 »