Spaces & devices

UniFi internet outage alerts in Slack

Network outage automation checks each site’s UniFi network from outside the building, so it still works when the site’s own internet is down. It tells the person on call in Slack what has failed and confirms when the connection returns.

An example of how the studio would build it. No live services are connected.

From a dropped connection to someone already on it.

  1. Step 01

    Status polled

    Every few minutes, a Cloudflare Worker checks each site’s UniFi console and devices through UniFi’s Site Manager API.

  2. Step 02

    Outage confirmed

    If a site stays offline across several checks in a row, treat it as an outage rather than a blip.

  3. Step 03

    Fault identified

    Tell a lost internet connection apart from a single access point or switch going offline, using the device status UniFi reports.

  4. Step 04

    On-call told

    Message the person on call in Slack, which they can read on mobile data, with the site and what is known.

  5. Step 05

    Recovery confirmed

    When the site reports in again, post that it is back and how long it was out.

The result

Card machines and bookings are back online sooner.

Each outage raises one alert and one recovery message, however long it lasts. The workflow only reports: any change to the network is made by a person.

Before we connect it.

Where this is useful

Useful for shops, cafés, clinics and gyms that rely on Wi-Fi for card machines, bookings and phones, and often hear about outages from customers first. A sensible first version covers the internet connection at one site, then adds individual access points and more sites.

What we need to connect

  1. 01UniFi consoles linked to a UI account, with an API key for UniFi’s Site Manager API.
  2. 02A Cloudflare account to run the small watcher on a schedule, and a Slack channel or person to alert.
  3. 03Who is on call for each site, how long an outage must last before anyone is told and any planned maintenance windows.

What needs careful handling

A brief drop can recover on its own, so the watcher waits for several failed checks before alerting and ignores planned maintenance. If the internet provider has a wider outage, the alert says that the site is unreachable rather than guessing the cause. Staff phones may rely on the same Wi-Fi, so alerts go to someone who can see Slack on mobile data, with a text message as a backup where it matters.

Questions people ask.

Doesn’t the UniFi app already send alerts?

Yes. The UniFi app can send push notifications when devices go offline, and that may be enough for a single site. This helps when alerts need to reach whoever is on call, cover several sites or include a clear recovery message.

Can it switch to a backup connection?

UniFi gateways can fail over to a second connection, such as a mobile data backup, where one is set up. The workflow reports when that happens, so you know the backup is in use and the main line needs attention.

All automation examples