#!/bin/sh
mkdir -p /usr/local/nagios/libexec
NG_source=/data/source
NG_DIR=/usr/local/nagios
NG_DIRLIB=/usr/local/nagios/libexec
NG_SOURCE_DIR=/data/source/nagios
NG_PL_DIR=/data/source/nagios-plugins-1.4.16
NG_NR_DIR=/data/source/nrpe-2.14
yum -y install httpd php gcc glibc glibc-common gd gd-devel
download(){
cd $NG_SOURCE
wget
wget http://ncu.dl.sourceforge.net/project/nagiosplug/nagiosplug/1.4.16/nagios-plugins-1.4.16.tar.gz
wget
}
user(){
/usr/sbin/useradd nagios
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -a -G nagcmd nagios
}
nagios(){
cd $NG_source
tar xf nagios-3.5.0.tar.gz
cd $NG_SOURCE_DIR
./configure --prefix=$NG_DIR --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
}
plugins(){
echo "Install nagios-plugins"
cd $NG_source
/bin/tar xf nagios-plugins-1.4.16.tar.gz
cd $NG_PL_DIR
./configure
make && make install
chown nagios.nagios $NG_DIR
chown -R nagios.nagios $NG_DIRLIB
}
nrpe(){
echo "Install Nrpe"
cd $NG_source
/bin/tar xf nrpe-2.14.tar.gz
cd $NG_NR_DIR
cd nrpe-2.14
./configure
make all
}
main(){
download
user
nagios
plugins
nrpe
}
main
阅读(937) | 评论(0) | 转发(0) |