当我们误操作,批量设置了主机和服务的计划维护时间,如何批量删除呢?下面通过一个脚本轻松搞定~~~
#!/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
售后响应及时
7×24小时客服热线数据备份
更安全、更高效、更稳定价格公道精准
项目经理精准报价不弄虚作假合作无风险
重合同讲信誉,无效全额退款