fix(inspur): parse CPUs from component.log and fix DIMM present detection
Two bugs in onekeylog archives that lack asset.json: - CPU count was always 0: ParseComponentLog never parsed the "RESTful CPU info" section. Added parseCPUInfo as a fallback when hw.CPUs is empty (asset.json remains the primary source when present). Also worked around a Go JSON case-insensitive collision between "proc_id" (int) and "PROC_ID" (string CPUID) by adding an explicit PROC_ID field with an exact-case tag. - Only 1 of 2 DIMMs shown: Present condition required mem_mod_size > 0, but some BMC firmware reports size=0 for a physically installed module while still providing serial and part number. Now treats a DIMM as present when status=1 and any of size/serial/partnum is non-empty. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2
internal/parser/vendors/inspur/parser.go
vendored
2
internal/parser/vendors/inspur/parser.go
vendored
@@ -16,7 +16,7 @@ import (
|
||||
|
||||
// parserVersion - version of this parser module
|
||||
// IMPORTANT: Increment this version when making changes to parser logic!
|
||||
const parserVersion = "1.8"
|
||||
const parserVersion = "1.9"
|
||||
|
||||
func init() {
|
||||
parser.Register(&Parser{})
|
||||
|
||||
Reference in New Issue
Block a user