Documentation
¶
Overview ¶
Package inventory provides lightweight system inventory collection using standard Linux interfaces (/proc, /etc, standard tools) without requiring osquery. Command-backed collectors run through an injected exec.Runner.
r, _ := exec.NewRunner(exec.Direct) inv, _ := inventory.New(r) sys, _ := inv.System(ctx)
Status: SDK-resident, single-consumer today (the agent's connect-time inventory snapshot). The package lives in the SDK rather than under agent/internal/sys because the planned server-side compliance preview needs the same parsers. F027 in TECH_DEBT_AUDIT.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector interface {
System(ctx context.Context) (*SystemInfo, error)
OS() (*OSInfo, error)
Disks(ctx context.Context) ([]DiskInfo, error)
NetworkInterfaces(ctx context.Context) ([]NetworkInterface, error)
}
Collector gathers system inventory. Command-backed methods run through the injected Runner; OS() is a pure /etc/os-release read.
type DiskInfo ¶
type DiskInfo struct {
Device string // e.g. "/dev/sda"
Size string // e.g. "500G" (human-readable from lsblk)
Type string // e.g. "disk", "part"
Mount string // e.g. "/"
}
DiskInfo holds block device information.
type NetworkInterface ¶
type NetworkInterface struct {
Name string
MAC string
Addresses []string // e.g. ["192.168.1.100/24", "fe80::1/64"]
State string // "UP" or "DOWN"
}
NetworkInterface holds network interface details.
type OSInfo ¶
type OSInfo struct {
Name string // e.g. "Fedora Linux"
Version string // e.g. "43"
ID string // e.g. "fedora"
PrettyName string // e.g. "Fedora Linux 43 (Workstation Edition)"
VersionID string // e.g. "43"
Arch string // e.g. "x86_64" (runtime.GOARCH)
}
OSInfo holds operating system identification details.