#告警时间段cron表达式设置(在该时间段内发送告警,其他时间不发),默认为空会持续发送,如'* * 8-20 ? * MON-FRI'表示周1到周5的8点-20点发送告警,'* * 8-20 * * ?'表示每天的8点-20点发送告警,带单引号
warnCronTime: '* * 8-20 ? * MON-FRI'
#告警时间段cron表达式设置(在该时间段内发送告警,其他时间不发),默认为空会持续发送,如'* * 8-20 ? * MON-FRI'表示周1到周5的8点-20点发送告警,'* * 8-20 * * ?'表示每天的8点-20点发送告警,带单引号
warnCronTime: '* * 8-20 * * ?'
#告警时间段cron表达式设置(在该时间段内发送告警,其他时间不发),默认为空会持续发送,如'* * 8-20 ? * MON-FRI'表示周1到周5的8点-20点发送告警,'* * 8-20 * * ?'表示每天的8点-20点发送告警,带单引号
warnCronTime: '* * 10,14,16 * * ?'
#!/bin/bash
# -*- coding: utf-8 -*-
###SCRIPT_NAME:weixin.sh###
###send message from weixin for monitoring###
###wgcloud###
time_nw=$(date -s now +%s)
time_08=$(date -s 03:00:00 +%s)
time_20=$(date -s 20:00:00 +%s)
if [[ $time_nw -le $time_08 || $time_nw -ge $time_20 ]]; then
exit 1
fi
echo "执行任务处理相关逻辑----------- $time_nw"