OpenUptime

Uptime alerts in Slack

Post a message to a Slack channel when a monitor goes down, and another when it recovers, through a Slack incoming webhook.

Set it up

  1. In Slack, go to api.slack.com/apps, create an app for your workspace and open Incoming Webhooks.
  2. Turn incoming webhooks on, choose Add New Webhook, pick the channel and copy the URL that starts with https://hooks.slack.com/services/.
  3. In OpenUptime, open Alerting, choose Add channel and pick Slack.
  4. Give the channel a name such as #ops-alerts and paste the webhook URL.
  5. Save, then press Test: a test message arrives within seconds, and the delivery log below the channels shows whether it went through.

What arrives

When a monitor goes down

🔴 Checkout API is down — Expected 200, got 503

When it recovers

✅ Checkout API has recovered

Good to know about Slack

  • Each webhook posts to one Slack channel. To alert several channels, add one OpenUptime channel per webhook.
  • The webhook URL is a credential: OpenUptime shows only its host once saved and never writes the full URL to logs.

On every channel

  • Every channel is available on every plan, Free included.
  • Choose per monitor which channels it alerts, or turn a channel on for every new monitor.
  • Until someone acknowledges an incident, it can repeat on the mobile app (up to 10 times, by email too if you choose) and escalate to other channels in up to 3 levels.
  • A failed delivery is retried, and the delivery log shows what was sent to which channel and why anything failed.

Get Slack alerts

Add a monitor, connect the channel and press Test. The Free plan includes every alert channel.

Questions

Do I need a paid Slack plan?

No. Incoming webhooks work on Slack's free plan, and the Slack channel is available on every OpenUptime plan, Free included.

Can different monitors alert different Slack channels?

Yes. Add a channel per webhook, then choose on each monitor which channels it alerts. A monitor with none chosen alerts every enabled channel.

Can I mention @here or a user group?

Not from the alert text today. Use Slack's channel notification settings so the alerts channel notifies everyone in it, or add PagerDuty or the mobile app for paging.

Slack 网站宕机告警

监控宕机时向 Slack 频道发一条消息,恢复时再发一条,通过 Slack 的 Incoming Webhook 发送。

配置步骤

  1. 在 api.slack.com/apps 为你的工作区创建一个 Slack 应用,打开 Incoming Webhooks。
  2. 开启 Incoming Webhooks,点击 Add New Webhook,选择频道,复制以 https://hooks.slack.com/services/ 开头的地址。
  3. 在 OpenUptime 中打开“告警”,点击“添加渠道”,选择 Slack。
  4. 给渠道起个名字,例如 #ops-alerts,然后粘贴 Webhook 地址。
  5. 保存后点击“测试”:几秒内就会收到一条测试消息,渠道列表下方的投递记录会显示是否发送成功。

收到的内容

监控宕机时

🔴 Checkout API is down — Expected 200, got 503

恢复时

✅ Checkout API has recovered

关于 Slack 的说明

  • 每个 Webhook 只能发到一个 Slack 频道。要通知多个频道,就为每个 Webhook 各添加一个 OpenUptime 渠道。
  • Webhook 地址相当于凭证:保存后 OpenUptime 只显示它的主机名,也不会把完整地址写进日志。

所有渠道通用

  • 所有渠道在所有套餐中都可用,包括免费版。
  • 可以为每个监控选择要通知的渠道,也可以让某个渠道默认对所有新监控开启。
  • 在有人确认事件之前,告警可以在手机 App 上重复提醒(最多 10 次,也可以选择同时发邮件),并最多分 3 级升级到其他渠道。
  • 投递失败会自动重试,投递记录会显示发到了哪个渠道、失败的原因是什么。

接收 Slack 告警

添加一个监控,连接渠道并点击“测试”。免费版包含所有告警渠道。

常见问题

需要 Slack 付费版吗?

不需要。Slack 免费版就能使用 Incoming Webhook,OpenUptime 的所有套餐(包括免费版)也都能添加 Slack 渠道。

不同的监控能发到不同的 Slack 频道吗?

可以。为每个 Webhook 添加一个渠道,然后在每个监控上选择要通知哪些渠道。没有选择任何渠道的监控会通知所有已启用的渠道。

能 @here 或者 @某个用户组吗?

目前告警正文里不能 @。可以在 Slack 的频道通知设置里让告警频道通知所有成员,或者另外添加 PagerDuty 或手机 App 来呼叫值班人员。