Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Checkmk appliance REST API client

Python library and command line client (cmk-appliance) for the REST API of the Checkmk appliance. It runs on an administrator's workstation or automation host and talks to one or many appliances over HTTP(S). It is not part of the appliance firmware.

The REST API is experimental. Enable it on the "REST API (experimental)" page of the web configuration of the appliance and create an API token there.

The client only uses the Python standard library. It needs the Python version of the appliance firmware or a newer one, currently Python 3.11 or newer.

The API reference of the library is published with each release: https://download.checkmk.com/appliance-client/latest/

Installation

pip install cmk-appliance-client

The package contributes cmk.appliance.client to the cmk namespace package, so it can be installed next to other cmk packages, e.g. into the Python environment of a Checkmk site.

Command line

export CMK_APPLIANCE_URL=https://appliance.example.com
export CMK_APPLIANCE_TOKEN=cma_...

cmk-appliance info
cmk-appliance version install check-mk-cloud-2.4.0p1-1.7-x86_64.cma
cmk-appliance site create mysite 2.4.0p1.cee --admin-password-file admin.pw
cmk-appliance site edit mysite --livestatus-tcp-port 6557 --acknowledge-site-restart
cmk-appliance site update mysite 2.4.0p1.cee --dry-run
cmk-appliance site update mysite 2.4.0p1.cee --acknowledge-site-stop
cmk-appliance version cleanup
cmk-appliance site stop-all
cmk-appliance setting show
cmk-appliance setting timezone Europe/Berlin
cmk-appliance setting mail smtp.example.com --username mailer --password-file - --tls-port 587

The token can also be read from a file or from stdin (--token-file -). There is no option taking the token itself, since command lines end up in shell histories and process listings. The same goes for passwords, e.g. of a new site: They are read from a file or asked for.

- reads a secret from stdin instead of a file, for one option per call: Stdin has no end between two secrets. Process substitution passes any number of secrets, each through a pipe of its own, without storing them in files:

pass show appliance/token | cmk-appliance --token-file - site create mysite 2.4.0p1.cee \
    --admin-password-file <(pass show appliance/cmkadmin) \
    --site-user-password-file <(pass show appliance/mysite)

--insecure skips the TLS certificate check (e.g. while the appliance still uses its self-signed certificate), --ca-file verifies against a specific CA.

Operations running as background job on the appliance (site update, firmware update, reboot, cluster operations) are waited for, with the progress log shown on stderr. --no-wait prints the job ID instead. --json prints results as JSON. On a terminal, uploads show their progress and speed, all longer operations the time waited and, for jobs, the latest state.

cmk-appliance setting changes the settings of the device settings page, one at a time. The options not given stay as they are, e.g. setting agent --only-from 10.0.0.5 keeps the agent version. Mail and the management interface are turned off with --off.

Where the web UI asks for confirmation, the API requires an explicit acknowledgement. A refused request names the options to add, e.g.:

$ cmk-appliance site update mysite 2.4.0p1.cee
ERROR: The operation requires explicit acknowledgement. [precondition_failed]
To proceed, add: --acknowledge-site-stop

On an interactive terminal, the output is colored, e.g. errors, states and the options to add. Piped or redirected output stays plain, as does all output when the environment variable NO_COLOR is set.

cmk-appliance --help and cmk-appliance COMMAND --help list all commands.

An unexpected error of the command line client - a bug of the client, not a refused request - writes a crash report to the state directory of the user ($XDG_STATE_HOME/cmk-appliance/crashes, by default ~/.local/state/cmk-appliance/crashes). It never contains the API token. Nothing is sent automatically: cmk-appliance crash list lists the reports, cmk-appliance crash show ID shows one as it would be sent and cmk-appliance crash submit ID --name NAME --mail MAIL sends it to the crash report server of Checkmk, with your contact information in case of questions. The error message names these commands.

Library

from cmk.appliance.client import ApiError, Client

client = Client("https://appliance.example.com", token="cma_...")

print(client.info().firmware_version)

version = client.install_version("check-mk-cloud-2.4.0p1-1.7-x86_64.cma")
plan = client.plan_site_update("mysite", version)
job_id = client.update_site("mysite", version, acknowledge_site_stop=plan.site_running)
client.wait_for_job(job_id)

try:
    client.remove_version("2.3.0p1.cee")
except ApiError as e:
    print(e.status, e.code, e.message, e.details)
  • Every client method maps to one API endpoint and returns typed models (cmk.appliance.client.models). Long-running operations return a job ID; wait_for_job() polls it, wait_for_restart() follows a reboot or firmware update until the device answers again. Jobs are known on the node running them only: Address the nodes of a cluster, not the cluster IP address, to follow jobs moving it. Otherwise the waits raise OtherDeviceError.
  • Refused requests raise ApiError. Its code is part of the API contract, message is not. requires lists missing acknowledgements, job_id the running job a request conflicts with.
  • Connection problems and non-API answers (e.g. a web server error page while the appliance reboots) raise TransportError. All exceptions derive from ClientError.
  • Responses are parsed tolerantly: Fields added by newer firmware are ignored, as the compatibility rules of the API require.
  • The HTTP layer is pluggable (transport=, see Transport); the default uses urllib. Redirects are not followed, so the token is never sent to another address: Use the URL the appliance is reachable at (e.g. https:// when it redirects HTTP to HTTPS).

Uploads of Checkmk packages and firmware images are streamed from disk; on_upload_progress is called with the bytes sent and the total, e.g. to show the progress. The appliance processes them synchronously and does not answer other requests meanwhile. Like the firmware update request, which checks the staged image first, they use long_timeout instead of timeout.

Versioning

The client follows Semantic Versioning, independently of the appliance firmware. While the REST API is experimental, the client stays at 0.x: A minor release may require changes to code using it, a patch release never does. Pin the minor version, e.g. cmk-appliance-client~=0.1.0.

The public interface is what the API reference documents, plus the error codes of ApiError. Everything else, including the output of the command line client, may change in any release.

Compatibility with the appliance firmware

Which appliance features the client can use does not depend on its version but on the API revision it covers (API_REVISION, e.g. 1.0). The appliance names its own revision in every response. Firmware releases without API changes keep it, new endpoints and request fields raise its minor.

  • Older firmware: Everything the firmware knows works. The client only sends the request fields a call uses, so calls not using newer options work with older firmware as well. Using an endpoint or option the firmware does not know raises UnsupportedFeatureError, naming the API revision it needs and the one of the appliance.
  • Newer firmware: Everything works. The client warns once with OutdatedClientWarning that an update gives access to the newer features.
  • Deprecated API version: Once an API version has a stable successor, the appliance deprecates it. The client warns with ApiDeprecatedWarning, naming the planned removal and the successor. A removed version is refused with the error code api_version_removed.
  • Firmware without REST API: Raises ApiUnavailableError.

Client.api_revision and Client.api_status hold the revision and status (experimental, stable, deprecated) the appliance named last. The warnings derive from ClientWarning, so they can be filtered with the warnings module. The command line client prints them as warning: lines.

Security

Use HTTPS: The API token grants full administrative access to the appliance. The appliance serves its web interface via plain HTTP by default. Set its web access mode to "HTTPS enforced" and use an https:// URL; a bare host name like appliance.example.com means HTTPS. With an http:// URL, the client warns once with InsecureTransportWarning before it sends the token unencrypted. On a trusted network, filter it with the warnings module.

Changes

The changes of each release are described as werks, published with the werks of Checkmk: https://werks.checkmk.com/?product=cma_client

License

Copyright (C) 2026 Checkmk GmbH. Licensed under the Apache License, Version 2.0, see LICENSE.

Metadata

Release files for cmk-appliance-client 0.1.0.dev0

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

Source distribution (sdist)

Source distribution for cmk-appliance-client 0.1.0.dev0
File Size Uploaded Provenance Actions
cmk_appliance_client-0.1.0.dev0.tar.gz 53.1 kB Without provenance Details for cmk_appliance_client-0.1.0.dev0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cmk-appliance-client 0.1.0.dev0
File Interpreter ABI Platform Actions
cmk_appliance_client-0.1.0.dev0-py3-none-any.whl Python 3 none any Details for cmk_appliance_client-0.1.0.dev0-py3-none-any.whl

Total release size: 107.3 kB

Release files / cmk_appliance_client-0.1.0.dev0.tar.gz

Download URL cmk_appliance_client-0.1.0.dev0.tar.gz
Size 53.1 kB
Tags Source
SHA-256 checksum
How to use checksums
74e159e903a5de0129a4d2711a23bdb28e8d9998c670c2836c9476862aa30e1b
BLAKE2b-256 checksum
How to use checksums
4b88dcb2f76d3fcbd5d01c2200b3e7f740541c93114ffd724fa25de0f5334a3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / cmk_appliance_client-0.1.0.dev0-py3-none-any.whl

Download URL cmk_appliance_client-0.1.0.dev0-py3-none-any.whl
Size 54.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2167c37f827c633cf6291eca7ca76165d521c80d2229d7884e21d679c7c1733
BLAKE2b-256 checksum
How to use checksums
94a8cacd7f1b38f591c05f087ad25edad272242da85b52a3ae2c9b98ce34173a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.10 {"installer":{"name":"uv","version":"0.13.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for cmk-appliance-client 0.1.0.dev0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release
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