fix(parser): support Inspur onekeylog per-file component/*.txt D-Bus layout
Some onekeylog BMC firmware variants split the combined component.log into per-file D-Bus GetAll transcripts under component/ (e.g. PowerSupplyInfo.txt, FanInfo.txt), which the inspur parser did not read, leaving PSU and fan data empty. Add a GETALL block parser and wire it as a fallback for PSU and fan telemetry when component.log is absent; document the layout and known gaps in bible-local. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
4ce0251ce4
commit
5677c49998
+19
-1
@@ -16,7 +16,7 @@ import (
|
||||
|
||||
// parserVersion - version of this parser module
|
||||
// IMPORTANT: Increment this version when making changes to parser logic!
|
||||
const parserVersion = "2.1"
|
||||
const parserVersion = "2.2"
|
||||
|
||||
func init() {
|
||||
parser.Register(&Parser{})
|
||||
@@ -59,6 +59,14 @@ func (p *Parser) Detect(files []parser.ExtractedFile) int {
|
||||
if strings.Contains(path, "component/component.log") {
|
||||
confidence += 15
|
||||
}
|
||||
// Per-file component/ variant (no combined component.log), e.g. dumps
|
||||
// named dump_<serial>_<timestamp>/ rather than onekeylog/.
|
||||
if strings.HasSuffix(path, "onekeylog_dreport.log") {
|
||||
confidence += 25
|
||||
}
|
||||
if strings.Contains(path, "component/powersupplyinfo.txt") {
|
||||
confidence += 15
|
||||
}
|
||||
|
||||
// Check for asset.json with Inspur-specific structure
|
||||
if strings.HasSuffix(path, "asset.json") {
|
||||
@@ -183,6 +191,16 @@ func (p *Parser) Parse(files []parser.ExtractedFile) (*models.AnalysisResult, er
|
||||
Description: desc,
|
||||
})
|
||||
}
|
||||
} else {
|
||||
// Some onekeylog BMC variants split component.log into per-file
|
||||
// D-Bus transcripts under component/ instead of one combined log.
|
||||
if f := parser.FindFileByName(files, "PowerSupplyInfo.txt"); f != nil {
|
||||
ParseComponentDirPowerSupply(f.Content, result.Hardware)
|
||||
}
|
||||
if f := parser.FindFileByName(files, "FanInfo.txt"); f != nil {
|
||||
fanSensors := ParseComponentDirFan(f.Content)
|
||||
result.Sensors = mergeSensorReadings(result.Sensors, fanSensors)
|
||||
}
|
||||
}
|
||||
|
||||
// Enrich runtime component data from Redis snapshot (serials, FW, telemetry),
|
||||
|
||||
Reference in New Issue
Block a user