Skip to main content

Watchdog Host is a tool for automatically managing hosts.

Project description

Watchdog-Host

Watchdog-Host is a daemon designed to monitor bandwidth usage on cloud hosts, helping prevent unexpected charges caused by exceeding monthly traffic quotas.

Features

  • Monthly network traffic accounting for cloud instances
  • Configurable via config.yaml, including:
    • Bandwidth quota limits
    • Usage percentage alert thresholds
  • Multiple notification channels:
    • Email
    • WeCom (WeChat Work)
    • DingTalk
  • Optional automatic shutdown when traffic usage exceeds the configured quota
  • Runs as a systemd service, suitable for long-term unattended operation

Usage Notes

  • Historical network usage prior to the first run cannot be determined:
    • Traffic statistics for the current month will be inaccurate on the first run
    • Accurate statistics will be available starting from the next execution cycle
  • Additional watchdog capabilities may be added in the future

Requirements

  • Must be executed as the root user
  • Running via sudo is not supported
    • This is required due to systemd management and low-level network statistics access

Installation

pip install watchdog-host
watchdog-host init
vim /etc/watchdog/config.yaml
systemctl enable --now <service>.service
systemctl status <service>.service

If your system version is Ubuntu 24.04 / Debian 12 or later, use this command.

apt update
apt install -y pipx
pipx ensurepath
pipx install watchdog-host
source ~/.bashrc

pip install watchdog-host
watchdog-host init
vim /etc/watchdog/config.yaml
systemctl enable --now <service>.service
systemctl status <service>.service

Uninstallation

systemctl disable --now <service>.service
watchdog-host clean
pip uninstall -y watchdog-host

# Optional
rm -f /etc/watchdog/config.yaml
rm -f /etc/watchdog/*.json

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

watchdog_host-1.0.3.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

watchdog_host-1.0.3-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file watchdog_host-1.0.3.tar.gz.

File metadata

  • Download URL: watchdog_host-1.0.3.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for watchdog_host-1.0.3.tar.gz
Algorithm Hash digest
SHA256 c5c9ad7440fcf1453e0dc03bea41d7520dae4e6b074354efe98240eeec27f3e8
MD5 18578e5139c17276fd20920cce6bffc4
BLAKE2b-256 100d937de398abc48d6be5a13b86161b947d0422408e8095ef5cd2f201673031

See more details on using hashes here.

Provenance

The following attestation bundles were made for watchdog_host-1.0.3.tar.gz:

Publisher: release.yml on znhocn/watchdog-host

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

File details

Details for the file watchdog_host-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: watchdog_host-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for watchdog_host-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e02346899423e55fb1484499cde8aaf155e6dcd05f3bceb50c9265b9c544101d
MD5 4d1e780d4ab9d935b0ef66c127b607d2
BLAKE2b-256 d60e991388e016b12826591b52c79b1aacb25abdd9ffd876d2123510ac9f7c38

See more details on using hashes here.

Provenance

The following attestation bundles were made for watchdog_host-1.0.3-py3-none-any.whl:

Publisher: release.yml on znhocn/watchdog-host

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