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:
- 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
sudois 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
84ecf24952aa14f78da8787b09d1cfd22ed68d1696082bbf297d636d5ac33452
|
|
| MD5 |
a4d75ece654b9e36e584d6b942864d58
|
|
| BLAKE2b-256 |
6f5edd7a03141548f75b0282a4a6f19cfc229ffee3d8302fbf4a24bc66dd03d3
|
Provenance
The following attestation bundles were made for watchdog_host-1.0.1.tar.gz:
Publisher:
release.yml on znhocn/watchdog-host
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
watchdog_host-1.0.1.tar.gz -
Subject digest:
84ecf24952aa14f78da8787b09d1cfd22ed68d1696082bbf297d636d5ac33452 - Sigstore transparency entry: 786559034
- Sigstore integration time:
-
Permalink:
znhocn/watchdog-host@f4a76a953c7e321504121620c399325ab5e52411 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/znhocn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f4a76a953c7e321504121620c399325ab5e52411 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5868cab15ec891f605db4dd6e25d56a6547840995166720960f1b25423730093
|
|
| MD5 |
511d94d2768d21cb5a7e4f16791f680a
|
|
| BLAKE2b-256 |
6a68b9054e22081a146992da37e32a9cffcb52c41a28b443ce7dffe60aac199b
|
Provenance
The following attestation bundles were made for watchdog_host-1.0.1-py3-none-any.whl:
Publisher:
release.yml on znhocn/watchdog-host
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
watchdog_host-1.0.1-py3-none-any.whl -
Subject digest:
5868cab15ec891f605db4dd6e25d56a6547840995166720960f1b25423730093 - Sigstore transparency entry: 786559041
- Sigstore integration time:
-
Permalink:
znhocn/watchdog-host@f4a76a953c7e321504121620c399325ab5e52411 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/znhocn
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f4a76a953c7e321504121620c399325ab5e52411 -
Trigger Event:
push
-
Statement type: