Operations · 2026 · Jasa
Letting the server email me for help
Monitoring is easy to set up. The hard part is no false alarms, no flood of emails, and a note when things are fixed.
What I want to know: is the site still up
Every 5 minutes a systemd timer checks the server, each product and the AI gateway, and writes the results to a status file. No database, no monitoring platform; for one personal server, that's enough.
Three rules that make me actually open the alerts
- Two failures in a row count as down. A network blip should not wake me.
- A reminder every 6 hours until fixed. Not one every 5 minutes. With too many emails, even I'd stop reading them.
- One more mail on recovery. Otherwise, after a failure mail, I would have to go and check whether it was fixed.
Each problem's state lives in a small file: how many failures, and when the last mail went out. So although the script restarts every run, it remembers what happened last time.
Testing the alert itself
The awkward thing about alerts is that they stay silent, so you never know whether they'll work when it counts. So the logic has unit tests, and I sent a real email and only relaxed once it arrived.
← All notes