From 4ca52c6e6975bf666fd200d31eeb96740cf3bfe9 Mon Sep 17 00:00:00 2001 From: MIKU_N <61493780+MIKU-N@users.noreply.github.com> Date: Thu, 21 Jul 2022 12:13:34 +0800 Subject: [PATCH] Update notifications.md --- docs/guide/notifications.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/docs/guide/notifications.md b/docs/guide/notifications.md index 177f1f82..e2031d60 100644 --- a/docs/guide/notifications.md +++ b/docs/guide/notifications.md @@ -35,6 +35,34 @@ URL 里面也可放置占位符,请求时会进行简单的字符串替换。 - Body: 空 - 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 对话可获得。 + - Outlook 示例 + + - 名称:MS邮件告警 + - URL:https://graph.microsoft.com/v1.0/me/microsoft.graph.sendMail + - 请求方式: POST + - 请求类型: JSON + - Header: `{"Content-type":"application/json", + "Authorization":"Bearer {Token}"}` + - Body: + `{ + "message": { + "subject": "服务器状态警报", + "body": { + "contentType": "Text", + "content": "#NEZHA#" + }, + "toRecipients": [ + { + "emailAddress": { + "address": "接收邮件地址" + } + } + ] + } +}` + - URL 参数获取说明:此方式调用Microsoft Graph V1.0,需要前往Microsoft Graph自行创建应用程序并授予`Mail.Send`权限并获取Token;或者你可以使用[Microsoft Graph Explorer](https://developer.microsoft.com/zh-cn/graph/graph-explorer)直接授予权限并获取Token。将Header中的Token字段替换为实际字符段即可。 + +

@@ -92,4 +120,4 @@ URL 里面也可放置占位符,请求时会进行简单的字符串替换。 - min/max、cover、ignore 参考基本规则配置 示例: ID 为 3 和 4 的服务器(ignore 里面定义),以每月 1 号为统计周期,周期内统计的出站月流量达到 1TB 时报警 `[{"type":"transfer_out_cycle","max":1099511627776,"cycle_start":"2022-01-01T00:00:00+08:00","cycle_interval":1,"cycle_unit":"month","cover":1,"ignore":{"3":true,"4":true}}]` - ![7QKaUx.md.png](https://s4.ax1x.com/2022/01/13/7QKaUx.md.png) \ No newline at end of file + ![7QKaUx.md.png](https://s4.ax1x.com/2022/01/13/7QKaUx.md.png)