Automated installation shell script Nagios server and client

Company Web site for a project, out of the line for a few days due to a disk full problem, because their servers are targeted at a particular IDC engine room, so consider deploying Nagios monitoring alarm systems, taking into account the other sites may have similar needs, so the installation process it into scripts to facilitate future work.
Nagios server automatically installs scripts as shown below (this script adopted under Centos5.5|5.6|5.8 x86_64):
yum -y install httpd gcc gcc-c++ glibc glibc-common gd gd-devel
useradd nagios
groupadd nagcmd
usermod    -G nagcmd nagios
usermod    -G nagcmd apache

cd /usr/local/src
wget http://nchc.dl.sourceforge.net/sourceforge/nagios/nagios-3.0.6.tar.gz
wget http://nchc.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.13.tar.gz
tar zxvf nagios-3.0.6.tar.gz
cd nagios-3.0.6
./configure –with-command-group=nagcmd –prefix=/usr/local/nagios
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
cd ../
tar zxvf nagios-plugins-1.4.13.tar.gz
cd nagios-plugins-1.4.13
./configure –prefix=/usr/local/nagios –with-nagios-user=nagios –with-nagios-group=nagios
make && make install
cd ../
tar zxvf nrpe-2.13.tar.gz
cd nrpe-2.13
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config

htpasswd -bc /usr/local/nagios/etc/htpasswd.users nagiosadmin nagiosadmin101
echo “alias nagioscheck=’/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg’ ” >> /root/.bashrc
source /root/.bashrc

chkconfig nagios on
chkconfig httpd on
service httpd start
service nagios start

# The base install will not repeat here, this line of code does not need human intervention generates password angiosadmin user called nagiosadmin101, while later due to frequent/usr/local/Nagios/etc/Nagios.cfg profile you want to modify, you need to test the syntax, so long command alias called nagioscheck commands.
Nagios client automatically installs scripts as shown below:
useradd nagios
cd /usr/local/src
wget http://nchc.dl.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz
wget http://prdownloads.sourceforge.net/sourceforge/nagios/nrpe-2.13.tar.gz

tar zxvf nagios-plugins-1.4.13.tar.gz
cd nagios-plugins-1.4.13
./configure
make
make install
chown nagios:nagios /usr/local/nagios
chown -R nagios:nagios /usr/local/nagios/libexec
cd ../
tar zxvf nrpe-2.13.tar.gz
cd nrpe-2.13
./configure
make all
make install-plugin
make install-daemon
make install-daemon-config

sed -i ‘s@allowed_hosts=127.0.0.1@allowed_hosts=114.112.11.11@’ /usr/local/nagios/etc/nrpe.cfg

/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
echo “/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d” >> /etc/rc.local

#Allowed_hosts this line was originally the 127.0.0.1 address 114.112.11.11 address of the server instead of from now (for harmless disposal), this line of code we can according to the actual need to consider whether to increase, the next job is to Nagios server-side debugging, process here to skip.
Actually, in machine into IDC room zhiqian, like Nagios and puppet client software, should in each Taiwan on-line machine Shang deployment installation good, machine on-line Qian certainly first is concentrated in himself of LAN within Kickstart Hou then initial of, then network stable, and debugging also convenient, so with puppet automation dimension of both convenient and effort, such lest machine on-line yihou and remote maintenance installation, that consumption has human cost, and also increased has machine risk.
PS: I see many of my friends are writing SHELL scripts on their own as a Nagios plugin as a complement to MySQL master-slave function, in fact, own check_mysql in Nagios and check_mysql_health plug-ins to achieve because check_mysql reported so frequently during the deployment process, segmentation fault, so for now, mainly check_mysql_health, Because we are just monitoring the slave IO and the SQL above process, and more importantly, we want to monitor from the delay.