Skip to main content

chap-checker

CI PyPI version Python 3.13+ License: AGPL v3 Documentation

A small command-line health-check and alerting tool for DHIS2 instances that integrate with chap-core via a DHIS2 route, and for Open Climate Service deployments (kind = "ocs"). 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

Four namespaces — http_* is a transport-level reachability probe for every instance kind, dhis2_* probes DHIS2 itself, dhis2_chap_* probes chap-core through the DHIS2 route, and ocs_* probes an Open Climate Service deployment. An instance only runs the checks for its kind. Each tile in the dashboard, each row in chap-checker checks list, each entry in the JSON output:

  • http_2xx — unauthenticated GET <base_url>, asserts the final response is 2xx (follows redirects)
  • dhis2_ping — /api/me
  • dhis2_system_info — /api/system/info
  • dhis2_chap_route — /api/routes?filter=code:eq:chap
  • dhis2_chap_ping — /api/routes/chap/run/health
  • dhis2_chap_system_info — /api/routes/chap/run/system/info
  • dhis2_chap_modeling_app — /api/apps (matched by app_hub_id)
  • dhis2_chap_climate_app — /api/apps (matched by app_hub_id)
  • ocs_health — /health (liveness only)
  • ocs_info — /info + / (version and openEO capabilities)

Full reference + endpoint details: 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

AGPL-3.0-or-later.

Metadata

Release files for chap-checker 0.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chap-checker 0.11.0
File Size Uploaded Provenance Actions
chap_checker-0.11.0.tar.gz 828.1 kB With provenance Details for chap_checker-0.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for chap-checker 0.11.0
File Interpreter ABI Platform Actions
chap_checker-0.11.0-py3-none-any.whl Python 3 none any Details for chap_checker-0.11.0-py3-none-any.whl

Total release size: 1.7 MB

Release files / chap_checker-0.11.0.tar.gz

Download URL chap_checker-0.11.0.tar.gz
Size 828.1 kB
Tags Source
SHA-256 checksum
How to use checksums
9e5450016af9256c3383fa65f281e23ed62d05e7b6f40d16b4aa544fc824628e
BLAKE2b-256 checksum
How to use checksums
b7a34eaad30fa500a301088e05f6c78898036bcc42d4cc9427bdff93d447b163
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Release files / chap_checker-0.11.0-py3-none-any.whl

Download URL chap_checker-0.11.0-py3-none-any.whl
Size 852.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
625041c8d52d5ec1636ceed303bf918b72bdedbd32a343608f5808d352e5bb65
BLAKE2b-256 checksum
How to use checksums
423549e57b62181674063916ee51de8774cfacc6be836a056d2f41f5016e1ce8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

Security for chap-checker 0.11.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for chap_checker-0.11.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 17, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page