v1.2.0: Enhanced Inspur/Kaytus parser with GPU, PCIe, and storage support
Major improvements: - Add CSV SEL event parser for Kaytus firmware format - Add PCIe device parser with link speed/width detection - Add GPU temperature and PCIe link monitoring - Add disk backplane parser for storage bay information - Fix memory module detection (only show installed DIMMs) Parser enhancements: - Parse RESTful PCIe Device info (max/current link width/speed) - Parse GPU sensor data (core and memory temperatures) - Parse diskbackplane info (slot count, installed drives) - Parse SEL events from CSV format (selelist.csv) - Fix memory Present status logic (check mem_mod_status) Web interface improvements: - Add PCIe link degradation highlighting (red when current < max) - Add storage table with Present status and location - Update memory specification to show only installed modules with frequency - Sort events from newest to oldest - Filter out N/A serial numbers from display Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
86
internal/parser/vendors/inspur/parser.go
vendored
86
internal/parser/vendors/inspur/parser.go
vendored
@@ -6,6 +6,7 @@
|
||||
package inspur
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"git.mchus.pro/mchus/logpile/internal/models"
|
||||
@@ -91,12 +92,7 @@ func (p *Parser) Parse(files []parser.ExtractedFile) (*models.AnalysisResult, er
|
||||
Sensors: make([]models.SensorReading, 0),
|
||||
}
|
||||
|
||||
// Parse devicefrusdr.log (contains SDR and FRU data)
|
||||
if f := parser.FindFileByName(files, "devicefrusdr.log"); f != nil {
|
||||
p.parseDeviceFruSDR(f.Content, result)
|
||||
}
|
||||
|
||||
// Parse asset.json
|
||||
// Parse asset.json first (base hardware info)
|
||||
if f := parser.FindFileByName(files, "asset.json"); f != nil {
|
||||
if hw, err := ParseAssetJSON(f.Content); err == nil {
|
||||
result.Hardware = hw
|
||||
@@ -107,6 +103,12 @@ func (p *Parser) Parse(files []parser.ExtractedFile) (*models.AnalysisResult, er
|
||||
if result.Hardware == nil {
|
||||
result.Hardware = &models.HardwareConfig{}
|
||||
}
|
||||
|
||||
// Parse devicefrusdr.log (contains SDR, FRU, PCIe and additional data)
|
||||
if f := parser.FindFileByName(files, "devicefrusdr.log"); f != nil {
|
||||
p.parseDeviceFruSDR(f.Content, result)
|
||||
}
|
||||
|
||||
extractBoardInfo(result.FRU, result.Hardware)
|
||||
|
||||
// Extract PlatformId (server model) from ThermalConfig
|
||||
@@ -129,6 +131,12 @@ func (p *Parser) Parse(files []parser.ExtractedFile) (*models.AnalysisResult, er
|
||||
result.Events = append(result.Events, idlEvents...)
|
||||
}
|
||||
|
||||
// Parse SEL list (selelist.csv)
|
||||
if f := parser.FindFileByName(files, "selelist.csv"); f != nil {
|
||||
selEvents := ParseSELList(f.Content)
|
||||
result.Events = append(result.Events, selEvents...)
|
||||
}
|
||||
|
||||
// Parse syslog files
|
||||
syslogFiles := parser.FindFileByPattern(files, "syslog/alert", "syslog/warning", "syslog/notice", "syslog/info")
|
||||
for _, f := range syslogFiles {
|
||||
@@ -161,4 +169,70 @@ func (p *Parser) parseDeviceFruSDR(content []byte, result *models.AnalysisResult
|
||||
fruContent := lines[fruStart:]
|
||||
result.FRU = ParseFRU([]byte(fruContent))
|
||||
}
|
||||
|
||||
// Parse PCIe devices from RESTful PCIE Device info
|
||||
// This supplements data from asset.json with serial numbers, firmware, etc.
|
||||
pcieDevicesFromREST := ParsePCIeDevices(content)
|
||||
|
||||
// Merge PCIe data: keep asset.json data but add RESTful data if available
|
||||
if result.Hardware != nil {
|
||||
// If asset.json didn't have PCIe devices, use RESTful data
|
||||
if len(result.Hardware.PCIeDevices) == 0 && len(pcieDevicesFromREST) > 0 {
|
||||
result.Hardware.PCIeDevices = pcieDevicesFromREST
|
||||
}
|
||||
// If we have both, merge them (RESTful data takes precedence for detailed info)
|
||||
// For now, we keep asset.json data which has more details
|
||||
}
|
||||
|
||||
// Parse GPU devices and add temperature data from sensors
|
||||
if len(result.Sensors) > 0 && result.Hardware != nil {
|
||||
// Use existing GPU data from asset.json and enrich with sensor data
|
||||
for i := range result.Hardware.GPUs {
|
||||
gpu := &result.Hardware.GPUs[i]
|
||||
|
||||
// Extract GPU number from slot name
|
||||
slotNum := extractSlotNumberFromGPU(gpu.Slot)
|
||||
|
||||
// Find temperature sensors for this GPU
|
||||
for _, sensor := range result.Sensors {
|
||||
sensorName := strings.ToUpper(sensor.Name)
|
||||
|
||||
// Match GPU temperature sensor
|
||||
if strings.Contains(sensorName, fmt.Sprintf("GPU%d_TEMP", slotNum)) && !strings.Contains(sensorName, "MEM") {
|
||||
if sensor.RawValue != "" {
|
||||
fmt.Sscanf(sensor.RawValue, "%d", &gpu.Temperature)
|
||||
}
|
||||
}
|
||||
|
||||
// Match GPU memory temperature
|
||||
if strings.Contains(sensorName, fmt.Sprintf("GPU%d_MEM_TEMP", slotNum)) {
|
||||
if sensor.RawValue != "" {
|
||||
fmt.Sscanf(sensor.RawValue, "%d", &gpu.MemTemperature)
|
||||
}
|
||||
}
|
||||
|
||||
// Match PCIe slot temperature as fallback
|
||||
if strings.Contains(sensorName, fmt.Sprintf("PCIE%d_GPU_TLM_T", slotNum)) && gpu.Temperature == 0 {
|
||||
if sensor.RawValue != "" {
|
||||
fmt.Sscanf(sensor.RawValue, "%d", &gpu.Temperature)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// extractSlotNumberFromGPU extracts slot number from GPU slot string
|
||||
func extractSlotNumberFromGPU(slot string) int {
|
||||
parts := strings.Split(slot, "_")
|
||||
for _, part := range parts {
|
||||
if strings.HasPrefix(part, "PCIE") {
|
||||
var num int
|
||||
fmt.Sscanf(part, "PCIE%d", &num)
|
||||
if num > 0 {
|
||||
return num
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user