Report the Windows processor model in passive inventory

This commit is contained in:
2026-11-17 21:41:07 +01:00
parent 0fd3053adf
commit aeb9adc649
+11 -2
View File
@@ -79,8 +79,17 @@ fn hardware() -> Result<Value> {
&& memory.dwMemoryLoad <= 100,
"NATIVE_HARDWARE_QUERY"
);
let cpu_model = open(
HKEY_LOCAL_MACHINE,
r"HARDWARE\DESCRIPTION\System\CentralProcessor\0",
KEY_WOW64_64KEY,
)
.ok()
.and_then(|key| text(key.0, "ProcessorNameString").ok().flatten())
.map(|name| name.trim().to_owned())
.filter(|name| !name.is_empty());
Ok(
json!({"logical_processors_visible":system.dwNumberOfProcessors,
json!({"cpu_model":cpu_model, "logical_processors_visible":system.dwNumberOfProcessors,
"memory_total_bytes":memory.ullTotalPhys,"memory_available_bytes":memory.ullAvailPhys,
"memory_load_percent":memory.dwMemoryLoad}),
)
@@ -188,7 +197,7 @@ pub fn observations() -> Vec<Value> {
[
(
"windows.hardware",
"windows.win32:GetNativeSystemInfo+GlobalMemoryStatusEx",
"windows.win32:GetNativeSystemInfo+GlobalMemoryStatusEx;registry:CentralProcessor",
hardware as Provider,
),
(