Developer alerts

Website down alert on your LED matrix

A check every 5 minutes. Red until it's back, then one green "back up".

A down alert you can't miss: the matrix turns red when your site stops answering and stays red until it answers again. It only sends a message when the state changes, so a long outage isn't ten messages a minute.

What your matrix shows

example.com DOWN

Text with the "fireworks" border. Illustration; the real effect is animated.

What you need

  • An always-on Linux or macOS machine (a server, a Raspberry Pi, a NAS) with the pipplee helper.
  • Your Authorization value from the setup guide (about 5 minutes).

Set it up

1. Save the check

Save this as ~/site-check.sh, change URL, and make it executable with chmod +x ~/site-check.sh.

#!/bin/sh
URL="https://example.com"
NAME="example.com"
STATE="$HOME/.config/pipplee/down-$NAME"

if curl -fsS -o /dev/null --max-time 15 "$URL"; then
  if [ -f "$STATE" ]; then
    rm "$STATE"
    "$HOME/.local/bin/pipplee" "$NAME is back up" 51cf66 "" 60
  fi
else
  if [ ! -f "$STATE" ]; then
    touch "$STATE"
    "$HOME/.local/bin/pipplee" "$NAME DOWN" ff6b6b fireworks 0
  fi
fi

2. Run it every 5 minutes

Run crontab -e and add this line.

*/5 * * * * $HOME/site-check.sh

How it works

  • curl -f fails on no answer, a timeout after 15 seconds, or an HTTP error such as 500 or 404.
  • The first failed check sends a red message with duration 0, so it stays on the matrix.
  • The first good check after that sends "back up" in green, which replaces the red one.

Variations

No server? Use GitHub Actions

A scheduled workflow can run the same check. GitHub may start scheduled runs a few minutes late, and it doesn't remember state, so this one reports every failed check.

name: Site check
on:
  schedule:
    - cron: "*/10 * * * *"
jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - env:
          PIPPLEE_AUTH: ${{ secrets.PIPPLEE_AUTH }}
        run: |
          curl -fsS -o /dev/null --max-time 15 https://example.com && exit 0
          curl -sS -X POST https://pipplee.com/api/v1/public/devices/text \
            -H "Authorization: $PIPPLEE_AUTH" \
            -H "Content-Type: application/json" \
            -d '{"text": "example.com DOWN", "font_color": "ff6b6b", "border": "fireworks", "duration": 600}'

Already use an uptime monitor?

If it can send a webhook with your own JSON body and an Authorization header (Uptime Kuma's Webhook notification can), point it at https://pipplee.com/api/v1/public/devices/text with a body like the one above.

Questions

Why does the alert stay on?

A down site needs fixing, so it uses duration 0, which keeps it until the next message. The "back up" message replaces it and then times out after a minute.

Can I check several sites?

Copy the script once per site with a different URL and NAME, and add a cron line for each.

More ideas

All developer ideas and setup →

Get Pipplee

Set up your matrix in the app, then send it your first alert.

iPhone Android