OnCall 告警系统

飞书告警与排班管理

仅消息模式
当前时间

20:19:10

今日值班

暂无排班

排班人员

暂无人员

加急时段

工作日 21:00-10:00

节假日全天

快速测试
排班日历
20261
周日
周一
周二
周三
周四
周五
周六
1
21:00-10:00
2
21:00-10:00
3
全天加急
4
全天加急
5
21:00-10:00
6
今天
21:00-10:00
7
21:00-10:00
8
21:00-10:00
9
21:00-10:00
10
全天加急
11
全天加急
12
21:00-10:00
13
21:00-10:00
14
21:00-10:00
15
21:00-10:00
16
21:00-10:00
17
全天加急
18
全天加急
19
21:00-10:00
20
21:00-10:00
21
21:00-10:00
22
21:00-10:00
23
21:00-10:00
24
全天加急
25
全天加急
26
21:00-10:00
27
21:00-10:00
28
21:00-10:00
29
21:00-10:00
30
21:00-10:00
31
全天加急
API 接口
POST/api/alert?content=...&mode=auto
# Query Params:
content=告警内容
mode=auto
POST/api/schedule
{
  "date": "2024-12-05",
  "userIds": ["ou_xxx"]
}
告警记录

暂无告警记录

API 接口
POST/api/alert发送告警(参数通过 URL Query 传递)

Query 参数:

content * - 告警内容(支持 Markdown,需 URL 编码)
mode - 模式:auto | message_only | urgent_now | rotation
chatId - 自定义群聊 ID
userIds - 自定义加急用户 ID 列表(逗号分隔)
urgentTypes - 加急类型(逗号分隔):app,sms,phone

模式说明:

auto自动判断是否加急,触发完整轮播流程(默认)
message_only仅发送消息,不加急
urgent_now立即加急指定用户,忽略时间规则
rotation强制触发轮播加急

轮播流程:

第一轮:
1. 今日值班人员 → 逐个加急
2. 剩余排班人员 → 逐个加急
第二轮 ~ 第N轮:
全部排班人员 → 逐个加急
直到有人已读或达到最大轮播次数

curl 示例:

# 自动模式(推荐)
curl -X POST -G "http://localhost:3000/api/alert" \
  --data-urlencode "content=服务异常"

# 仅发送消息
curl -X POST -G "http://localhost:3000/api/alert" \
  --data-urlencode "content=测试消息" \
  -d "mode=message_only"

# 立即加急
curl -X POST -G "http://localhost:3000/api/alert" \
  --data-urlencode "content=紧急!" \
  -d "mode=urgent_now" \
  -d "urgentTypes=app,phone"

# 指定用户加急
curl -X POST -G "http://localhost:3000/api/alert" \
  --data-urlencode "content=告警" \
  -d "userIds=ou_xxx,ou_yyy"
GET/api/alert获取当前状态
curl http://localhost:3000/api/alert
GET/api/alerts获取告警记录
curl http://localhost:3000/api/alerts
GET/api/users获取用户列表
curl http://localhost:3000/api/users
GET/api/schedule获取排班列表
curl http://localhost:3000/api/schedule
GET/api/timerules获取时间规则
curl http://localhost:3000/api/timerules