Health-check CLI for DHIS2 instances integrated with chap-core; cron-friendly with Slack alerts on status transitions.
Project description
chap-checker
A small command-line health-check and alerting tool for DHIS2 instances that
integrate with chap-core via a DHIS2 route. Cron-friendly, with optional
Slack / generic-webhook alerts on status transitions, a long-running
daemon that exposes a browser dashboard (designed for a TV / kiosk) and a
JSON state API, and a Textual TUI for the operator-at-a-desk view (locally
or pointed at a remote daemon).
Documentation: https://dhis2-chap.github.io/chap-checker
Install
# One-shot run without installing (no PATH pollution):
uvx chap-checker --version
uvx chap-checker verify --url https://dhis2.example.com --token-env DHIS2_TOKEN
# Persistent install into uv's isolated tool environment:
uv tool install chap-checker
chap-checker --version
# Upgrade to the latest release later:
uv tool upgrade chap-checker
# Or, if you're embedding into another uv project:
uv add chap-checker
Quick start
The fastest path is chap-checker init, which drops a working chap-checker.toml (chmod 600) pointed at the public DHIS2 demo so you can verify the tool runs before adding your own instances:
chap-checker init
chap-checker verify # OK on the play demo
Then edit chap-checker.toml. A typical config:
[instances.prod]
url = "https://dhis2.example.com"
username = "ops"
password_env = "PROD_PASS"
alerts = ["slack", "webhook"]
[alerts.slack]
webhook_url_env = "SLACK_WEBHOOK_URL"
[alerts.webhook]
url_env = "INCIDENT_BUS_URL"
headers = { "Authorization" = "Bearer ..." }
Discover the alert transports and copy-paste their TOML:
chap-checker alerts list # registry of available alerters with per-field comments
chap-checker alerts test --kind both # fire a synthetic OK->FAIL + FAIL->OK pair
Ad-hoc verify against a single instance (no config needed):
# With a DHIS2 Personal Access Token (recommended on modern servers):
export PROD_TOKEN=...
chap-checker verify --url https://dhis2.example.com --token-env PROD_TOKEN
# Or with a password (Basic auth) read from a named env var:
export PROD_PASSWORD=...
chap-checker verify --url https://dhis2.example.com --username admin --password-env PROD_PASSWORD
--password / --token inline still works but is discouraged — the value lands in shell history and ps output. Omit both and you'll be prompted on a TTY. See chap-checker.toml.example for the full config template.
Surfaces
chap-checker tui # Textual TUI: operator-at-a-desk view, in a terminal
chap-checker serve # long-running daemon: browser dashboard at / + JSON state at /api/state
chap-checker tui --connect http://daemon-host:8765 # TUI as a thin client of a remote `serve`
Pair them: run chap-checker serve somewhere persistent (a small VM, the TV machine itself, systemd-supervised — see the server guide for the unit file). Pin a kiosk browser at the URL on the TV; operators at desks run chap-checker tui locally or chap-checker tui --connect http://daemon:8765 for the same numbers without spinning up their own check loop. Alerts fire from one place.
Built-in checks
Two namespaces — dhis2_* probes DHIS2 itself, dhis2_chap_* probes
chap-core through the DHIS2 route. Each tile in the dashboard, each row in
chap-checker checks list, each entry in the JSON output:
dhis2_ping—/api/medhis2_system_info—/api/system/infodhis2_chap_route—/api/routes?filter=code:eq:chapdhis2_chap_ping—/api/routes/chap/run/healthdhis2_chap_system_info—/api/routes/chap/run/system/infodhis2_chap_modeling_app—/api/apps(matched byapp_hub_id)dhis2_chap_climate_app—/api/apps(matched byapp_hub_id)
Full reference + endpoint details: Built-in checks.
Development
make install
make lint # ruff + mypy + pyright
make test
make docs # serve docs locally
See Development for repo layout and house rules.
Contributing
PRs welcome — start with CONTRIBUTING.md. The development guide on the docs site has the long version: https://dhis2-chap.github.io/chap-checker/guides/development/.
For security issues, see SECURITY.md — please don't open a public issue.
Contributors: github.com/dhis2-chap/chap-checker/graphs/contributors.
License
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 chap_checker-0.8.0.tar.gz.
File metadata
- Download URL: chap_checker-0.8.0.tar.gz
- Upload date:
- Size: 804.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58a86093ce206025ebdd2f2c9e4d7bb5489ab0a6424b2485536fd579dbf47c7f
|
|
| MD5 |
cacae09570503d429ea7cc450797c76b
|
|
| BLAKE2b-256 |
999299c80706fa740639e9c0b2bbd8f20297c1e211b9558a741084002f13c0ab
|
Provenance
The following attestation bundles were made for chap_checker-0.8.0.tar.gz:
Publisher:
release.yml on dhis2-chap/chap-checker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chap_checker-0.8.0.tar.gz -
Subject digest:
58a86093ce206025ebdd2f2c9e4d7bb5489ab0a6424b2485536fd579dbf47c7f - Sigstore transparency entry: 1553571967
- Sigstore integration time:
-
Permalink:
dhis2-chap/chap-checker@8199d9b8b4337c9bf34d849bbe50bbb406313b3d -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/dhis2-chap
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8199d9b8b4337c9bf34d849bbe50bbb406313b3d -
Trigger Event:
push
-
Statement type:
File details
Details for the file chap_checker-0.8.0-py3-none-any.whl.
File metadata
- Download URL: chap_checker-0.8.0-py3-none-any.whl
- Upload date:
- Size: 827.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c809278032193c2592e4f67f622330e3c88341d73c91f4a1033d4e3369d6c79
|
|
| MD5 |
b259f394d94e2a438e7c084925c9c06a
|
|
| BLAKE2b-256 |
80c0101a48770c985a38c5e794557e65d4d41b85ddaf04904ca3863dc2384a83
|
Provenance
The following attestation bundles were made for chap_checker-0.8.0-py3-none-any.whl:
Publisher:
release.yml on dhis2-chap/chap-checker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chap_checker-0.8.0-py3-none-any.whl -
Subject digest:
3c809278032193c2592e4f67f622330e3c88341d73c91f4a1033d4e3369d6c79 - Sigstore transparency entry: 1553571971
- Sigstore integration time:
-
Permalink:
dhis2-chap/chap-checker@8199d9b8b4337c9bf34d849bbe50bbb406313b3d -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/dhis2-chap
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8199d9b8b4337c9bf34d849bbe50bbb406313b3d -
Trigger Event:
push
-
Statement type: