collector/redfish: expand endpoint coverage and timestamp collect logs
This commit is contained in:
@@ -974,6 +974,12 @@ func redfishCriticalEndpoints(systemPaths, chassisPaths, managerPaths []string)
|
||||
add(joinPath(p, "/Power"))
|
||||
add(joinPath(p, "/Thermal"))
|
||||
add(joinPath(p, "/Sensors"))
|
||||
add(joinPath(p, "/HealthSummary"))
|
||||
add(joinPath(p, "/ThresholdSensors"))
|
||||
add(joinPath(p, "/DiscreteSensors"))
|
||||
add(joinPath(p, "/Boards"))
|
||||
add(joinPath(p, "/Backplanes"))
|
||||
add(joinPath(p, "/Assembly"))
|
||||
add(joinPath(p, "/NetworkAdapters"))
|
||||
add(joinPath(p, "/PCIeDevices"))
|
||||
add(joinPath(p, "/Accelerators"))
|
||||
@@ -1796,6 +1802,9 @@ func parseGPU(doc map[string]interface{}, functionDocs []map[string]interface{},
|
||||
if bdf := asString(doc["BDF"]); bdf != "" {
|
||||
gpu.BDF = bdf
|
||||
}
|
||||
if gpu.BDF == "" {
|
||||
gpu.BDF = buildBDFfromOemPublic(doc)
|
||||
}
|
||||
if gpu.VendorID == 0 {
|
||||
gpu.VendorID = asHexOrInt(doc["VendorId"])
|
||||
}
|
||||
@@ -1850,6 +1859,9 @@ func parsePCIeDevice(doc map[string]interface{}, functionDocs []map[string]inter
|
||||
VendorID: asHexOrInt(doc["VendorId"]),
|
||||
DeviceID: asHexOrInt(doc["DeviceId"]),
|
||||
}
|
||||
if strings.TrimSpace(dev.BDF) == "" {
|
||||
dev.BDF = buildBDFfromOemPublic(doc)
|
||||
}
|
||||
|
||||
for _, fn := range functionDocs {
|
||||
if dev.BDF == "" {
|
||||
@@ -1969,6 +1981,36 @@ func isGenericPCIeClassLabel(v string) bool {
|
||||
}
|
||||
}
|
||||
|
||||
func buildBDFfromOemPublic(doc map[string]interface{}) string {
|
||||
if len(doc) == 0 {
|
||||
return ""
|
||||
}
|
||||
oem, ok := doc["Oem"].(map[string]interface{})
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
public, ok := oem["Public"].(map[string]interface{})
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
|
||||
bus := asHexOrInt(public["BusNumber"])
|
||||
dev := asHexOrInt(public["DeviceNumber"])
|
||||
fn := asHexOrInt(public["FunctionNumber"])
|
||||
if bus < 0 || dev < 0 || fn < 0 {
|
||||
return ""
|
||||
}
|
||||
segment := asHexOrInt(public["Segment"])
|
||||
if segment < 0 {
|
||||
segment = 0
|
||||
}
|
||||
// Require at least bus + dev numbers to avoid inventing meaningless BDFs.
|
||||
if bus == 0 && dev == 0 && fn == 0 {
|
||||
return ""
|
||||
}
|
||||
return fmt.Sprintf("%04x:%02x:%02x.%x", segment, bus, dev, fn)
|
||||
}
|
||||
|
||||
func normalizeRedfishIdentityField(v string) string {
|
||||
v = strings.TrimSpace(v)
|
||||
if v == "" {
|
||||
@@ -2514,6 +2556,7 @@ func redfishSnapshotPrioritySeeds(systemPaths, chassisPaths, managerPaths []stri
|
||||
add(joinPath(p, "/PCIeDevices"))
|
||||
add(joinPath(p, "/PCIeFunctions"))
|
||||
add(joinPath(p, "/Accelerators"))
|
||||
add(joinPath(p, "/GraphicsControllers"))
|
||||
add(joinPath(p, "/Storage"))
|
||||
add(joinPath(p, "/SimpleStorage"))
|
||||
add(joinPath(p, "/Storage/IntelVROC"))
|
||||
@@ -2524,6 +2567,12 @@ func redfishSnapshotPrioritySeeds(systemPaths, chassisPaths, managerPaths []stri
|
||||
add(p)
|
||||
add(joinPath(p, "/Oem/Public/FRU"))
|
||||
add(joinPath(p, "/Sensors"))
|
||||
add(joinPath(p, "/HealthSummary"))
|
||||
add(joinPath(p, "/ThresholdSensors"))
|
||||
add(joinPath(p, "/DiscreteSensors"))
|
||||
add(joinPath(p, "/Boards"))
|
||||
add(joinPath(p, "/Backplanes"))
|
||||
add(joinPath(p, "/Assembly"))
|
||||
add(joinPath(p, "/Thermal"))
|
||||
add(joinPath(p, "/EnvironmentMetrics"))
|
||||
add(joinPath(p, "/PCIeDevices"))
|
||||
|
||||
Reference in New Issue
Block a user