批量删除nagios的停机计划
当我们误操作,批量设置了主机和服务的计划维护时间,如何批量删除呢?下面通过一个脚本轻松搞定~~~
#!/bin/bash
#eg: # ./Del_downtime.sh 877 885 hosts # 删除System--Downtime下的维护计划中Scheduled Host Downtime从877到885项设置
# ./Del_downtime.sh 886 894 services # 删除System--Downtime下的维护计划中Scheduled Service Downtime从886到894项设置
if [ $3 == "hosts" ];then
for((i=$1;i<=$2;i++));do echo "\[`date +%s`\] DEL_HOST_DOWNTIME;$i" >> /usr/local/nagios/var/rw/nagios.cmd;done
elif [ $3 == services ];then
for((i=$1;i<=$2;i++));do echo "\[`date +%s`\] DEL_SVC_DOWNTIME;$i" >> /usr/local/nagios/var/rw/nagios.cmd;done
else
echo "Input error...."
fi
分享题目:批量删除nagios的停机计划
当前路径:http://myzitong.com/article/gosdgg.html