Skip to content

chiragx16/server_monitoring_system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Flask REST API

🌐 Server Monitoring System

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.

✨ Key Features

  • 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.

🚀 Getting Started

1. Prerequisites

  • Python 3.13+
  • A Twilio account (for SMS alerts)
  • An SMTP-enabled email account (e.g., Gmail with an App Password)

2. Installation

# Clone the repository
git clone https://github.com/chiragx16/server_monitoring_system.git
cd server_monitoring_system

# Install dependencies
pip install -r requirements.txt

3. Configuration

The 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.json and config_example.yaml are given for understanding how to setup your own.


🛠 Configuration Breakdown

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.
Email smtp_server The address of your email provider (default: smtp.gmail.com).

🚦 How it Works

  1. The Pulse: The system sends ping_count packets to the target server every interval seconds.
  2. The Verification: If failures exceed the fail_threshold, the system waits for the recheck_delay and tries again to confirm the outage.
  3. The Alert: If the server is confirmed down, it checks if notifications are enabled and sends an alert through your chosen channels.
  4. The Cooldown: To avoid spamming your phone, the cooldown_minutes setting ensures you only get one alert per specified window.

💻 Usage

To start the monitoring service, simply run:

python main.py

Note: Ensure your bundle/ directory contains the necessary SSL certificates if ssl is enabled.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages