A lightweight Python-based system and network monitoring script for Linux systems, designed to run in the background and alert you when connectivity or resource thresholds are triggered.
- Full system health monitoring (CPU, RAM, Disk, Network)
- Automatic email alerts for failures
- Detailed logging of system events and statuses
- Fully configurable via
config.ini
- Cross-platform: Linux, Windows, macOS
system-check/
βββ monitor.py # Main system monitor script
βββ config.ini # Configuration file (thresholds, email settings, ping targets)
βββ last_alert.ini # Tracks last sent alerts to avoid spamming
βββ logs/
β βββ monitor.log # Log file for system status, warnings, and errors
βββ .gitignore # Git ignore rules (logs, temp files, etc.)
βββ README.md # Project overview and setup instructions
-
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate
-
Install required dependencies:
pip install -r requirements.txt
(Note: If you don't have a
requirements.txt
yet, it would just includepsutil
.) -
Configure your settings in
config.ini
:[network] ping_target = 8.8.8.8 [email] smtp = smtp.gmail.com sender = youremail@example.com app_password = yourapppassword recipient = recipient@example.com [thresholds] cpu = 90 ram = 90 disk = 90 [alerts] threshold = 3600 # Minimum seconds between repeated alerts
-
Run the monitor:
python monitor.py
Make sure the logs/ directory exists. Use a .gitkeep file if you want Git to track empty folders.
You can hook this script into a systemd timer or cron job to automate checks.
Always validate and sanitize dynamic input if you extend this script.
If using email alerts, use app-specific passwords (not your main password) when possible.
Dynamic mount discovery for Disk Usage
RTT/latency analysis and alerting
Expand email alerts to include basic system summary reports.