linux 被监控linux客户端 安装脚本
原创qqtthappygo ©著作权
©著作权归作者所有:来自51CTO博客作者qqtthappygo的原创作品,请联系作者获取转载授权,否则将追究法律责任
#!/bin/bash
yum install make gcc glibc glibc-common gd gd-devel openssl-devel -y
/usr/sbin/useradd nagios
tar xzf /root/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
/bin/tar -xzf /root/nrpe-2.13.tar.gz -C /root/
cd /root/nrpe-2.13
./configure
/usr/bin/make all && echo "make all succeed" || "make all failed"
/usr/bin/make install-plugin && echo "install-plugin succeed" || echo "install plugin failed"
/usr/bin/make install-daemon && echo "install-daemon succeed" || echo "install-daemon failed"
/usr/bin/make install-daemon-config && echo "install-daemon-config succeed" || echo "install-daemon-config failed"
sed -i s/allowed_hosts=127.0.0.1/allowed_hosts=127.0.0.1,172.16.10.50/g /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
echo "All the staff have been finished! Come on !"
简单的脚本文件,待更多完善。需要163镜像的yum 安装环境。在根下拷贝nagios-plugins-1.4.16.tar.gz及nrpe-2.13.tar.gz这两个文件。其他经本人在虚拟机测试可行!

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章