Add LOGPile BMC diagnostic log analyzer
Features: - Modular parser architecture for vendor-specific formats - Inspur/Kaytus parser supporting asset.json, devicefrusdr.log, component.log, idl.log, and syslog files - PCI Vendor/Device ID lookup for hardware identification - Web interface with tabs: Events, Sensors, Config, Serials, Firmware - Server specification summary with component grouping - Export to CSV, JSON, TXT formats - BMC alarm parsing from IDL logs (memory errors, PSU events, etc.) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
70
internal/parser/vendors/template/parser.go.template
vendored
Normal file
70
internal/parser/vendors/template/parser.go.template
vendored
Normal file
@@ -0,0 +1,70 @@
|
||||
// Package VENDORNAME provides parser for VENDOR_DESCRIPTION BMC diagnostic archives
|
||||
// Copy this template to create a new vendor parser module
|
||||
package VENDORNAME
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"git.mchus.pro/mchus/logpile/internal/models"
|
||||
"git.mchus.pro/mchus/logpile/internal/parser"
|
||||
)
|
||||
|
||||
func init() {
|
||||
parser.Register(&Parser{})
|
||||
}
|
||||
|
||||
// Parser implements VendorParser for VENDOR_DESCRIPTION servers
|
||||
type Parser struct{}
|
||||
|
||||
// Name returns human-readable parser name
|
||||
func (p *Parser) Name() string {
|
||||
return "VENDOR_DESCRIPTION BMC Parser"
|
||||
}
|
||||
|
||||
// Vendor returns vendor identifier
|
||||
func (p *Parser) Vendor() string {
|
||||
return "VENDORNAME"
|
||||
}
|
||||
|
||||
// Detect checks if archive matches this vendor's format
|
||||
// Returns confidence 0-100
|
||||
func (p *Parser) Detect(files []parser.ExtractedFile) int {
|
||||
confidence := 0
|
||||
|
||||
for _, f := range files {
|
||||
path := strings.ToLower(f.Path)
|
||||
|
||||
// Add detection logic here
|
||||
// Example:
|
||||
// if strings.Contains(path, "unique_vendor_file.log") {
|
||||
// confidence += 50
|
||||
// }
|
||||
_ = path
|
||||
}
|
||||
|
||||
// Cap at 100
|
||||
if confidence > 100 {
|
||||
return 100
|
||||
}
|
||||
|
||||
return confidence
|
||||
}
|
||||
|
||||
// Parse parses the archive using vendor-specific logic
|
||||
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),
|
||||
}
|
||||
|
||||
// Add parsing logic here
|
||||
// Example:
|
||||
// if f := parser.FindFileByName(files, "sensor_data.log"); f != nil {
|
||||
// result.Sensors = parseSensorLog(f.Content)
|
||||
// }
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
// Add helper functions for parsing specific file formats below
|
||||
Reference in New Issue
Block a user