[客户端]批量部署监控客户端,多机分发
环境:CENTOS 5.5 x64
IP:10.0.0.12
====================
# for cacti
yum install net-snmp -y
配置/etc/snmp/snmpd.conf
/etc/init.d/snmpd start
echo "/etc/init.d/snmpd start" >>/etc/rc.local
################################################
#for nagios
#创建nagios需要的用户及组
/usr/sbin/adduser nagios -M
cd /root/tools
wget http://cdnetworks-kr-2.dl.sourceforge.net/project/nagiosplug/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz
tar zxvf nagios-plugins-1.4.15.tar.gz
cd nagios-plugins-1.4.15
./configure --prefix=/elain/apps/nagios --with-nagios-user=nagios --with-nagios-group=nagios --enable-perl-modules
--enable-redhat-pthread-workaround
make
make install
cd ..
wget http://cdnetworks-kr-2.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.12/nrpe-2.12.tar.gz
tar zxvf nrpe-2.12.tar.gz
cd nrpe-2.12
./configure --prefix=/elain/apps/nagios --with-nrpe-user=nagios --with-nrpe-group=nagios --with-nagios-user=nagios --with-nagios-group=nagios --enable-ssl --with-ssl-lib
make
make install
make install-xinetd
make install-daemon-config
cd ..
vi /elain/apps/nagios/etc/nrpe.cfg
修改:
allowed_hosts=127.0.0.1,10.0.0.0/24
chown -R nagios.nagios /elain/apps/nagios
/elain/apps/nagios/bin/nrpe -c /elain/apps/nagios/etc/nrpe.cfg -d
echo "/elain/apps/nagios/bin/nrpe -c /elain/apps/nagios/etc/nrpe.cfg -d" >>/etc/rc.local
#重启nagios nrpe组合命令
pkill nrpe && /elain/apps/nagios/bin/nrpe -c /elain/apps/nagios/etc/nrpe.cfg -d
cd /elain/apps
tar zcvf nagios.tar.gz nagios/
mv nagios.tar.gz /root/bak
cd
多机分发,快速部署
在IP为25上,分发到IP 为28上,其它服务器依次类推
scp /root/bak/nagios.tar.gz 10.0.0.28:/elain/apps/
scp /etc/snmp/snmpd.conf 10.0.0.28:/etc/snmp/snmpd.conf.ok
#登录到28上,若做了批量远程执行命令,刚无需登录此服务器,
ssh 10.0.0.28
/usr/sbin/adduser nagios -M
cd /elain/apps
tar zxvf nagios.tar.gz
rm -rf nagios.tar.gz
/elain/apps/nagios/bin/nrpe -c /elain/apps/nagios/etc/nrpe.cfg -d
echo "/elain/apps/nagios/bin/nrpe -c /elain/apps/nagios/etc/nrpe.cfg -d" >>/etc/rc.local
# for cacti
yum install net-snmp -y
mv /etc/snmp/snmpd.conf.ok /etc/snmp/snmpd.conf
/etc/init.d/snmpd start
echo "/etc/init.d/snmpd start" >>/etc/rc.local
在这里只是提供给大家一个思路,欢迎大家一起交流敏捷运维!
[客户端]批量部署监控客户端,多机分发
原创
©著作权归作者所有:来自51CTO博客作者elain2012的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
【Redis客户端】客户端
Redis客户端
网络 服务器 运维 客户端 套接字 -
ansible 批量部署zabbix客户端
运用ansible 批量部署zabbix_agentd
zabbix ansible -
zabbix 监控客户端数据库 zabbix客户端
(A)
mysql zabbix 客户端 绝对路径