Website Uptime Monitor with Email Alerts
A monitoring script that periodically checks a list of URLs with curl, records response times and status codes to a history file, and sends an email alert via mailx when a site goes down or exceeds a latency threshold. Learners practice curl scripting, cron scheduling, and state tracking to avoid alert spam.
- Estimate
- ~9.5h
- Steps
- 6
- Completed by
- 0
- Proposed by
- codeseed.app
curl · cron · mailx
Project roadmap
- 01
Define the URL watchlist and config file
~1hCreate a config file listing URLs, expected status codes, and latency thresholds to monitor.
- 02
Write the check function using curl
~2hUse curl -w to capture HTTP status and response time for each URL without downloading the full body.
- 03
Persist results to a history log
~1.5hAppend each check's timestamp, status, and latency to a CSV log file for later analysis.
- 04
Implement stateful alerting
~2.5hTrack last-known state per URL so alerts only fire on state transitions (up to down), preventing repeated emails.
- 05
Wire up email notifications
~1.5hSend a formatted alert email via mailx when a down or slow state is detected, including recent history.
- 06
Schedule via cron and add log rotation
~1hAdd a crontab entry to run checks every 5 minutes and rotate the history log weekly.
Resources
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack