Skip to main content

Simple and effective server monitoring with easy configuration and multiple notification options

Project description

Server Monitoring Made Easy (SME)

A lightweight, easy-to-configure server monitoring tool that focuses on the metrics that matter most.

Features

  • Monitor critical server metrics:
    • CPU usage
    • Memory consumption
    • Disk space
    • Network latency (ping)
    • Server uptime
  • Simple YAML configuration
  • Flexible alerting with customizable thresholds
  • Multi-channel notifications via Apprise
  • Run as a daemon or in the background
  • Easy-to-use CLI interface
  • Extensible architecture for custom monitors

Installation

pip install server-monitoring-made-easy

Or from source:

git clone https://github.com/yourusername/server-monitoring-made-easy.git
cd server-monitoring-made-easy
poetry install

Quick Start

  1. Create a configuration file config.yaml:
monitors:
  cpu:
    enabled: true
    threshold: 80 # Alert when CPU usage > 80%
    interval: 60 # Check every 60 seconds
  memory:
    enabled: true
    threshold: 90 # Alert when memory usage > 90%
    interval: 60
  disk:
    enabled: true
    threshold: 85 # Alert when any disk is > 85% full
    interval: 300 # Check every 5 minutes
  ping:
    enabled: true
    targets:
      - google.com
      - cloudflare.com
    threshold: 200 # Alert when ping > 200ms
    interval: 60

notifications:
  - type: telegram
    token: "your-bot-token"
    chat_id: "your-chat-id"
  - type: discord
    webhook: "your-webhook-url"

logging:
  level: INFO
  file: /var/log/sme/server-monitor.log
  1. Start the monitor:
sme start --config config.yaml
  1. Check status:
sme status

Monitoring using systemd

# Create system user
sudo useradd -r -s /bin/false sme

# Create necessary directories
sudo mkdir -p /etc/sme /var/log/sme /var/run/sme
sudo chown -R sme:sme /etc/sme /var/log/sme /var/run/sme

# Install the package
pip install server-monitoring-made-easy

# Copy config file
sudo cp config.yaml /etc/sme/

# Copy and enable systemd service
sudo cp packaging/systemd/sme.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable sme
sudo systemctl start sme

CLI Usage

  • sme start: Start the monitoring daemon
  • sme stop: Stop the monitoring daemon
  • sme status: Show current monitoring status
  • sme alerts: List all alerts and their states
  • sme config show: Show current configuration
  • sme config validate: Validate configuration file

Project Structure

app/
├── __init__.py
├── cli.py                 # CLI implementation
├── config.py             # Configuration management
├── core/
│   ├── __init__.py
│   ├── monitor.py        # Base monitoring functionality
│   ├── metrics.py        # Metric collection
│   └── alerts.py         # Alert management
├── monitors/
│   ├── __init__.py
│   ├── cpu.py
│   ├── memory.py
│   ├── disk.py
│   └── ping.py
├── notifiers/
│   ├── __init__.py
│   └── apprise_notify.py
└── utils/
    ├── __init__.py
    └── logging.py

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Container Support

When running in a container:

  • Full host metrics support is only available on Linux hosts
  • On non-Linux hosts (like macOS), container memory metrics will reflect the VM's memory usage, not the host system
  • The container must be run with the following settings:
    • pid: "host" for accurate system metrics
    • /proc:/host/proc:ro volume mount for host memory metrics
    • Appropriate capabilities for network monitoring

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

server_monitoring_made_easy-0.1.0.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

server_monitoring_made_easy-0.1.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file server_monitoring_made_easy-0.1.0.tar.gz.

File metadata

File hashes

Hashes for server_monitoring_made_easy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fa82f07a2e20a60850a2f2dad7e2bc99bd9c7ee7da43699d77aa76cf5d7b07bc
MD5 ac1ddfc2206bfb25bd1621ca341b02c0
BLAKE2b-256 304076f7c087331bb417ed37553f627efc699f2dfbb6403c038e3186a704ab7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for server_monitoring_made_easy-0.1.0.tar.gz:

Publisher: ci.yaml on timmyb824/server-monitoring-made-easy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file server_monitoring_made_easy-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for server_monitoring_made_easy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b91f74ffe672ccc9f780d9c929a529801ea65d4cdd9522785a187207ea35e63b
MD5 b59f561108c69405f3990aa132caa83f
BLAKE2b-256 2fe70b2ed7e8889a360e4d6075c785629fa75e5592c1038dbccc3fd982fb47cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for server_monitoring_made_easy-0.1.0-py3-none-any.whl:

Publisher: ci.yaml on timmyb824/server-monitoring-made-easy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page