diff --git a/orchestration/ansible/roles/inventory-cli/files/inventory-cli b/orchestration/ansible/roles/inventory-cli/files/inventory-cli index 67cbe89..31cf7f8 100755 Binary files a/orchestration/ansible/roles/inventory-cli/files/inventory-cli and b/orchestration/ansible/roles/inventory-cli/files/inventory-cli differ diff --git a/services/device-inventory/src/client/discovery.cpp b/services/device-inventory/src/client/discovery.cpp index 2f58eb6..3e1ffcc 100644 --- a/services/device-inventory/src/client/discovery.cpp +++ b/services/device-inventory/src/client/discovery.cpp @@ -41,6 +41,10 @@ Discovery::parse_dmi(const std::string& type_num) { return {}; // dmidecode not available on macOS; callers check __APPLE__ #else std::string output = run_cmd("dmidecode -t " + type_num + " 2>/dev/null"); + // Without root, dmidecode outputs only a header comment with no Handle blocks. + // If no "Handle " lines appear, retry transparently with sudo. + if (output.find("Handle ") == std::string::npos) + output = run_cmd("sudo dmidecode -t " + type_num + " 2>/dev/null"); if (output.empty()) return {}; std::vector> result;