xxxxxxxxxx
#通知脚本绝对路径(若配置脚本,无论是否配置过邮件,都会执行该脚本),可以为空,参考模板:template/sendMsg.sh
warnScript: bash /home/sendMsg.sh
#是否将通知内容转为unicode(针对通知脚本生效),yes是,no否,钉钉微信等通知建议设置为yes,windows部署server需设置为yes,否则接受到会是乱码
warnToUnicode: yes
content=$1
content=${content//\ /}
time3=$(date "+%H:%M:%S")
content="$time3,$content"
echo "warn content is : $content"
webhook='https://oapi.dingtalk.com/robot/send?access_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
function SendMsgToDingding() {
curl $webhook -H 'Content-Type: application/json' -d "
{
'msgtype': 'text',
'text': {
'content': '资产设备系统WGFIX提醒:$1'
},
'at': {
'isAtAll': true
}
}"
}
SendMsgToDingding $content