fix(topology): attach HPE DIMMs and RAID member disks; import easy-bee event logs
HPE DL380 Gen11 BEE-SP v14.23 blackbox bundle (ADL-077): - topology: accept "PROC n" DIMM locators, show the storage controller filtered from the export by ADL-062 when disks resolve to it, resolve storcli EID:Slt drives via VD -> OS drive -> controller BDF, hide BMC VGA, label numeric PSU slots "PSU n" - easy_bee: parse SEL / dmesg -T event times, keep message_id and component_ref, pass platform_config through - exporter: map ipmi-sel -> bmc and dmesg/kernel -> host in event_logs - privacy: treat journald/syslog kernel lines as noise (linux.it false positive) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9f5f7a98be
commit
ff5b99fa5c
15 files changed
+349
-42
No files matched your search
+22
-12
@@ -11,7 +11,7 @@ import (
|
||||
"git.mchus.pro/mchus/logpile/internal/parser"
|
||||
)
|
||||
|
||||
const parserVersion = "1.2"
|
||||
const parserVersion = "1.3"
|
||||
|
||||
func init() {
|
||||
parser.Register(&Parser{})
|
||||
@@ -124,6 +124,7 @@ func (p *Parser) Parse(files []parser.ExtractedFile) (*models.AnalysisResult, er
|
||||
NetworkCards: append([]models.NIC(nil), snapshot.Hardware.NetworkCards...),
|
||||
NetworkAdapters: normalizeNetworkAdapters(snapshot.Hardware.NetworkAdapters),
|
||||
PowerSupply: normalizePSUSlots(snapshot.Hardware.PowerSupply),
|
||||
PlatformConfig: snapshot.Hardware.PlatformConfig,
|
||||
},
|
||||
}
|
||||
result.TopologyEvidence = collectTopologyEvidence(files)
|
||||
@@ -171,6 +172,8 @@ func collectTopologyEvidence(files []parser.ExtractedFile) *models.TopologyEvide
|
||||
e := &models.TopologyEvidence{
|
||||
DIMMType17: read("dmidecode-type17.txt"),
|
||||
StorageMap: read("storage-controllers.txt"),
|
||||
StorcliVDs: read("storcli64-vds.json"),
|
||||
StorcliDrives: read("storcli64-drives.json"),
|
||||
NVIDIAQueryCSV: read("nvidia-smi-query-fresh.csv", "nvidia-smi-query.csv"),
|
||||
NVIDIATopology: read("nvidia-smi-topo-fresh.txt", "nvidia-smi-topo.txt"),
|
||||
NVLinkStatus: read("nvidia-smi-nvlink-status-fresh.txt", "nvidia-smi-nvlink-status.txt"),
|
||||
@@ -220,6 +223,7 @@ type beeHardware struct {
|
||||
PowerSupply []models.PSU `json:"power_supplies,omitempty"`
|
||||
Sensors beeSensorGroups `json:"sensors,omitempty"`
|
||||
EventLogs []beeEventLog `json:"event_logs,omitempty"`
|
||||
PlatformConfig map[string]any `json:"platform_config,omitempty"`
|
||||
}
|
||||
|
||||
type beeSensorGroups struct {
|
||||
@@ -290,12 +294,13 @@ type beeInterface struct {
|
||||
}
|
||||
|
||||
type beeEventLog struct {
|
||||
Source string `json:"source,omitempty"`
|
||||
EventTime string `json:"event_time,omitempty"`
|
||||
Severity string `json:"severity,omitempty"`
|
||||
MessageID string `json:"message_id,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
RawPayload map[string]any `json:"raw_payload,omitempty"`
|
||||
Source string `json:"source,omitempty"`
|
||||
EventTime string `json:"event_time,omitempty"`
|
||||
Severity string `json:"severity,omitempty"`
|
||||
MessageID string `json:"message_id,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
ComponentRef string `json:"component_ref,omitempty"`
|
||||
RawPayload map[string]any `json:"raw_payload,omitempty"`
|
||||
}
|
||||
|
||||
type manifestMetadata struct {
|
||||
@@ -441,15 +446,16 @@ func convertEventLogs(items []beeEventLog) []models.Event {
|
||||
if message == "" {
|
||||
continue
|
||||
}
|
||||
ts := parseEventTime(item.EventTime)
|
||||
rawData := strings.TrimSpace(item.MessageID)
|
||||
// The snapshot's is_active is bee's own "latest record per sensor"
|
||||
// guess, not an active-alarm snapshot, so it is not imported (ADL-072).
|
||||
events = append(events, models.Event{
|
||||
Timestamp: ts,
|
||||
ID: strings.TrimSpace(item.MessageID),
|
||||
Timestamp: parseEventTime(item.EventTime),
|
||||
Source: firstNonEmpty(strings.TrimSpace(item.Source), "Reanimator"),
|
||||
SensorName: strings.TrimSpace(item.ComponentRef),
|
||||
EventType: "Event Log",
|
||||
Severity: mapSeverity(item.Severity),
|
||||
Description: message,
|
||||
RawData: rawData,
|
||||
})
|
||||
}
|
||||
return events
|
||||
@@ -460,7 +466,11 @@ func parseEventTime(raw string) time.Time {
|
||||
if raw == "" {
|
||||
return time.Time{}
|
||||
}
|
||||
layouts := []string{time.RFC3339Nano, time.RFC3339}
|
||||
// Besides RFC3339, bee passes source-native stamps through unchanged:
|
||||
// ipmitool SEL ("10/01/26 09:34:07 UTC") and `dmesg -T`
|
||||
// ("Thu Oct 1 09:32:18 2026"). A SEL "Pre-Init <ticks>" stamp carries no
|
||||
// wall-clock time and stays zero.
|
||||
layouts := []string{time.RFC3339Nano, time.RFC3339, "01/02/06 15:04:05 MST", "01/02/2006 15:04:05 MST", time.ANSIC}
|
||||
for _, layout := range layouts {
|
||||
if ts, err := time.Parse(layout, raw); err == nil {
|
||||
return ts.UTC()
|
||||
|
||||
+25
@@ -293,3 +293,28 @@ func TestNormalizePSUSlots(t *testing.T) {
|
||||
t.Errorf("non-numeric slot must be untouched, got %q", got[0].Slot)
|
||||
}
|
||||
}
|
||||
|
||||
// Real BEE-SP v14.23 event_logs pass the source-native timestamps through:
|
||||
// ipmitool SEL, `dmesg -T`, and SEL "Pre-Init" records with no wall-clock time.
|
||||
func TestConvertEventLogsParsesSourceNativeTimes(t *testing.T) {
|
||||
events := convertEventLogs([]beeEventLog{
|
||||
{Source: "ipmi-sel", EventTime: "04/01/25 18:59:45 UTC", Severity: "Critical", MessageID: "6", Message: "Transition to Non-recoverable from less severe", ComponentRef: "Chassis #0xac"},
|
||||
{Source: "dmesg", EventTime: "Thu Oct 1 09:33:18 2026", Severity: "Critical", Message: "usb 1-1: device not accepting address 3, error -71"},
|
||||
{Source: "ipmi-sel", EventTime: "Pre-Init 0000000270", Severity: "info", MessageID: "1", Message: "S0/G0: working"},
|
||||
})
|
||||
if len(events) != 3 {
|
||||
t.Fatalf("expected 3 events, got %d", len(events))
|
||||
}
|
||||
if want := time.Date(2025, 4, 1, 18, 59, 45, 0, time.UTC); !events[0].Timestamp.Equal(want) {
|
||||
t.Errorf("SEL time = %v, want %v", events[0].Timestamp, want)
|
||||
}
|
||||
if events[0].ID != "6" || events[0].SensorName != "Chassis #0xac" || events[0].Severity != models.SeverityCritical {
|
||||
t.Errorf("SEL event fields lost: %+v", events[0])
|
||||
}
|
||||
if want := time.Date(2026, 10, 1, 9, 33, 18, 0, time.UTC); !events[1].Timestamp.Equal(want) {
|
||||
t.Errorf("dmesg time = %v, want %v", events[1].Timestamp, want)
|
||||
}
|
||||
if !events[2].Timestamp.IsZero() {
|
||||
t.Errorf("Pre-Init SEL record must stay undated, got %v", events[2].Timestamp)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user