v1.3.0: Add multiple vendor parsers and enhanced hardware detection
New parsers: - NVIDIA Field Diagnostics parser with dmidecode output support - NVIDIA Bug Report parser with comprehensive hardware extraction - Supermicro crashdump (CDump.txt) parser - Generic fallback parser for unrecognized text files Enhanced GPU parsing (nvidia-bug-report): - Model and manufacturer detection (NVIDIA H100 80GB HBM3) - UUID, Video BIOS version, IRQ information - Bus location (BDF), DMA size/mask, device minor - PCIe bus type details New hardware detection (nvidia-bug-report): - System Information: server S/N, UUID, manufacturer, product name - CPU: model, S/N, cores, threads, frequencies from dmidecode - Memory: P/N, S/N, manufacturer, speed for all DIMMs - Power Supplies: manufacturer, model, S/N, wattage, status - Network Adapters: Ethernet/InfiniBand controllers with VPD data - Model, P/N, S/N from lspci Vital Product Data - Port count/type detection (QSFP56, OSFP, etc.) - Support for ConnectX-6/7 adapters Archive handling improvements: - Plain .gz file support (not just tar.gz) - Increased size limit for plain gzip files (50MB) - Better error handling for mixed archive formats Web interface enhancements: - Display parser name and filename badges - Improved file info section with visual indicators Co-Authored-By: Claude (qwen3-coder:480b) <noreply@anthropic.com>
This commit is contained in:
107
internal/parser/vendors/nvidia_bug_report/parser.go
vendored
Normal file
107
internal/parser/vendors/nvidia_bug_report/parser.go
vendored
Normal file
@@ -0,0 +1,107 @@
|
||||
// Package nvidia_bug_report provides parser for NVIDIA bug report files
|
||||
// Generated by nvidia-bug-report.sh script
|
||||
package nvidia_bug_report
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"git.mchus.pro/mchus/logpile/internal/models"
|
||||
"git.mchus.pro/mchus/logpile/internal/parser"
|
||||
)
|
||||
|
||||
// parserVersion - version of this parser module
|
||||
const parserVersion = "1.0.0"
|
||||
|
||||
func init() {
|
||||
parser.Register(&Parser{})
|
||||
}
|
||||
|
||||
// Parser implements VendorParser for NVIDIA bug reports
|
||||
type Parser struct{}
|
||||
|
||||
// Name returns human-readable parser name
|
||||
func (p *Parser) Name() string {
|
||||
return "NVIDIA Bug Report Parser"
|
||||
}
|
||||
|
||||
// Vendor returns vendor identifier
|
||||
func (p *Parser) Vendor() string {
|
||||
return "nvidia_bug_report"
|
||||
}
|
||||
|
||||
// Version returns parser version
|
||||
func (p *Parser) Version() string {
|
||||
return parserVersion
|
||||
}
|
||||
|
||||
// Detect checks if this is an NVIDIA bug report
|
||||
// Returns confidence 0-100
|
||||
func (p *Parser) Detect(files []parser.ExtractedFile) int {
|
||||
// Only detect if there's exactly one file
|
||||
if len(files) != 1 {
|
||||
return 0
|
||||
}
|
||||
|
||||
file := files[0]
|
||||
|
||||
// Check filename
|
||||
if !strings.Contains(strings.ToLower(file.Path), "nvidia-bug-report") {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Check content markers
|
||||
content := string(file.Content)
|
||||
if !strings.Contains(content, "nvidia-bug-report.sh") ||
|
||||
!strings.Contains(content, "NVIDIA bug report log file") {
|
||||
return 0
|
||||
}
|
||||
|
||||
// High confidence for nvidia-bug-report files
|
||||
return 85
|
||||
}
|
||||
|
||||
// Parse parses NVIDIA bug report file
|
||||
func (p *Parser) Parse(files []parser.ExtractedFile) (*models.AnalysisResult, error) {
|
||||
result := &models.AnalysisResult{
|
||||
Events: make([]models.Event, 0),
|
||||
FRU: make([]models.FRUInfo, 0),
|
||||
Sensors: make([]models.SensorReading, 0),
|
||||
}
|
||||
|
||||
// Initialize hardware config
|
||||
result.Hardware = &models.HardwareConfig{
|
||||
CPUs: make([]models.CPU, 0),
|
||||
Memory: make([]models.MemoryDIMM, 0),
|
||||
GPUs: make([]models.GPU, 0),
|
||||
PowerSupply: make([]models.PSU, 0),
|
||||
}
|
||||
|
||||
if len(files) == 0 {
|
||||
return result, nil
|
||||
}
|
||||
|
||||
content := string(files[0].Content)
|
||||
|
||||
// Parse system information
|
||||
parseSystemInfo(content, result)
|
||||
|
||||
// Parse CPU information
|
||||
parseCPUInfo(content, result)
|
||||
|
||||
// Parse memory modules
|
||||
parseMemoryModules(content, result)
|
||||
|
||||
// Parse power supplies
|
||||
parsePSUInfo(content, result)
|
||||
|
||||
// Parse GPU information
|
||||
parseGPUInfo(content, result)
|
||||
|
||||
// Parse network adapters
|
||||
parseNetworkAdapters(content, result)
|
||||
|
||||
// Parse driver version
|
||||
parseDriverVersion(content, result)
|
||||
|
||||
return result, nil
|
||||
}
|
||||
Reference in New Issue
Block a user