nagios分发文件

2015-01-05 0 474
nagios分发文件
#!/bin/bash
#!/usr/bin/expect -f
#!/usr/bin/env bash
for((i=101;i<=177;i++))
do
#cmd="wget http://172.16.92.99/scripts/nagios_client_install.sh && chmod 777  nagios_client_install.sh && sh nagios_client_install.sh"
line="192.168.89.$i"
cmd1="/etc/init.d/xinetd restart"
cmd2="ssh root@$line"
cmd3="scp -r ./nagios/libexec   $line:/usr/local/nagios"
cmd4="scp ./nagios/nrpe.cfg   $line:/usr/local/nagios/etc/"
expect -c "#set timeout 20;
#spawn $cmd4;
set timeout 200;
spawn $cmd3;
set timeout 20;
#spawn $cmd2;
set timeout 1200;
#expect "*@*";send \"$cmd1\r exit\r\";;
expect eof;"
if [ $i -eq 145 ]
        then
        i=151
fi
done

遇见资源网 shell nagios分发文件 http://www.ox520.com/16777.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务