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.

Every 5 minrun a checkTwice in a rowcounts as downSend emailAll-clear on recovery
A single blip stays quiet. If it stays broken, I get a reminder every 6 hours.

Three rules that make me actually open the alerts

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