fix: never use parse time as event or collection time

Dump data is always historical. Parsers stamped undated events with
time.Now() (Inspur component.log memory/fan status, IDL/H3C SEL with
unparsable time, NVIDIA summary/bug-report, generic, XigmaNAS, Unraid,
Redfish replay warnings), so an August dump opened in September showed
DIMM warnings dated the day of analysis.

- Events without a source time keep a zero timestamp.
- Yearless syslog timestamps take the year from the collection time via
  parser.ParseYearlessInDefaultArchiveLocation; zero when unknown.
- Archive/uploaded-snapshot collected_at is no longer defaulted to now;
  only live API collection uses the current time.

ADL-070.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Mikhail ChusavitinandClaude Opus 5.5 committed 2026-09-28 13:00:53 +03:00
1 parent 8794e0adec
commit f2ad0aca96
19 files changed
+95 -85

No files matched your search

+1 -8
View File
@@ -255,7 +255,6 @@ func appendMissingServerModelWarning(result *models.AnalysisResult, systemDoc ma
}
result.Events = append(result.Events, models.Event{
Timestamp: time.Now(),
Source: "Redfish",
EventType: "Collection Warning",
Severity: models.SeverityWarning,
@@ -330,7 +329,6 @@ func buildDriveFetchWarningEvents(rawPayloads map[string]any) []models.Event {
return []models.Event{
{
Timestamp: time.Now(),
Source: "Redfish",
EventType: "Collection Warning",
Severity: models.SeverityWarning,
@@ -481,10 +479,7 @@ func redfishSlotStatusLooksPresent(status string) bool {
}
func replayEventTimestamp(collectedAt time.Time) time.Time {
if !collectedAt.IsZero() {
return collectedAt
}
return time.Now()
return collectedAt
}
func (r redfishSnapshotReader) collectFirmwareInventory() []models.FirmwareInfo {
@@ -697,7 +692,6 @@ func parseDiscreteSensorEvent(doc map[string]interface{}) (models.Event, bool) {
return models.Event{}, false
}
return models.Event{
Timestamp: time.Now(),
Source: "Redfish",
SensorName: name,
EventType: "Discrete Sensor Status",
@@ -915,7 +909,6 @@ func (r redfishSnapshotReader) collectHealthSummaryEvents(chassisPaths []string)
}
raw, _ := json.Marshal(doc)
out = append(out, models.Event{
Timestamp: time.Now(),
Source: "Redfish",
EventType: "Health Summary",
Severity: models.SeverityWarning,