feat: surface BMC collection errors in parse-errors panel and event log
When Inspur component.log sections return {"error":"...","code":N} instead
of hardware data, the parser now:
- stores them in AnalysisResult.CollectionErrors (new model field)
- mirrors each one into result.Events with Source="BMC/<section>"
so the chart viewer event table shows the specific BMC module
- feeds them into /api/parse-errors as bmc_collection_error entries
UI adds a collapsible "Collection diagnostics" panel below the chart
iframe (outside /chart) that appears when /api/parse-errors returns
any items; resets on data clear.
Affected sections in this dump: HDD (1458), PCIe Devices (1458),
Network Adapters (1458), Disk Backplane.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -854,6 +854,28 @@ func (s *Server) handleGetParseErrors(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
// BMC-reported collection failures surfaced by vendor parsers.
|
||||
if result != nil {
|
||||
for _, ce := range result.CollectionErrors {
|
||||
msg := strings.TrimSpace(ce.Message)
|
||||
if msg == "" {
|
||||
continue
|
||||
}
|
||||
detail := ""
|
||||
if ce.Code != 0 {
|
||||
detail = fmt.Sprintf("code %d", ce.Code)
|
||||
}
|
||||
add(parseErrorEntry{
|
||||
Source: "bmc",
|
||||
Category: "bmc_collection_error",
|
||||
Severity: "warning",
|
||||
Path: ce.Section,
|
||||
Message: msg,
|
||||
Detail: detail,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
sort.Slice(items, func(i, j int) bool {
|
||||
if items[i].Severity != items[j].Severity {
|
||||
// error > warning > info
|
||||
|
||||
Reference in New Issue
Block a user