Skip to main content

CWZ - CMK-Werk-Zeug

This is both a collection of tools and shared libraries created for (but not limited to) Checkmk development and a 'collector' for other tools located in different repositories.

What you get

cmk-components

A CLI for querying and validating component and code ownership details of the check_mk (mostly) repository.

Use cases:

  • Browse all components interactively (TUI, default when no subcommand is given): tui
  • List all known components: list (alias: ls)
  • Show full details of one or more components: info [COMPONENT ...]
  • Show members/owners of a component: members [COMPONENT ...]
  • Show which paths belong to a component: paths <COMPONENT> [...]
  • Look up who owns a given file or directory: owners <PATH> [...]
  • Find which component a path belongs to: component <PATH> [...]
  • List all OWNERS config files in the repo: config-files
  • Show your own responsibilities (components and paths): my-responsibilities (alias: me)
  • Validate the code-owners configuration for consistency: validate-config
  • Check overall consistency by comparing reality (git-blame and commit frequency) with defined ownership: check-plausibility

Credentials: resolved in folowing order:

  • ~/.netrc (looking for the hostname extracted from gerrit-url)
  • environment variables (via --gerrit-username-var / --gerrit-api-token-var).
  • GNOME keyring
  • interactive prompt (if not in dumb terminal mode), with option to store credentials in the keyring.

Source for ownership details: --gerrit-url, --project-name (defaults to check_mk), --branch (useful for change valildation) to point at a different Gerrit instance or branch.

Output modes (--mode): rich (default in a terminal), json, script (default when stdout is not a TTY — suitable for piping).

Caching (--cache-mode auto|always|never): a locally cached collection of component and ownership information stored at ~/.cache/cwz/cmk-components.json will be used in auto (default) mode if remote git commit still matches or when in always mode. In never mode, the cache will be ignored and updated with the latest data from Gerrit.

cmk-check-plugins

Validates Checkmk check plugins (SNMP- and agent-based) against recorded SNMP walks and agent output files, reporting section parsing, discovery, and check results.

Inputs: --snmp-walks <PATH ...> and --agent-outputs <PATH ...> point at the data files to validate against; all Checkmk plugins are loaded from the local checkout.

Filtering: --filter-sections <name,...> restricts to specific sections (case-insensitive), --ignore-walks <name,...> skips named walk files, -a/--show-all shows both detected and non-detected plugins.

Error handling: --raise-error <type,...> (empty = all) raises selected error types, --ignore-error <type,...> swallows selected exception types, --error-file [PATH] writes problematic walk paths (default errors.txt).

Output: --suppress-duration drops timing info. Results are written to results.json (section tables, discovery and check results) plus a profile_stats.prof cProfile dump.

cmk-infect

Syncs an installed site with your local checkout just by placing hard links.

  • Pro: deployment in 0s, stays in-sync automatically!
  • Con: might fail for a lot of reasons, works only for Python-only code!

Usage: cmk-infect <target_dir> [site] - target_dir is the OMD version root (e.g. /omd/versions/default); site defaults to $SITE or a local .site file. The ancestor branch (master, 2.5.0, 2.4.0, ...) and its path mapping are auto-detected.

Options: --mkp deploy into the site's local/ tree instead of the version, --copy copy instead of hardlink, --info show what would be deployed without touching files, --test sanity-check that every tracked file maps to an existing deploy path, --include <PATH ...> / --exclude <regex> restrict the file set.

Caveat: skips non-Python files, tests, and known non-deployable packages; missing ACLs on the target are offered to be fixed via sudo setfacl.

In order to avoid unnessessary conflicts, sync your checkout with your local site first:

git fetch origin `cat /opt/omd/versions/3.0.0-2026.07.21.pro/share/doc/COMMIT`
git rebase -i FETCH_HEAD

update-gerrit-changes

Shows a table of local Git commits and their sync status against remote Gerrit changes (matches a remote revision, has pending updates, or differs from all revisions).

Run inside a Checkmk Git checkout; it auto-detects the ancestor branch (master, 2.5.0, 2.4.0, …). Requires VPN connectivity and Gerrit credentials.

Options: --gerrit-url (default https://review.lan.tribe29.com), --project-name (default check_mk), --branch (default master), --gerrit-username-var / --gerrit-api-token-var (env var names), --store-credentials (persist to keyring), plus the common logging args (-l/--log-level, --log-file).

worklog-from-fs (a.k.a. forgot-to-track-time-again)

Estimates daily 'computer usage' by scanning filesystem modification timestamps and rendering a 20-day activity graph (time range and intensity per day).

Usage: takes one optional positional <path> to scan (defaults to ~). Browser caches and Signal data are excluded to reduce noise; only files modified within the current year are considered.

ci-build-metrics

Fetches finished Jenkins build logs and extracts queryable CI build metrics into a PostgreSQL database.

Subcommands:

  • fetch (f) — fetch build info and logs of completed Jenkins builds and store them compressed locally.
  • create-digests (d) — extract critical data about (mostly failed) builds into digest files.
  • index — build an index dataset of static query data (e.g. timestamps) for fast lookup.
  • fuse — enrich digests by inferring upstream/downstream relationships and combining build causes.
  • export (e) — export all digest data to PostgreSQL.
  • update — convenience pipeline running fetch → create-digests → index → fuse → export.
  • info (i) — print detailed info about specific builds.
  • report — generate a queryable report of builds matching filter criteria.
  • spreadsheet — render report data into an ODF spreadsheet.
  • issue-figures — show usage stats for each regex in the known-issues file.

Common filters: --date-from / --date-to (default --date-from is last Saturday), --include <regex> / --exclude <regex>, --max-results <N>, --rebuild / --refresh, -v/--verbose, --markdown.

Config & storage: --jenkins-url (default https://ci.lan.tribe29.com), --base-dir (default ~/.cache/ci_metrics), --builds-dir, --max-processes (default 10), --known-issues-file (YAML mapping regexes to issue metadata, default known_issues.yaml), --report-file, --failed-builds-file. Jenkins credentials come from the common Jenkins CLI args (env/config); export targets a local PostgreSQL instance (see Install).

Install

You either clone the cwz repository (ssh://review.lan.tribe29.com:29418/cmk-werk-zeug) and make it's tools available via uv or you install the pip package:

pipx install cmk-werk-zeug

For ci_build_metrics you need PostgreSQL installed

sudo apt install postgresql postgresql-contrib postgresql-server-dev

Release files for cmk-werk-zeug 0.4.2

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-werk-zeug 0.4.2
File Size Uploaded
cmk_werk_zeug-0.4.2.tar.gz 278.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cmk-werk-zeug 0.4.2
File Interpreter ABI Platform
cmk_werk_zeug-0.4.2-py3-none-any.whl Python 3 none any Details

Total release size: 446.8 kB

Release files / cmk_werk_zeug-0.4.2.tar.gz

Download URL cmk_werk_zeug-0.4.2.tar.gz
Size 278.8 kB
Tags Source
SHA-256 checksum
How to use checksums
11da36be475d58db5bf514d423ed6a03f2c3f3cdc1afe3b99d78ae62037a7d4d
BLAKE2b-256 checksum
How to use checksums
03bfa7c78ed10006da8dae1790bed4f42fec61cfdd77bbe1536a7a856d20c61c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","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_werk_zeug-0.4.2-py3-none-any.whl

Download URL cmk_werk_zeug-0.4.2-py3-none-any.whl
Size 167.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
61d1df17078f77825c38bd512b0aa97d883d6342d16d746e273b9e68095b3b88
BLAKE2b-256 checksum
How to use checksums
e757403aa550bfb14191b27b1277062709ceda22efbfd701d0e99a72e6d813f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","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 history Release notifications | RSS feed

0.4.4

2 release files

0.4.3

2 release files

This release

0.4.2 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

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