100 lines
3.1 KiB
Go
100 lines
3.1 KiB
Go
//go:build ignore
|
|
// +build ignore
|
|
|
|
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
|
|
"git.mchus.pro/mchus/logpile/internal/parser"
|
|
_ "git.mchus.pro/mchus/logpile/internal/parser/vendors"
|
|
)
|
|
|
|
func main() {
|
|
p := parser.NewBMCParser()
|
|
|
|
fmt.Println("Testing NVIDIA Bug Report parser (full)...")
|
|
if err := p.ParseArchive("/Users/mchusavitin/Downloads/nvidia-bug-report-2KD501412.log.gz"); err != nil {
|
|
log.Fatalf("ERROR: %v", err)
|
|
}
|
|
|
|
fmt.Println("✓ Archive parsed successfully!")
|
|
fmt.Printf("✓ Detected vendor: %s\n", p.DetectedVendor())
|
|
|
|
result := p.Result()
|
|
fmt.Printf("✓ CPUs: %d\n", len(result.Hardware.CPUs))
|
|
fmt.Printf("✓ Memory: %d modules\n", len(result.Hardware.Memory))
|
|
fmt.Printf("✓ Power Supplies: %d\n", len(result.Hardware.PowerSupply))
|
|
fmt.Printf("✓ GPUs: %d\n", len(result.Hardware.GPUs))
|
|
fmt.Printf("✓ Network Adapters: %d\n", len(result.Hardware.NetworkAdapters))
|
|
|
|
fmt.Println("\nSystem Information:")
|
|
if result.Hardware.BoardInfo.SerialNumber != "" {
|
|
fmt.Printf(" Serial Number: %s\n", result.Hardware.BoardInfo.SerialNumber)
|
|
}
|
|
if result.Hardware.BoardInfo.UUID != "" {
|
|
fmt.Printf(" UUID: %s\n", result.Hardware.BoardInfo.UUID)
|
|
}
|
|
if result.Hardware.BoardInfo.Manufacturer != "" {
|
|
fmt.Printf(" Manufacturer: %s\n", result.Hardware.BoardInfo.Manufacturer)
|
|
}
|
|
if result.Hardware.BoardInfo.ProductName != "" {
|
|
fmt.Printf(" Product: %s\n", result.Hardware.BoardInfo.ProductName)
|
|
}
|
|
if result.Hardware.BoardInfo.Version != "" {
|
|
fmt.Printf(" Version: %s\n", result.Hardware.BoardInfo.Version)
|
|
}
|
|
|
|
fmt.Println("\nCPU Information:")
|
|
for _, cpu := range result.Hardware.CPUs {
|
|
fmt.Printf(" Socket %d: %s\n", cpu.Socket, cpu.Model)
|
|
fmt.Printf(" S/N: %s, Cores: %d, Threads: %d\n", cpu.SerialNumber, cpu.Cores, cpu.Threads)
|
|
}
|
|
|
|
fmt.Println("\nPower Supplies:")
|
|
for _, psu := range result.Hardware.PowerSupply {
|
|
fmt.Printf(" %s: %s (%s)\n", psu.Slot, psu.Model, psu.Vendor)
|
|
fmt.Printf(" S/N: %s\n", psu.SerialNumber)
|
|
fmt.Printf(" Power: %d W, Revision: %s\n", psu.WattageW, psu.Firmware)
|
|
fmt.Printf(" Status: %s\n", psu.Status)
|
|
}
|
|
|
|
totalMemGB := 0
|
|
for _, mem := range result.Hardware.Memory {
|
|
totalMemGB += mem.SizeMB / 1024
|
|
}
|
|
fmt.Printf("\nMemory: %d modules, %d GB total\n", len(result.Hardware.Memory), totalMemGB)
|
|
|
|
fmt.Printf("\nNetwork Adapters: %d devices\n", len(result.Hardware.NetworkAdapters))
|
|
for _, nic := range result.Hardware.NetworkAdapters {
|
|
fmt.Printf(" %s: %s\n", nic.Location, nic.Model)
|
|
if nic.Slot != "" {
|
|
fmt.Printf(" Slot: %s\n", nic.Slot)
|
|
}
|
|
if nic.PartNumber != "" {
|
|
fmt.Printf(" P/N: %s\n", nic.PartNumber)
|
|
}
|
|
if nic.SerialNumber != "" {
|
|
fmt.Printf(" S/N: %s\n", nic.SerialNumber)
|
|
}
|
|
if nic.PortCount > 0 {
|
|
fmt.Printf(" Ports: %d x %s\n", nic.PortCount, nic.PortType)
|
|
}
|
|
}
|
|
|
|
fmt.Printf("\nGPUs: %d devices\n", len(result.Hardware.GPUs))
|
|
for _, gpu := range result.Hardware.GPUs {
|
|
fmt.Printf(" %s: %s\n", gpu.BDF, gpu.Model)
|
|
if gpu.UUID != "" {
|
|
fmt.Printf(" UUID: %s\n", gpu.UUID)
|
|
}
|
|
if gpu.VideoBIOS != "" {
|
|
fmt.Printf(" Video BIOS: %s\n", gpu.VideoBIOS)
|
|
}
|
|
if gpu.IRQ > 0 {
|
|
fmt.Printf(" IRQ: %d\n", gpu.IRQ)
|
|
}
|
|
}
|
|
}
|