build-cli.sh
Simple shell script that builds inventory-cli inside Docker and
extracts the binary to build/ (or a custom path). Replaces the
need to use the heavier build-and-load.sh just to compile the CLI.
--help
Replaced the terse usage() stub with a full UNIX man-page style
reference covering NAME, SYNOPSIS, DESCRIPTION, GLOBAL OPTIONS,
COMMANDS (grouped by area), PART TYPES, FIELD KEYS, EXAMPLES,
and NOTES.
discover-only [--type <type>]
New command that runs local hardware discovery without contacting
the inventory server and prints results as an ASCII tree rooted at
the hostname. Each section (CPUs, CPU Slots, Memory Sticks, Memory
Slots, Disks, NICs) lists discovered components with key attributes
inline. Useful for inspection and troubleshooting.
discovery.cpp: store interface name in K_NAME for NICs
ifname (e.g. "nic0", "eno1") is now emitted so discover-only and
the server-side UI can display the kernel device name.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add Hook interface (filter + execute contract) in server/hooks/hook.h
- Add HookRunner in server/hooks/hook_runner.h: spawns a detached thread
per matching hook, with try/catch protection against crashes
- Add DnsUpdaterHook in server/hooks/dns_updater_hook.{h,cpp}:
triggers on server name changes, logs in to Technitium, deletes the
old A record (ignores 404), and adds the new A record
Config via env vars: TECHNITIUM_HOST/PORT/USER/PASS/ZONE, DNS_TTL
- Add Database::get_nics_for_server() to resolve a server's IPv4 address
- Wire HookRunner into InventoryServer; cmd_edit_server now fires hooks
with before/after Server snapshots
- Update CMakeLists.txt to include dns_updater_hook.cpp
- Document env vars in Dockerfile
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>