钉钉报警的使用

钉钉报警

  • 1.代码报警
  • 2.钉钉sdk'
  • 3.发送消息
    • 1.curl
    • 2.脚本
    • #执行报警 java -cp /home/hadoop/project/ding/dingding.jar \ com.chinasoft.dingding.RobotEaring \ " t o k e n " " {token}" " token""{programe}" " c o n t e n t " " {content}" " content""{ip}" "${phones}"

1.代码报警

2.钉钉sdk’

3.发送消息

1.curl

2.脚本

1.代码(待编写)
官网:接入指南:自定义机器人:自定义机器人接入
2.钉钉sdk’ =》jar包
1.maven命令 jar包
2.maven


com.aliyun
dingtalk
1.3.74

3.创建机器后 保存Webhook地址(身份证)
4.
1.curl
1.访问 url
2.下载
2.wget =》下载安装包
3.发送消息
1.curl
curl 'https://oapi.dingtalk.com/robot/send?access_token=Webhook
-H ‘Content-Type: application/json’
-d ‘{“msgtype”: “text”,“text”: {“content”:“报警我就是我, 是不一样的烟火”}}’
2.脚本
1.
./ding_warning.sh
./ding_warning.sh “阿珍” “爱上阿强” “今晚再说” “执行机器名” “电话号”

 vim ding_warning.sh
 -------------------------------------------------------
 
 if [ $# != 5 ];then
echo "usage:dingding warning"
echo "eg. $0     "
exit;
 fi

token=“”
case $1 in
“小红”)
token=“小红Webhook”
;;
“小强”)
token=“阿强Webhook”
;;
“阿珍”)
token=“阿珍Webhook”
;;
*)
echo “没有匹配的机器人”
exit
;;
esac

programe=“$2”
content=“$3”
ip=$4
phones=“$5”

#执行报警
java -cp /home/hadoop/project/ding/dingding.jar
com.chinasoft.dingding.RobotEaring
t o k e n " " {token}" " token""{programe}” “ c o n t e n t " " {content}" " content""{ip}” “${phones}”

你可能感兴趣的:(钉钉)