Add Wechat Work Group bot notification
Add the example of Wechat Wrok Group bot notification 增加企微群聊机器人通知样例
This commit is contained in:
parent
d9f61e3801
commit
3387dddd1b
@ -34,7 +34,6 @@ Refer to the example below, it is very flexible.
|
|||||||
- Notes for this method:The XXXXXX in botXXXXXX is the token provided when you follow the official @Botfather in Telegram and enter /newbot to create a new bot. (In the line after _Use this token to access the HTTP API_). The 'bot' are essential. After creating a bot, you need to talk to the BOT in Telegram (send a random message) before you can send a message by using API. YYYYYY is Telegram user's ID, you can get it by talking to the bot @userinfobot.
|
- Notes for this method:The XXXXXX in botXXXXXX is the token provided when you follow the official @Botfather in Telegram and enter /newbot to create a new bot. (In the line after _Use this token to access the HTTP API_). The 'bot' are essential. After creating a bot, you need to talk to the BOT in Telegram (send a random message) before you can send a message by using API. YYYYYY is Telegram user's ID, you can get it by talking to the bot @userinfobot.
|
||||||
|
|
||||||
- **Email notification example - Outlook, contributed by [@Cantoblanco](https://github.com/cantoblanco)**
|
- **Email notification example - Outlook, contributed by [@Cantoblanco](https://github.com/cantoblanco)**
|
||||||
|
|
||||||
- Name: MS Mail Notification
|
- Name: MS Mail Notification
|
||||||
- URL:https://graph.microsoft.com/v1.0/me/microsoft.graph.sendMail
|
- URL:https://graph.microsoft.com/v1.0/me/microsoft.graph.sendMail
|
||||||
- Request method: POST
|
- Request method: POST
|
||||||
@ -63,6 +62,57 @@ Refer to the example below, it is very flexible.
|
|||||||
|
|
||||||
- Notes for this method: This method requires calling Microsoft Graph V1.0, you need to go to Microsoft Graph and create your own application, give `Mail.Send` permission and get the Token, or you can go [Microsoft Graph Explorer](https://developer.microsoft.com/en-us/graph/graph-explorer) directly to give permission and get the Token, just replace the Token in the Header with the actual Token.
|
- Notes for this method: This method requires calling Microsoft Graph V1.0, you need to go to Microsoft Graph and create your own application, give `Mail.Send` permission and get the Token, or you can go [Microsoft Graph Explorer](https://developer.microsoft.com/en-us/graph/graph-explorer) directly to give permission and get the Token, just replace the Token in the Header with the actual Token.
|
||||||
|
|
||||||
|
- **Wechat Work Group bot Example, contributed by [@ChowRex](https://github.com/ChowRex)**
|
||||||
|
|
||||||
|
Support placeholders:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"content": "#NEZHA#",
|
||||||
|
"ServerName": "#SERVER.NAME#",
|
||||||
|
"ServerIP": "#SERVER.IP#",
|
||||||
|
"ServerIPV4": "#SERVER.IPV4#",
|
||||||
|
"ServerIPV6": "#SERVER.IPV6#",
|
||||||
|
"CPU": "#SERVER.CPU#",
|
||||||
|
"MEM": "#SERVER.MEM#",
|
||||||
|
"SWAP": "#SERVER.SWAP#",
|
||||||
|
"DISK": "#SERVER.DISK#",
|
||||||
|
"NetInSpeed": "#SERVER.NETINSPEED#",
|
||||||
|
"NetOutSpeed": "#SERVER.NETOUTSPEED#",
|
||||||
|
"TransferIn": "#SERVER.TRANSFERIN#",
|
||||||
|
"TranferOut": "#SERVER.TRANSFEROUT#",
|
||||||
|
"Load1": "#SERVER.LOAD1#",
|
||||||
|
"Load5": "#SERVER.LOAD5#",
|
||||||
|
"Load15": "#SERVER.LOAD15#",
|
||||||
|
"TCP_CONN_COUNT": "#SERVER.TCPCONNCOUNT", # Invalid
|
||||||
|
"UDP_CONN_COUNT": "#SERVER.UDPCONNCOUNT", # Invalid
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
> Sorry, this document is **NOT** available in English.
|
||||||
|
>
|
||||||
|
> [群机器人配置说明 - 文档 - 企业微信开发者中心](https://developer.work.weixin.qq.com/document/path/91770#markdown%E7%B1%BB%E5%9E%8B)
|
||||||
|
|
||||||
|
- Name:WechatWork Group bot notification
|
||||||
|
|
||||||
|
- URL:https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=YOUR_BOT_KEY
|
||||||
|
|
||||||
|
- Request method: POST
|
||||||
|
|
||||||
|
- Request type: JSON
|
||||||
|
|
||||||
|
- Body:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"msgtype": "markdown",
|
||||||
|
"markdown": {
|
||||||
|
"content": "# Nezha Notification\n\n\"#NEZHA#\"\n\n> ServerName: \"#SERVER.NAME#\"\n> IP: \"#SERVER.IP#\"\n> IPv4: \"#SERVER.IPV4#\"\n> IPv6: \"#SERVER.IPV6#\"\n> CPU: \"#SERVER.CPU#\"\n> Memory: \"#SERVER.MEM#\"\n> SWAP: \"#SERVER.SWAP#\"\n> Storage: \"#SERVER.DISK#\"\n> Real-time Upload: \"#SERVER.NETINSPEED#\"\n> Real-time Download: \"#SERVER.NETOUTSPEED#\"\n> Total Upload: \"#SERVER.TRANSFERIN#\"\n> Total Download: \"#SERVER.TRANSFEROUT#\"\n> 1m Load: \"#SERVER.LOAD1#\"\n> 5m Load: \"#SERVER.LOAD5#\"\n> 15m Load: \"#SERVER.LOAD15#\"\n> TCP Connections: \"#SERVER.TCPCONNCOUNT\"\n> UDP Connections: \"#SERVER.UDPCONNCOUNT\"\n\n"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Delete relevant content information as needed
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
|
@ -49,7 +49,7 @@ URL 里面也可放置占位符,请求时会进行简单的字符串替换。
|
|||||||
- URL 参数获取说明:botXXXXXX 中的 XXXXXX 是在 telegram 中关注官方 @Botfather ,输入/newbot ,创建新的机器人(bot)时,会提供的 token(在提示 Use this token to access the HTTP API:后面一行)这里 'bot' 三个字母不可少。创建 bot 后,需要先在 telegram 中与 BOT 进行对话(随便发个消息),然后才可用 API 发送消息。YYYYYY 是 telegram 用户的数字 ID。与机器人@userinfobot 对话可获得。
|
- URL 参数获取说明:botXXXXXX 中的 XXXXXX 是在 telegram 中关注官方 @Botfather ,输入/newbot ,创建新的机器人(bot)时,会提供的 token(在提示 Use this token to access the HTTP API:后面一行)这里 'bot' 三个字母不可少。创建 bot 后,需要先在 telegram 中与 BOT 进行对话(随便发个消息),然后才可用 API 发送消息。YYYYYY 是 telegram 用户的数字 ID。与机器人@userinfobot 对话可获得。
|
||||||
|
|
||||||
- **邮件通知示例 - SendCloud 贡献者:[@白歌](https://github.com/cantoblanco)**
|
- **邮件通知示例 - SendCloud 贡献者:[@白歌](https://github.com/cantoblanco)**
|
||||||
**注意:SendCloud 有每日免费发送邮件限额限制,这里仅作示例,你可以选择付费服务或其他类似的免费服务,使用方法类似。**
|
**注意:SendCloud 有每日免费发送邮件限额限制,这里仅作示例,你可以选择付费服务或其他类似的免费服务,使用方法类似。**
|
||||||
|
|
||||||
- 名称:邮件告警
|
- 名称:邮件告警
|
||||||
- URL:https://api.sendcloud.net/apiv2/mail/send?apiUser=<替换APIUSER>apiKey=<替换APIKEY>&from=<自定义发件邮箱>&fromName=Nezha&to=<自定义收件邮箱>&subject=Nezha-Notification&html=#NEZHA#
|
- URL:https://api.sendcloud.net/apiv2/mail/send?apiUser=<替换APIUSER>apiKey=<替换APIKEY>&from=<自定义发件邮箱>&fromName=Nezha&to=<自定义收件邮箱>&subject=Nezha-Notification&html=#NEZHA#
|
||||||
@ -57,8 +57,59 @@ URL 里面也可放置占位符,请求时会进行简单的字符串替换。
|
|||||||
- 请求类型: JSON
|
- 请求类型: JSON
|
||||||
- Header: 留空
|
- Header: 留空
|
||||||
- Body: 留空
|
- Body: 留空
|
||||||
|
|
||||||
- URL 参数获取说明:此方式需提前在 [SendCloud](https://www.sendcloud.net/) 注册账号,创建发件邮箱,然后在[这里](https://www.sendcloud.net/sendSetting/apiuser)获取 APIUSER 和 APIKEY,替换 URL 中的 <替换APIUSER> 和 <替换APIKEY> 为自己的 APIUSER 和 APIKEY,替换 URL 中的 <自定义发件邮箱> 和 <自定义收件邮箱> 为自己的发件邮箱和收件邮箱。
|
- URL 参数获取说明:此方式需提前在 [SendCloud](https://www.sendcloud.net/) 注册账号,创建发件邮箱,然后在[这里](https://www.sendcloud.net/sendSetting/apiuser)获取 APIUSER 和 APIKEY,替换 URL 中的 <替换APIUSER> 和 <替换APIKEY> 为自己的 APIUSER 和 APIKEY,替换 URL 中的 <自定义发件邮箱> 和 <自定义收件邮箱> 为自己的发件邮箱和收件邮箱。
|
||||||
|
|
||||||
|
- **企业微信 群机器人 示例 贡献者:[@ChowRex](https://github.com/ChowRex)**
|
||||||
|
|
||||||
|
支持的占位符一览
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"content": "#NEZHA#",
|
||||||
|
"ServerName": "#SERVER.NAME#",
|
||||||
|
"ServerIP": "#SERVER.IP#",
|
||||||
|
"ServerIPV4": "#SERVER.IPV4#",
|
||||||
|
"ServerIPV6": "#SERVER.IPV6#",
|
||||||
|
"CPU": "#SERVER.CPU#",
|
||||||
|
"MEM": "#SERVER.MEM#",
|
||||||
|
"SWAP": "#SERVER.SWAP#",
|
||||||
|
"DISK": "#SERVER.DISK#",
|
||||||
|
"NetInSpeed": "#SERVER.NETINSPEED#",
|
||||||
|
"NetOutSpeed": "#SERVER.NETOUTSPEED#",
|
||||||
|
"TransferIn": "#SERVER.TRANSFERIN#",
|
||||||
|
"TranferOut": "#SERVER.TRANSFEROUT#",
|
||||||
|
"Load1": "#SERVER.LOAD1#",
|
||||||
|
"Load5": "#SERVER.LOAD5#",
|
||||||
|
"Load15": "#SERVER.LOAD15#",
|
||||||
|
"TCP_CONN_COUNT": "#SERVER.TCPCONNCOUNT", # 无效
|
||||||
|
"UDP_CONN_COUNT": "#SERVER.UDPCONNCOUNT", # 无效
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
> [群机器人配置说明 - 文档 - 企业微信开发者中心](https://developer.work.weixin.qq.com/document/path/91770#markdown%E7%B1%BB%E5%9E%8B)
|
||||||
|
|
||||||
|
- 名称:企业微信群机器人
|
||||||
|
|
||||||
|
- URL:https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=YOUR_BOT_KEY
|
||||||
|
|
||||||
|
- 请求方式: POST
|
||||||
|
|
||||||
|
- 请求类型: JSON
|
||||||
|
|
||||||
|
- Body:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"msgtype": "markdown",
|
||||||
|
"markdown": {
|
||||||
|
"content": "# 哪吒通知消息\n\n\"#NEZHA#\"\n\n> 名称: \"#SERVER.NAME#\"\n> IP: \"#SERVER.IP#\"\n> IPv4: \"#SERVER.IPV4#\"\n> IPv6: \"#SERVER.IPV6#\"\n> CPU: \"#SERVER.CPU#\"\n> 内存: \"#SERVER.MEM#\"\n> 交换分区: \"#SERVER.SWAP#\"\n> 存储: \"#SERVER.DISK#\"\n> 实时上传速度: \"#SERVER.NETINSPEED#\"\n> 实时下载速度: \"#SERVER.NETOUTSPEED#\"\n> 总上传: \"#SERVER.TRANSFERIN#\"\n> 总下载: \"#SERVER.TRANSFEROUT#\"\n> 1分钟内负载: \"#SERVER.LOAD1#\"\n> 5分钟内负载: \"#SERVER.LOAD5#\"\n> 15分钟内负载: \"#SERVER.LOAD15#\"\n> TCP连接数: \"#SERVER.TCPCONNCOUNT\"\n> UDP连接数: \"#SERVER.UDPCONNCOUNT\"\n\n"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
根据需求删减相关内容信息即可
|
||||||
|
|
||||||
|
|
||||||
<br/>
|
<br/>
|
||||||
<br/>
|
<br/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user