The vmic binary produces system reports from the registered collectors in this workspace. Reports can be rendered in Markdown, JSON, and HTML, and the CLI exposes options to tune time ranges, thresholds, and output locations.
- Build a static Linux binary (musl):
- One-time:
rustup target add x86_64-unknown-linux-musl - Build:
cargo build --release - Binary:
target/x86_64-unknown-linux-musl/release/vmic
- One-time:
- Run locally and print JSON:
cargo run -- --format json - Run with multiple formats to files:
vmic --format markdown,html --output-dir ./reports
The workspace targets Rust 2024 (rustc 1.90+). Static linking is enforced via .cargo/config.toml.
VMIC ships modular collectors that each contribute a section to the report. Most degrade gracefully (status degraded) when a tool or permission is missing.
os— Operating System:/etc/os-release, kernel release/version and machine.proc— Processes and Resources: load averages, host/cgroup memory, swap, zram, top processes.storage— Storage Overview: mounted filesystems, inode usage, Docker data-root summary, largest directories/logs.network— Network Overview: interface counters, listening sockets, process/container association and insights.services— System Services:systemdunit status summary (systemctl).users— Local Users:/etc/passwdand privileged group membership.cron— Scheduled Jobs:/etc/crontaband/etc/cron.dentries.journal— systemd journal: recent events (journalctl). Enabled by default through thejournalfeature.docker— Docker Containers: engine info, containers, metrics and storage breakdown (usesbollard).containers— Alternative Containers: presence and versions ofpodman,nerdctl, orctr.sar— Sysstat Metrics: CPU averages fromsar -u 1 1.
Notes and prerequisites:
journaltypically requires root or membership in thesystemd-journalgroup.servicesrequiressystemctl(systemd-based hosts).dockerrequires access to the Docker daemon (root ordockergroup). When unavailable, the section degrades and reports an unavailable engine.sarrequires thesysstatpackage; otherwise the section degrades with an explanatory note.
Static builds are the default:
rustup target add x86_64-unknown-linux-musl
cargo build --release
# resulting binary:
./target/x86_64-unknown-linux-musl/release/vmicDeveloper commands:
cargo test --workspace— run all unit tests.cargo clippy --workspace --all-targets -- -D warnings— lint; treat warnings as errors.cargo fmt— format code (Rust 2024 edition).cargo run -- --format json— execute CLI locally.
The JSON output conforms to schemas/vmic-report.schema.json and includes a top-level metadata.health_digest with an overall severity and individual findings.
vmic [OPTIONS]If no options are provided the tool prints a Markdown report to stdout.
| Option | Description |
|---|---|
--format <fmt>[,<fmt>...] (alias --formats) |
One or more formats to generate. Accepted values: markdown, json, html. Defaults to markdown. Repeat the flag or provide a comma-separated list to emit multiple formats in one run. When multiple formats are requested, or when HTML is requested, the results are written to files. |
--output-dir <PATH> |
Directory where file outputs are stored. Defaults to the current working directory for formats that need files (html or multi-format runs). The directory is created if it does not exist. |
- Markdown / JSON
- With a single format and no
--output-dir, content is printed to stdout. - When multiple formats are requested or
--output-diris set, the artifact is saved asvmic-report-<UTC timestamp>.md/.jsoninside the output directory.
- With a single format and no
- HTML
- Rendered as a human-friendly dashboard: key metrics appear as tables and bullet lists organised by section, the health digest sits at the top, and there is no raw JSON.
- Always saved to
vmic-report-<UTC timestamp>.htmlin the output directory (default: current directory).
Example:
vmic --format markdown,html --output-dir ./reportsProduces reports/vmic-report-<timestamp>.md and .html, and prints a confirmation for each file.
- Markdown is rendered with
templates/report.md(Askama) and includes a critical health digest followed by JSON sections. - HTML uses
templates/report.htmland renders a dashboard with a sticky header, table of contents, status coloring, and per-section summaries, notes, key-values, tables, and lists. HTML is always written to a file.
| Option | Description |
|---|---|
--since <SINCE> |
Passes the value as --since to collectors that support it (currently the journald module). Accepts any string understood by journalctl, for example "-2h", "yesterday", or an RFC 3339 timestamp ("2025-01-01T00:00:00Z"). |
Example:
vmic --since "-6h" --format jsonYou can tune the global health digest without recompiling:
| Option | Default | Description |
|---|---|---|
--digest-disk-warning <PERCENT> |
90 |
Warn when a mount exceeds this percentage of capacity. Accepts percentages (e.g. 85) or ratios (e.g. 0.85). |
--digest-disk-critical <PERCENT> |
95 |
Flag a mount as critical when usage meets or exceeds this percentage/ratio. |
--digest-memory-warning <PERCENT> |
10 |
Warn when available memory drops below this percentage of total. |
--digest-memory-critical <PERCENT> |
5 |
Flag available memory as critical below this percentage of total. |
The same thresholds can be set with environment variables prior to execution (CLI flags take precedence):
VMIC_DIGEST_DISK_WARNINGVMIC_DIGEST_DISK_CRITICALVMIC_DIGEST_MEMORY_WARNINGVMIC_DIGEST_MEMORY_CRITICAL
Values support either 0-100 (percent) or 0.0-1.0 (ratio) ranges.
Example:
VMIC_DIGEST_DISK_WARNING=80 VMIC_DIGEST_DISK_CRITICAL=90 \
vmic --format markdown,json --output-dir ./reportsjournal— enables the journald collector (default). To build without it:cargo build --no-default-features.
- Linux hosts are supported (uses
/proc,systemdtools, and musl static linking). - Some collectors require elevated permissions (e.g.,
journal,docker). When permissions are insufficient, sections degrade with explanatory notes.
vmic returns a non-zero exit code if any collector fails catastrophically (for example when the binary cannot execute journalctl).
Use vmic --help to print the up-to-date usage generated by clap.
Releases are orchestrated by release-please and cargo-dist:
- Pushes to
masterwith conventional commits keep a release PR open. Merging that PR tags the repository (tag formatvX.Y.Z) and creates a GitHub Release. Configure a personal access token (RELEASE_PLEASE_TOKEN) withcontents:writepermissions in the repository secrets so the tag push triggers downstream workflows. - Tag pushes (
v*) run the cargo-dist workflow, producingx86_64-unknown-linux-muslarchives intarget/distand uploading them to the GitHub Release alongside checksums. - To dry-run the pipeline locally, install
cargo-distand executecargo dist plan.
Forcing a specific version:
- Add a commit included in the next release with the footer
release-as: X.Y.Z(for example, commit message body containsrelease-as: 0.2.3). release-please will set Cargo.toml, manifest, the tag and Release to that version.