What I used to do
Every time I set up a new server, I'd go into the cloud console and manually click through the UI to set up alerts "tell me if CPU goes above 80%", "tell me if this server stops responding", that kind of thing.
It worked. For one server.
Where it broke
When I had 5 servers instead of 1, I noticed something: only some of them had alerts. A couple of new servers had none at all.
Why? Because setting up alerts by clicking through the console is a manual step. And manual steps get forgotten. I'd create a new server, get it running, move on to the next thing and just... not go back and click through the alert setup again.
Nobody did anything wrong. It's just what happens when "add monitoring" depends on a human remembering to do it every single time.
What I changed
Instead of clicking through the console, I wrote a small script that creates the alerts for me using code, not clicks.
Now, whenever I create a new server, I run the same script, and it automatically sets up the same alerts every time: heartbeat check (is it alive?), CPU check, error-rate check. Every server gets the exact same coverage, because it's the same script every time not me remembering to click 10 buttons in the right order.
Why this is better
Before (manual clicking):
- Easy to forget for a new server
- Easy to accidentally set it up slightly differently each time
- No record of what alerts exist or why
After (script):
- Every new server automatically gets the same alerts
- The script itself is proof of what alerts exist I can read the code
- If I want to change something (like the CPU threshold), I change it once in the script, and it's correct for every server going forward
The simple lesson
If you're creating something by clicking through a UI more than once, that's usually a sign you should write a script instead. It's not about being fancy it's that scripts don't forget, and clicking does.
This applies to alerts, but it applies to almost anything repetitive in the cloud: creating servers, setting permissions, configuring backups. If you do it more than once by hand, write it down as code once, and just run that instead.
Top comments (0)