Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.

🩺 medic

CI License: MIT

A small health-check CLI. Use it as a checkpoint in a pipeline (exit code + JUnit), as a one-off diagnostic, or as a live terminal monitor (--watch). No server, no daemon.

medic reports problems; it does not fix them.

medic running a staged check suite: one failure, a skipped dependent check, and a remediation hint

Checks

Type What it verifies
system CPU, load, memory, swap, disk per mount, uptime
ping ICMP reachability, packet loss, RTT (uses the system ping)
tcp Port reachability, connect latency, optional banner
http Status code, latency, body substring, TLS verification
tls Certificate expiry (days left), issuer, SANs, protocol
ssh Daemon reachability, protocol/banner, optional key auth
dns Name resolution, optional expected addresses
exec Run a command; pass on expected exit code / output

Install

pipx install git+https://github.com/Rogsiel/medic.git
# or from a clone
pip install .

Requires Python 3.10+. Enable shell completion (bash, zsh, fish) with:

medic --install-completion

Quick start

medic                                   # local system checks only (no network)
medic --all                             # + internet reachability (ping, HTTP, TLS)
medic --tcp db:5432 --http https://api.example.com/health --http-match ok
medic --tls example.com --tls-warn-days 30 --tls-crit-days 7
medic --dns example.com --exec "pg_isready -h db"
medic --system --disk / --disk /var --cpu-threshold 70,90 --ram-threshold 80,95

Run medic --help for every flag.

Pipelines and CI

Exit codes: 0 healthy, 1 a check failed (or warned, with --fail-on warning), 2 bad config.

Declare checks in TOML. Checks with a higher stage are skipped if any lower stage fails, which gives you checkpoint semantics:

# medic.toml
[settings]
timeout = 6
fail_on = "failure"        # or "warning"

[[check]]
type = "tcp"
target = "db:5432"
stage = 0

[[check]]
type = "http"
name = "API"
url = "https://api.example.com/health"
expect_status = [200]
match = "ok"
stage = 1
medic --config medic.toml --format junit > medic.xml

Check keys by type:

Type Keys
system disks, cpu, ram, disk_threshold (each [warn, crit])
ping host, count
tcp target (host:port) or host + port
http url, method, expect_status, match, verify_ssl, headers
tls target or host + port, warn_days, crit_days
ssh target, user, key, auth
dns host, expect
exec command, expect_exit, match, shell, cwd

All checks also accept name, stage, timeout, enabled. Explicit CLI flags override [settings]. Unknown types or keys are rejected.

Every check is bounded by its timeout (+2s grace). A hung check is reported as failed instead of blocking the run. --stop-on-failure runs sequentially and stops at the first failure.

GitHub Actions example:

- run: pipx install git+https://github.com/Rogsiel/medic.git
- run: medic --config medic.toml --format junit > medic.xml

Watch mode

medic --config medic.toml --watch 5

Re-runs every 5 seconds and redraws the report. Status transitions (e.g. passed -> failed) are logged to stderr as [change] .... Ctrl-C exits with the last run's exit code.

Output formats

--format rich (default), text, compact, json, junit.

Development

pip install -e '.[dev]'
pytest
ruff check .
mypy medic

License

MIT

Metadata

Release files for medic-cli 0.1.1

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

Source distribution (sdist)

Source distribution for medic-cli 0.1.1
File Size Uploaded Provenance Actions
medic_cli-0.1.1.tar.gz 43.5 kB With provenance Details for medic_cli-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for medic-cli 0.1.1
File Interpreter ABI Platform Actions
medic_cli-0.1.1-py3-none-any.whl Python 3 none any Details for medic_cli-0.1.1-py3-none-any.whl

Total release size: 88.9 kB

Release files / medic_cli-0.1.1.tar.gz

Download URL medic_cli-0.1.1.tar.gz
Size 43.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4a88b823ed8f19f5ed3a266288f32e5e24c6a1375cf69af02cdd165f01b39353
BLAKE2b-256 checksum
How to use checksums
6f4fe0e177ef4a1a1b57a4c946ef247d2df355d194c7a73dc11d33d7ab80c831
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Release files / medic_cli-0.1.1-py3-none-any.whl

Download URL medic_cli-0.1.1-py3-none-any.whl
Size 45.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ef7932967daadccb86205f989ce4c17f8bdb9f0c5293298e599945981c9884e8
BLAKE2b-256 checksum
How to use checksums
2c65f5e7b6fbee4f5bb840cad4d5c483dd1ac287ab0aa01a1b9a87bb264bd528
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

Security for medic-cli 0.1.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for medic_cli-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.

Transparency log

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