A lightweight, automated monitoring solution designed to keep a pulse on your infrastructure. This system uses ICMP pings to track server availability and dispatches instant alerts via Email or SMS (Twilio) the moment a downtime event is detected.
- Real-time Monitoring: Configurable ping intervals and timeout thresholds.
- Smart Alerts: Prevents "alert fatigue" with a configurable notification cooldown.
- Dual-Channel Notifications: Support for SMTP Email and Twilio SMS.
- Secure by Default: Built-in SSL/TLS support for the application interface.
- Reliability Logic: Includes a "recheck" mechanism to verify downtime before firing alerts, reducing false positives.
- Python 3.13+
- A Twilio account (for SMS alerts)
- An SMTP-enabled email account (e.g., Gmail with an App Password)
# Clone the repository
git clone https://github.com/chiragx16/server_monitoring_system.git
cd server_monitoring_system
# Install dependencies
pip install -r requirements.txtThe system is controlled via config.yaml, servers.json, groups.json. Update this file with your server details and API credentials.
Example files
servers_example.json,groups_example.jsonandconfig_example.yamlare given for understanding how to setup your own.
| Section | Parameter | Description |
|---|---|---|
| Run | port |
The port where the monitoring dashboard/service will run. |
| SSL | cert / key |
Paths to your SSL certificate and private key for HTTPS. |
| Ping | interval |
Time (in seconds) between routine checks. |
| Ping | fail_threshold |
Number of failed packets required to trigger a recheck. |
| Twilio | account_sid |
Your unique Twilio identifier. |
smtp_server |
The address of your email provider (default: smtp.gmail.com). |
- The Pulse: The system sends
ping_countpackets to the target server everyintervalseconds. - The Verification: If failures exceed the
fail_threshold, the system waits for therecheck_delayand tries again to confirm the outage. - The Alert: If the server is confirmed down, it checks if
notificationsare enabled and sends an alert through your chosen channels. - The Cooldown: To avoid spamming your phone, the
cooldown_minutessetting ensures you only get one alert per specified window.
To start the monitoring service, simply run:
python main.pyNote: Ensure your bundle/ directory contains the necessary SSL certificates if ssl is enabled.