Tallwatch
Back to blog
8 min read
AlertingGuide

How to get Slack alerts when your website goes down

Set up Slack downtime alerts in about five minutes with an incoming webhook, then make them worth reading: one channel, confirmed outages only, and a backup for when Slack is muted.

NK

Nabin Khair

Founder

How to get Slack alerts when your website goes down

Short answer: yes, you can get a Slack message the moment your website goes down. You need an uptime monitor that checks your site from the outside, and a Slack incoming webhook for it to post to. Setup takes about five minutes.

The longer answer is about what happens after week one. Most Slack alert channels start useful and end up muted, because they fill with alerts that did not need anyone. This guide covers the setup and the few choices that keep the channel worth reading.

What you need

  • An uptime monitor. Something outside your own infrastructure that requests your site on a schedule and notices when it fails. A monitor running on the same server as your site goes down with it.
  • A Slack channel you are allowed to add apps to.
  • A Slack incoming webhook. A private URL that lets another service post messages into one channel.

Step 1: Create a dedicated channel

Create a channel like #incidents or #alerts-prod. Do not use #general or a team chat channel.

A separate channel gives you three things:

  • Alerts are not buried under conversation.
  • People can set notifications for that one channel to "all messages" without getting pinged for everything else.
  • The channel becomes a timeline you can scroll back through after an outage.

Put the name of whoever is on call in the channel topic. "Who is looking at this?" is the first question in every incident, and the topic answers it.

Step 2: Create a Slack incoming webhook

  1. Go to api.slack.com/apps and choose Create New App, then From scratch.
  2. Name it something obvious, like "Uptime alerts", and pick your workspace.
  3. Open Incoming Webhooks in the app settings and switch it on.
  4. Click Add New Webhook to Workspace and choose the channel from step 1.
  5. Copy the webhook URL. It starts with https://hooks.slack.com/services/.

Treat that URL like a password. Anyone who has it can post to your channel. Do not paste it into a public repo or a shared doc.

Step 3: Connect the webhook to your uptime monitor

Every monitoring tool has a place for this, usually called channels, integrations, or alert contacts. In Tallwatch it looks like this:

  1. Open Settings → Channels.
  2. Add Slack and paste the webhook URL.
  3. Save, then click Send test.
  4. Check that the test message shows up in your Slack channel.

If the test does not arrive, the URL was probably copied incompletely, or the app was not added to that channel. Fix it now rather than finding out during a real outage.

Step 4: Add the monitors that matter

An alert is only as good as the check behind it. Start with the pages and endpoints a customer would notice first:

  • The homepage or marketing site. The first thing people try when something seems wrong.
  • Login. If people cannot sign in, the rest of the product does not matter.
  • Your main API or health endpoint. See how to design a health check endpoint for what it should and should not test.
  • Checkout or billing, if you take payments.

Some failures return 200 OK with a broken page, such as an error message rendered inside your normal layout. A keyword check catches those by looking for text that should always be there. For a fuller list, see what you should monitor on a SaaS.

Step 5: Test with a real failure

A test message proves Slack is connected. It does not prove you will get an alert when your site breaks.

Create a temporary monitor that is guaranteed to fail, such as a URL on your domain that returns 404, or a keyword check for a word that is not on the page. Wait for the alert to land in Slack, acknowledge it, then delete the monitor. Now you have seen the whole path work. We go deeper in how to test your alerting.

Make the alerts worth reading

Setup is the easy part. These are the choices that decide whether people still read the channel in a month.

Only alert on confirmed outages

The biggest source of junk Slack alerts is a single check location having a bad minute. The probe's network hiccups, your site is fine, and the channel gets "DOWN" followed by "UP" two minutes later. After a few of those, people stop looking.

Checking from several regions and alerting only when they agree removes that whole class of false alarm. That is how multi-region monitoring works, and it is what Tallwatch does on every plan. Whatever tool you use, look for a setting that requires more than one failed check or more than one location before alerting. More options are in how to cut false downtime alerts.

Consider a short delay

Many real outages last under two minutes. A deploy restarts servers, or a database fails over. By the time anyone reads the alert, the site is back. A one-to-three-minute delay before alerting keeps those blips out of Slack without hiding outages that need a person. The tradeoffs are in should you delay downtime alerts?

One message per event, not per check

Your channel should get a message when an incident opens, when someone acknowledges it, and when it resolves. It should not get a message every time a check runs while the site is still down. If your tool repeats the same alert every minute, look for a setting to send it once. In Tallwatch, the same open event is not sent twice to the same channel.

Acknowledge where the alert lands

When someone takes an incident, everyone else should see it in the channel. In Tallwatch, the message for a new incident includes an Acknowledge button, so the person picking it up can claim it without leaving Slack. If your tool does not support that, agree on a habit, such as replying "on it" in a thread.

Slack is not enough at 3am

Slack is a great place for alerts during working hours. At night it is easy to miss. Phones are on Do Not Disturb, Slack notifications get batched, and a channel set to "mentions only" will not buzz at all.

So treat Slack as the first step, not the only one. An escalation policy does this for you:

  1. Step 1: Post to #incidents in Slack as soon as the outage is confirmed.
  2. Step 2: If nobody acknowledges within 5 to 15 minutes, notify the on-call person directly through a channel that gets through, such as email to an address with sound alerts, or Telegram.
  3. Step 3: If there is still no acknowledgement, notify a second person.

Acknowledging at any point stops the later steps. For which channels actually wake people up, see which alert channel wakes you at 3am. If you are setting up a rotation for the first time, start with how to set up an on-call rotation.

The do-it-yourself version, and where it breaks

You can get basic Slack downtime alerts with a cron job and a few lines of shell:

#!/usr/bin/env bash
# Run every minute from cron. Posts to Slack when the site does not return 200.
URL="https://example.com"
WEBHOOK="https://hooks.slack.com/services/XXX/YYY/ZZZ"

status=$(curl -s -o /dev/null -w "%{http_code}" --max-time 10 "$URL")

if [ "$status" != "200" ]; then
  curl -s -X POST -H "Content-type: application/json" \
    --data "{\"text\":\"$URL is failing (HTTP $status)\"}" \
    "$WEBHOOK"
fi

It works, and it is a fine way to see how the pieces fit. It also has the problems this guide warns about:

  • It checks from one place. If that machine's network has a bad minute, you get a false alarm. If the machine dies, you get silence, and silence looks exactly like "everything is fine."
  • It repeats every minute for as long as the site is down, because it has no memory of the last alert.
  • It never says the site recovered, and nobody can acknowledge anything.
  • A timeout reports as status 000, which is easy to misread.

You can fix each of these with more code. At that point you are building and maintaining an uptime monitor, and you also need something to monitor the monitor.

Common problems

No messages arrive. Send a test from your monitoring tool. If it fails, check whether the channel was archived, the Slack app was removed, or the webhook URL was regenerated. Any of those quietly breaks the old URL.

Too many messages. Look for checks from a single location, no confirmation before alerting, or a monitor that keeps flipping between down and up. A flipping monitor usually means a timeout set too close to normal response times, or one unhealthy server behind a load balancer.

The webhook URL leaked. Remove the webhook in your Slack app settings, create a new one, and update your monitoring tool. The old URL stops working right away.

Set it up in five minutes

Tallwatch includes Slack alerts on the free plan. Every incident is confirmed from multiple regions before anything is posted, and there is an Acknowledge button on new incidents. Add your webhook, send a test, and you will know the next time your site is really down, without the false alarms.

Related

Keep reading

False alerts and status pages.

Should you delay downtime alerts? Blips, flapping, and the two-minute rule

Should you delay downtime alerts? Blips, flapping, and the two-minute rule

Instant alerts sound safer, but most short outages fix themselves before anyone can act. How to choose an alert delay, handle flapping monitors, and stop down/up email pairs.

NKNabin Khair
What changed after we stopped paging on warnings

What changed after we stopped paging on warnings

Warning-level pages feel responsible until nobody sleeps. Moving warnings to daytime channels restored trust in the alerts that still wake people.

NKNabin Khair
How to cut false downtime alerts without waiting forever to get paged

How to cut false downtime alerts without waiting forever to get paged

You should not have to choose between a quiet pager and a slow one. Confirmation — across time or across regions — is how you keep both.

NKNabin Khair