Run local Nagios-compatible checks; push results to Uptime Kuma
Project description
KumaCub
Run local checks; push results to Uptime Kuma.
KumaCub is a lightweight daemon that executes scheduled health checks and pushes the results to Uptime Kuma. It supports Nagios-compatible check scripts and provides flexible configuration via TOML files or environment variables.
Installation
Arch Linux (AUR)
For Arch Linux users, you can install KumaCub from the AUR. Installing this way will also install the systemd unit file and a sample config file.
# Install from AUR (we'll use `yay` for this example)
yay -S kumacub
Manual Installation (PIP)
If your distro doesn't have a package available, you can install KumaCub manually.
pip install kumacub
sudo kumacub install
Quick Setup with uv
If you prefer to use uv, you can set up your systemd service to use uv to run KumaCub.
- Install uv:
curl -LsSf https://astral.sh/uv/install.sh | sudo sh
- Create a systemd unit file
/etc/systemd/system/kumacub.service:[Unit] Description=KumaCub - Run local checks and push results to Uptime Kuma Documentation=https://github.com/toadstule/kumacub After=network-online.target Wants=network-online.target [Service] ExecStart=/root/.local/bin/uv run --isolated --no-progress --python=3.13 --with kumacub kumacub daemon ExecReload=/bin/kill -HUP $MAINPID [Install] WantedBy=multi-user.target
- Create a config file
/etc/kumacub/config.toml:sudo mkdir /etc/kumacub
[log] level = "DEBUG" structured = false [[checks]] name = "sampe check" executor.command = "echo" executor.args = ["-n", "OK - sample check is working"] publisher.url = "https://uptime-kuma.example.com" publisher.push_token = "your-push-token-here" schedule.interval = 60
- Reload systemd daemon:
sudo systemctl daemon-reload
Configuration
KumaCub uses a TOML configuration file. By default, it looks for /etc/kumacub/config.toml, but you can override this with the KUMACUB__CONFIG environment variable.
Example Configuration
# Logging configuration
[log]
level = "INFO" # DEBUG, INFO, WARNING, ERROR, CRITICAL
structured = true # Use JSON-formatted logs
# Define checks
[[checks]]
name = "disk usage"
executor.command = "/usr/lib/monitoring-plugins/check_disk"
executor.args = ["-c", "90"]
publisher.url = "https://uptime-kuma.example.com"
publisher.push_token = "your-push-token-here"
schedule.interval = 60 # Run every 60 seconds
[[checks]]
name = "system time (ntp)"
executor.command = "/usr/lib/monitoring-plugins/check_ntp_time"
executor.args = ["-H", "pool.ntp.org", "-c", "10"]
publisher.url = "https://uptime-kuma.example.com"
publisher.push_token = "your-push-token-here"
schedule.interval = 30
[[checks]]
name = "system load"
executor.command = "check_load"
executor.args = ["-c", "10", "-w", "10"]
executor.env = { "PATH" = "/usr/lib/monitoring-plugins" }
publisher.url = "https://uptime-kuma.example.com"
publisher.push_token = "your-push-token-here"
schedule.interval = 30
Configuration Fields
Check Configuration
Each [[checks]] entry supports:
- name: Unique identifier for the check
- executor.command: Command to execute
- executor.args: Command arguments (optional, default:
[]) - executor.env: Environment variables (optional, default:
{}) - publisher.url: Uptime Kuma instance URL
- publisher.push_token: Uptime Kuma push token
- schedule.interval: Check interval in seconds (default:
60)
Environment Variables
You can override any configuration value using environment variables with the KUMACUB__ prefix:
# Override config file location
export KUMACUB__CONFIG=/path/to/config.toml
# Override log level
export KUMACUB__LOG__LEVEL=DEBUG
# Override log format
export KUMACUB__LOG__STRUCTURED=false
Usage
Managing the Systemd Service
# Start the service
sudo systemctl start kumacub
# Stop the service
sudo systemctl stop kumacub
# Restart the service
sudo systemctl restart kumacub
# Reload configuration without restarting
sudo systemctl reload kumacub
# Check service status
sudo systemctl status kumacub
# View logs
sudo journalctl -u kumacub -f
# Enable on boot
sudo systemctl enable kumacub
# Disable on boot
sudo systemctl disable kumacub
License
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
Project details
Release history Release notifications | RSS feed
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 kumacub-0.3.1.tar.gz.
File metadata
- Download URL: kumacub-0.3.1.tar.gz
- Upload date:
- Size: 12.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 |
0931cbc3faf3f904da37054385f6518c35df7fdcc5b9569c80e3a1b644bcbbcd
|
|
| MD5 |
7bc650d575e07925a4e1f39e9cb70e8f
|
|
| BLAKE2b-256 |
9e5e7f0f85906e7608ab4f99952df0fcf3c83876bbfeea1e39d8576021763108
|
Provenance
The following attestation bundles were made for kumacub-0.3.1.tar.gz:
Publisher:
main.yml on toadstule/kumacub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kumacub-0.3.1.tar.gz -
Subject digest:
0931cbc3faf3f904da37054385f6518c35df7fdcc5b9569c80e3a1b644bcbbcd - Sigstore transparency entry: 704334897
- Sigstore integration time:
-
Permalink:
toadstule/kumacub@0573e95f280516b292603ba9a67afba6e33e0717 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/toadstule
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@0573e95f280516b292603ba9a67afba6e33e0717 -
Trigger Event:
release
-
Statement type:
File details
Details for the file kumacub-0.3.1-py3-none-any.whl.
File metadata
- Download URL: kumacub-0.3.1-py3-none-any.whl
- Upload date:
- Size: 26.9 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 |
f1320beda12e38c90ad8e18d91ea869d0127feef5d05625de891a44ff552553e
|
|
| MD5 |
176955ed44e8d0472e3b5c2b09243805
|
|
| BLAKE2b-256 |
41411d1533a427ff72f9cb136054f39dc463120ccbe4dcc40ffe88a641ee2a8f
|
Provenance
The following attestation bundles were made for kumacub-0.3.1-py3-none-any.whl:
Publisher:
main.yml on toadstule/kumacub
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kumacub-0.3.1-py3-none-any.whl -
Subject digest:
f1320beda12e38c90ad8e18d91ea869d0127feef5d05625de891a44ff552553e - Sigstore transparency entry: 704334973
- Sigstore integration time:
-
Permalink:
toadstule/kumacub@0573e95f280516b292603ba9a67afba6e33e0717 -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/toadstule
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
main.yml@0573e95f280516b292603ba9a67afba6e33e0717 -
Trigger Event:
release
-
Statement type: