Go to file
2025-05-01 10:32:49 +00:00
cmd/sysinfo initial 2025-05-01 03:07:12 -07:00
internal/sysinfo latest 2025-05-01 03:25:38 -07:00
go.mod initial 2025-05-01 03:07:12 -07:00
go.sum initial 2025-05-01 03:07:12 -07:00
Makefile latest 2025-05-01 03:11:54 -07:00
README.md Update README.md 2025-05-01 10:32:49 +00:00

sysinfo

sysinfo captures a point-in-time snapshot of block devices, ZFS pools, network interfaces, sensors, installed packages, and other host metadata. It writes a structured tree to /etc/sysinfo/ and also produces a single JSON document.


Quick install & run (Go 1.22 or newer)

# install the latest tagged build into $GOBIN
go install -v git.eeqj.de/sneak/sysinfo/cmd/sysinfo@latest

# generate a snapshot
sudo sysinfo

Check the embedded version string:

sysinfo --version

Typical usage

sudo sysinfo                 # write /etc/sysinfo + snapshot.json
sudo sysinfo --force         # overwrite existing snapshot
sudo sysinfo --json > out.json   # JSON to stdout only
  • On first run, required utilities (e.g. smartctl, zfsutils-linux, lm-sensors) are installed automatically via apt-get with DEBIAN_FRONTEND=noninteractive.
  • Collectors run only when their prerequisites are met (e.g. the ZFS collector runs only if zpool is present).
  • Only ubuntu is supported for now.

Building from source

git clone https://git.eeqj.de/sneak/sysinfo.git
cd sysinfo
make build      # builds ./sysinfo with embedded version
sudo ./sysinfo

make install installs the tool to $GOBIN.


Snapshot layout (example)

/etc/sysinfo/
├── snapshot.json
├── system/
├── blockdevs/
├── network/
├── sensors/
├── packages/
└── zfs/

snapshot.json contains the same data flattened into a single file; the directories mirror the JSON hierarchy for easy inspection.


Notes

  • Developed and tested on Ubuntu 22.04+. Additional distros can be supported by implementing new PackageManager back-ends.
  • No telemetry or external network access is performed other than an IP geolocation lookup (curl https://ipinfo.io) on default interfaces.

PRs and patches are welcome.