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.

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).

activity-from-fs

Estimates daily working activity 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.7.tar.gz (2.6 MB 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.7-py3-none-any.whl (82.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cmk_werk_zeug-0.3.7.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • 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.7.tar.gz
Algorithm Hash digest
SHA256 b8ad5210e4ad247f89bff677cbe45098f6e312a03e0c52bda533c08011237192
MD5 670606d259b188b4c6911c735b15382d
BLAKE2b-256 c852fe04a6510f0d31c6a139342b60759f48f9b1a16b20077adf49d9fbb260f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cmk_werk_zeug-0.3.7-py3-none-any.whl
  • Upload date:
  • Size: 82.2 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c75a84494a99c6dfd44802fba6cfc497ea7ed8d83c8fd4dde095aa68303e4419
MD5 777cfaded1f63f4518323bc683687efa
BLAKE2b-256 200e5b750cbd9d7798dde3329517160db18cbb604e17fc5b6757f3dc9b02fa33

See more details on using hashes here.

Release history Release notifications | RSS feed

0.4.0

2 files

0.3.8

2 files

This release

0.3.7 This release

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