shell钉钉发送告警

 

#!/bin/bash

##使用方法
##senddingd.sh 手机号码 发送内容
function sendalert()
{
 #curl 请求 将access_token换成自己的
 curl -H "Content-type: application/json" -X POST -d '{"msgtype": "text","text": {"content": "'$2'"}, "at": {"atMobiles": ["'$1'"], "isAtAll": false}}' https://oapi.dingtalk.com/robot/send?access_token=b4f5564da76eeeeb9e0ec32d71df9c6500bdba5ddc9701024110dcd4fc731a59e92
}


sendalert $1 $2
exit 0

 

posted @ 2019-11-27 08:59  slnngk  阅读(440)  评论(0编辑  收藏  举报