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.1.tar.gz (8.9 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.1-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: watchdog_host-1.0.1.tar.gz
  • Upload date:
  • Size: 8.9 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.1.tar.gz
Algorithm Hash digest
SHA256 84ecf24952aa14f78da8787b09d1cfd22ed68d1696082bbf297d636d5ac33452
MD5 a4d75ece654b9e36e584d6b942864d58
BLAKE2b-256 6f5edd7a03141548f75b0282a4a6f19cfc229ffee3d8302fbf4a24bc66dd03d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for watchdog_host-1.0.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: watchdog_host-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.3 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5868cab15ec891f605db4dd6e25d56a6547840995166720960f1b25423730093
MD5 511d94d2768d21cb5a7e4f16791f680a
BLAKE2b-256 6a68b9054e22081a146992da37e32a9cffcb52c41a28b443ce7dffe60aac199b

See more details on using hashes here.

Provenance

The following attestation bundles were made for watchdog_host-1.0.1-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