nagios分发文件

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#!/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