{ALERT.SENDTO}
{ALERT.SUBJECT}
{ALERT.MESSAGE}
dingding:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
#!/bin/bash # Author:Byrd # Version:0.1 # Site:note.t4x.org # Contact:root#t4x.org export LANG=en_US.UTF-8 LOGFILE="//usr/local/zabbix/share/zabbix/alertscripts/alert.log" :>"$LOGFILE" exec 1>"$LOGFILE" exec 2>&1 CURL="/usr/bin/curl" to=$1 subject=`echo $2 | tr '\r\n' '\n'` body=`echo $3 | tr '\r\n' '\n'` ${CURL} 'https://oapi.dingtalk.com/robot/send?access_token=9b95195c3a4efe24dd3eb4030a9a39eb841881253bc6a0b1d2b3e8e6074bc945' \ -H 'Content-Type: application/json' \ -d """ { \"msgtype\": \"markdown\", \"markdown\": { \"title\":\"${subject}\", \"text\": \"${body}\" }, }""" |
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!