Servers would restart. Services would silently fail. And nobody would know until users started complaining.
I built this while working at Vectorflow, where physical access systems ran on Linux servers that occasionally restarted without warning. Downtime meant real-world security delays. Logs were too noisy. Traditional monitoring missed it. We needed to know the second a server came back up.
The Fix: 10 Lines of Python + a Cron Job
I built a lightweight script that:
- 🚀Runs at boot via crontab (@reboot)
- 📝Captures server hostname, timestamp, and uptime
- 📧Sends an email alert with restart details
- 📁Logs every restart in a local file for postmortems
It is tiny. It is fast. And it just works.
GitHub: github.com/chinmaya-chhatre/server-restart-notifier
What Changed
- ⚡Time-to-detect server restarts dropped to near zero
- 📈Instant alerts helped correlate uptime with other logs
- 🧘Reduced false positives and alert fatigue by keeping it simple
Not every solution needs a $99/month SaaS tool. Every SRE has lost time to mystery restarts. A 10-line script can prevent a production fire.
Tradeoffs I Made
- 🔨Simple over smart: no agent, no daemon, no bloat, just Python and crontab
- 📧Chose email over Slack to avoid adding webhook dependencies (but it is extensible)
- 📴Works offline and boots with the system: self-contained by design
What I Would Add Next
- 🟢Add a webhook to integrate with Slack or Discord
- 📊Forward logs to ELK or CloudWatch for central visibility
- 🔒Add signature hash to verify alert authenticity
More from the Tech Blog