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.2.tar.gz (9.0 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.2-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: watchdog_host-1.0.2.tar.gz
  • Upload date:
  • Size: 9.0 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.2.tar.gz
Algorithm Hash digest
SHA256 e5eb4b11243cb566ee9a7534c2a1c1c8bd4c00d4814b0199e72ef8ea537b98e8
MD5 d8550e459b6adbe356d7553a2f8e7b70
BLAKE2b-256 628061d613f4d5681445c2a01863e6631e4bf5cc1790cf26ef456e261810686a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: watchdog_host-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.5 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 37c96902350597c5e89b538a145a3b1b06f00a1d971c0f97ac3386858d5d6443
MD5 26f6de4c8c209d01b0d73118774f8932
BLAKE2b-256 3f79b9fd4d07b84e4d77da32ab696f9b85687483a9d09e61e1e5f61ee338dfa5

See more details on using hashes here.

Provenance

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