The Problem With Silent Alerts
A homelab feels great until something breaks and nobody tells you. A failed backup, a crashed container or an unknown device on the network all matter. But that knowledge helps only if the alert reaches your phone. An alert that never arrives is worse than no alerts at all, because you think you are covered.
I wanted one self-hosted push server for everything in the lab. Gotify and ntfy are the two obvious choices, and both are good. I picked Gotify. This post explains why it suited how I run things. It also shows how I connected two sources to it.
Two Different Models
The main difference is how each tool decides who can send and who can read.
Gotify uses application tokens. Each sender (Watchtower, Proxmox, Fail2Ban, NetAlertX) gets its own token. A sender posts messages with that token in a simple HTTP POST. The Gotify Android app and the web UI receive them over a WebSocket.
ntfy uses topics. A sender publishes to a topic name. Any client that knows the topic can subscribe. That is flexible and quick for ad-hoc messages. You can use it as a hosted service or self-host it.
| Gotify | ntfy | |
|---|---|---|
| Access model | One token per sending app | Publish/subscribe on topic names |
| Clients | Android app and web UI (third-party iOS clients) | Web UI and mobile subscribers |
| Strength | Per-sender credentials, predictable routing | Dynamic topics, quick one-off messages |
For me, per-app tokens won on housekeeping. If one service misbehaves or a token leaks, I revoke that one token. Nothing else changes. With topics, I would manage topic names and access rules instead.
Where Notifications Fail
With any server, a few things make push notifications drop quietly:
- Dropped connections. Wi-Fi changes and short network resets can kill a long-lived connection. Some clients do not open it again right away.
- Battery savers. Phone operating systems stop background workers to save power. Alerts then arrive late or not at all.
- Reverse proxy defaults. Proxies like Nginx can buffer streamed responses or time out long-lived connections. That stalls real-time delivery.
These problems are not specific to ntfy. Any push system that holds a connection open can hit them, so test Gotify the same way. If you run it behind Nginx, make sure the proxy passes WebSocket upgrade headers. Also give it a long enough read timeout.
I like that Gotify has less moving state to reason about. A sender does a POST with a token, and the server pushes the message to the connected clients. When something goes wrong, I have only a few places to look. That is a preference for simple systems. I do not claim that it can never miss an alert. On the phone, I still exempt the Gotify app from battery optimization.
Sending Fail2Ban Alerts to Gotify
Fail2Ban bans IP addresses that keep failing logins. It does this with firewall rules. I wanted to know when it was busy. Its action scripts can run any command, so a plain curl to Gotify’s message endpoint does the job.
This command posts a high-priority message with a per-app token:
curl -s -S -X POST "https://gotify.example.com/message" \
-H "X-Gotify-Key: YOUR_APP_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Fail2Ban Perimeter Alert",
"message": "Security threshold met: banned 5 IPs probing SSH.",
"priority": 5
}'
I batch these. I do not send one push per ban. I send one after every 5 bans. During a scan wave, the phone does not buzz all the time. I can still see how often somebody probes the perimeter.
Update, October 2026: I have since retired Fail2Ban on the cloud nodes. A shared IP blocklist replaced it, and a timer refreshes that list. The Gotify side did not change. The blocklist job reports through its own app token in the same way.
Sending NetAlertX Alerts to Gotify
NetAlertX watches the local network with tools like Nmap and ARP-scan. It reports new devices and newly opened ports. It can send alerts to Gotify directly or through its built-in Apprise integration. Either way, you give it your Gotify server URL and an app token.
This is the setup in short:
- In the NetAlertX web interface, open Settings and find the Publishers / Notifications section.
- Enable the Gotify publisher (or Apprise). Enter your server URL and a dedicated app token.
- Turn on the “New Device” and “New Open Port” events.
Now I get a push right away when an unknown device joins the network. I also get one when a new port opens on a container or hypervisor host. NetAlertX has its own token, so I can see at a glance which messages came from it. I can change or revoke that token without touching Fail2Ban.
Why I Stayed With Gotify
- It is fully self-hosted. That matters to me for a system that reports on my own network.
- Per-app tokens keep each sender’s credentials separate and easy to revoke.
- The delivery path is short: HTTP POST in, WebSocket out.
- ntfy is a fine tool. It suits topic-based flows and quick script messages without an app first. It did not match how I wanted to organize alerts.
Takeaways:
- Decide how you want to manage senders before you pick a server. Per-app tokens suit a lab with many distinct services.
- Test the whole path: sender, reverse proxy, phone. Do not test only the server.
- Enable WebSocket upgrades and generous timeouts on your proxy. Exempt the app from battery optimization.
- Batch noisy sources like Fail2Ban, so the alerts that matter stand out.
- Give each integration its own token. Then you can revoke one without breaking the rest.