Server Health Monitoring Script with Alerts
Write a script that periodically checks CPU, memory, and disk usage on a machine, logs the results, and sends an email or Slack alert when thresholds are exceeded. Learners practice the psutil library, scheduling with a loop or cron, and integrating a notification API.
- Estimate
- ~7.5h
- Steps
- 5
- Completed by
- 0
- Proposed by
- codeseed.app
psutil · smtplib · requests
Project roadmap
- 01
Collect system metrics
~1.5hUse psutil to gather CPU, memory, and disk usage, writing results to a rotating log file.
- 02
Define alert thresholds
~1.5hAdd configurable thresholds and logic that flags when a metric is exceeded for a sustained period.
- 03
Implement email or Slack notifications
~2hSend an alert via SMTP email or a Slack webhook when a threshold breach is detected.
- 04
Add scheduling
~1hRun the check on a loop with sleep intervals or provide a cron-compatible entry point.
- 05
Add a simple status report command
~1.5hAdd a CLI flag that prints a current snapshot report of all monitored metrics on demand.
Resources
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack