您的位置:首页 > 运维架构 > Linux

LINUX自动安装nagiso client插件脚本

2013-06-17 15:18 543 查看
#!/bin/bash
#!make in 小5 on 2013-05 at picc
###############QQ:1214854702###############################
#scp 10.132.40.13:/usr/local/src/nagios-plugins-1.4.15.tar.gz /usr/local/src/nrpe-2.14.tar.gz
useradd -s /sbin/nologin nagios
cd /usr/local/src/
tar zxvf nagios-plugins-1.4.16.tar.gz
cd nagios-plugins-1.4.16
./configure --prefix=/usr/local/nagios
make && make install
chown -R nagios.nagios /usr/local/nagios
cd /usr/local/src/
tar zxvf nrpe-2.14.tar.gz
cd nrpe-2.14
./configure ; make all ; make install-plugin ; make install-daemon ; make install-daemon-config ;make install-xinetd
if [ "$?" == "0" ];then
echo "installed ok!"
else
exit 1
fi
sed -i 's/127.0.0.1/127.0.0.1 10.128.118.141/g' /etc/xinetd.d/nrpe
echo "nrpe 5666/tcp #nrpe" >> /etc/services
service xinetd restart
chkconfig --add xinetd
chkconfig xinetd on
echo "complete installed !"
本文出自 “神奇的网络” 博客,请务必保留此出处http://wxlxiao5.blog.51cto.com/4284565/1223583
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: