您现在的位置是:网站首页> 编程资料编程资料
nagios 分发文件实现代码_linux shell_
2023-05-26
324人已围观
简介 nagios 分发文件实现代码_linux shell_
Nagios是一款开源的免费网络监视工具,能有效监控Windows、Linux和Unix的主机状态,交换机路由器等网络设置,打印机等。在系统或服务状态异常时发出邮件或短信报警第一时间通知网站运维人员,在状态恢复后发出正常的邮件或短信通知。
#!/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
相关内容
- 一键备份gitolite服务器的Shell脚本_linux shell_
- Shell中取今天、昨天、前天的时间操作代码_linux shell_
- Shell脚本判断Apache进程是否存在_linux shell_
- Shell脚本监控网站页面正常打开情况_linux shell_
- shell中使用echo打印彩色字体和彩色背景的方法_linux shell_
- Shell脚本实现温和方式重启Centos系统_linux shell_
- Shell脚本判断Linux系统是32位还是64位的几种方法分享_linux shell_
- Shell脚本中调用、引用、包含另外一个脚本文件的两种方法_linux shell_
- shell脚本实现批量测试局域网主机是否在线_linux shell_
- shell脚本实现文件锁功能_linux shell_
