homelab/services/device-inventory/instructions.md
Dan V e1a482c500 feat(device-inventory): add hooks system and DNS updater hook
- 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>
2026-03-24 14:58:36 +01:00

19 lines
No EOL
1.4 KiB
Markdown

need the following changes:
models: create a template class for parts.
All parts have a partId, nullable serialnumber, last-updated (unix ts in seconds)
Specialized classes:
Memory stick - speed, size, manufacturer, single/dual/quadruple channel, others
Memory slot - allowed speed, allowed size, installed memory stick
cpu - name, manufacturer, speed, cores, threads
cpu slot - form factor, installed cpu
disk - manufacturer, age (since production if possible), generation, model, connection type, connection speed, disk speed, disk size, type (ssd, hdd, virtual, etc), current partitions sizes, partition ids (like sda1 for /dev/sda), and which vms or servers have access to it, by hostname and id.
network card - manufacturer, model, age, connection type, connection speed, mac address, ip address(es), whether it's manual or dhcp
The cli should:
1. be able to extract all this information and submit to server. Must also be able to edit any of the fields. Must be able to add/remove parts from servers.
2. be able to add/edit/remove servers and part types (like "memory stick", "cpu", etc)
3. be able to list all servers, part types, and parts of a server.
4. be able to just discover and update one part at a time, or all at once. Like `./inventory-cli discover --part-type memory` -> reports back to server all data about memory sticks, memory slots, etc.
deployment:
this will be deployed on all servers, and it will need to report back every day.