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 fetchcreate-digestsindexfuseexport.
  • 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cmk_werk_zeug-0.3.8.tar.gz (206.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cmk_werk_zeug-0.3.8-py3-none-any.whl (99.3 kB view details)

Uploaded Python 3

File details

Details for the file cmk_werk_zeug-0.3.8.tar.gz.

File metadata

  • Download URL: cmk_werk_zeug-0.3.8.tar.gz
  • Upload date:
  • Size: 206.3 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for cmk_werk_zeug-0.3.8.tar.gz
Algorithm Hash digest
SHA256 49e4b0faf9807483e8757e9835070301c99322cb8afd79168681bb756bb0e87f
MD5 272b8c1614f882128571e48bb18b4231
BLAKE2b-256 3dcdb9ce05f4ac11985933324c6bf1cd171122bff69ea739a39f7f8028f17083

See more details on using hashes here.

File details

Details for the file cmk_werk_zeug-0.3.8-py3-none-any.whl.

File metadata

  • Download URL: cmk_werk_zeug-0.3.8-py3-none-any.whl
  • Upload date:
  • Size: 99.3 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for cmk_werk_zeug-0.3.8-py3-none-any.whl
Algorithm Hash digest
SHA256 932e4e5bcab376ff057e999a09d586319e816300c50c6b81a2ce5682189d9ab0
MD5 7598d1e245be60e175c7c0f71e06afa8
BLAKE2b-256 0553100471dbf98ced148b7cfdde2b891252ba74c3fc0d2c7c95c60ec22a64cb

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.0

2 files

This release

0.3.8 This release

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 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