New feature examples (1.1–1.3)
The following examples are real YAML check configurations, validated using --validate --strict. CLI-only operations such as --diff, --list-checks, --self-test, --version and baseline management require commands in addition to YAML. All paths below are relative to the unpacked project root.
1. Inspect the runtime without network access
python3 ipsonic-probe.py --version
python3 ipsonic-probe.py --self-test
2. Validate, explain and preview a check
python3 ipsonic-probe.py --validate --strict examples/140-strict-validation.yaml
python3 ipsonic-probe.py --explain examples/139-operations-ownership-runbook.yaml
python3 ipsonic-probe.py --dry-run examples/141-total-timeout-budget.yaml
These commands do not open network connections. --strict catches unknown keys and some literal secrets. The timeouts.total budget is a wait limit, not a guarantee of forced cancellation of underlying network threads.
3. Handle API credentials using environment variables
142 – API token from environment uses auth.token_env rather than embedding a secret. Replace the example domain with your own endpoint. Supply the token through a secure runtime mechanism; avoid putting credentials in shell history or scripts.
python3 ipsonic-probe.py --validate --strict examples/142-api-token-from-environment.yaml
# Run only after configuring a real endpoint and securely setting IPSONIC_API_TOKEN.
4. Check inventory and run a directory
The --list-checks command accepts a directory and exports metadata. For an isolated directory check, copy only the two batch examples:
mkdir -p /tmp/ipsonic-demo-checks
cp examples/143-directory-check-web.yaml examples/144-directory-check-ssh.yaml /tmp/ipsonic-demo-checks/
python3 ipsonic-probe.py --list-checks /tmp/ipsonic-demo-checks --format tsv
python3 ipsonic-probe.py --list-checks /tmp/ipsonic-demo-checks --format json
python3 ipsonic-probe.py --check-dir /tmp/ipsonic-demo-checks
The two localhost services may not be running. A non-OK result is expected in that case. Directory execution is sequential and non-recursive.
5. Test output contracts
145 – Monitoring output contract demonstrates a check suitable for monitoring plugin output.
python3 ipsonic-probe.py --output nagios examples/145-monitoring-output-contract.yaml
python3 ipsonic-probe.py --output icinga2 examples/145-monitoring-output-contract.yaml
python3 ipsonic-probe.py --output checkmk examples/145-monitoring-output-contract.yaml
python3 ipsonic-probe.py --output json examples/145-monitoring-output-contract.yaml
Plugin exit codes are 0 OK, 1 WARNING, 2 CRITICAL, 3 UNKNOWN. On non-OK checks, configured owner and runbook details are included in the human-readable monitoring message.
6. Save and compare a baseline
146 – Local SSH status baseline:
python3 ipsonic-probe.py examples/146-baseline-local-ssh.yaml --baseline-save /tmp/ipsonic-ssh-baseline.json
python3 ipsonic-probe.py examples/146-baseline-local-ssh.yaml --baseline-compare /tmp/ipsonic-ssh-baseline.json
Saving requires a successful check and will not silently overwrite an existing file. The baseline records status and stable assertion IDs, not DNS answer sets, HTTP headers, or TLS certificate fingerprints. Store the baseline securely and review changes before accepting a new one.
7. Review configuration changes offline
python3 ipsonic-probe.py --diff examples/147-diff-before.yaml examples/148-diff-after.yaml
The diff demonstrates a changed timeout, failure severity and ownership metadata. Exit code 1 indicates a difference, not a connectivity failure. Typical secret fields are masked; do not rely on the diff as a comprehensive secret scanner.
8. Validate before Ansible deployment
- name: Validate ipsonic-probe configuration offline
ansible.builtin.command:
argv:
- /usr/bin/python3
- /opt/ipsonic-probe/ipsonic-probe.py
- --validate
- --strict
- /etc/ipsonic-probe/api.yaml
changed_when: false
See Ansible installation and Operator Workflow for the deployment context.
9. Verify release artifacts
Set VERSION to the published release identifier before running these commands.
sha256sum -c ipsonic-probe-${VERSION}.tar.gz.sha256
python3 -m json.tool ipsonic-probe-${VERSION}.tar.gz.manifest.json
The manifest includes the artifact name, release version, SHA-256 and reproducible-build metadata. Checksum verification detects accidental changes; it does not authenticate the publisher without a separately trusted digest or signature.