Add enclosure health details (PSUs, fans, temps, voltages) via SES
Parse sg_ses --page=0x02 output to surface enclosure-level health data including power supply status, fan RPMs, temperature sensors, and voltage rails. Failed/critical components are reflected in the overview totals and shown as status pills in the enclosure card header with an expandable detail panel.
This commit is contained in:
@@ -65,6 +65,41 @@ class SlotWithDrive(BaseModel):
|
||||
drive: DriveHealthSummary | None = None
|
||||
|
||||
|
||||
class PsuStatus(BaseModel):
|
||||
index: int
|
||||
status: str
|
||||
fail: bool = False
|
||||
ac_fail: bool = False
|
||||
dc_fail: bool = False
|
||||
|
||||
|
||||
class FanStatus(BaseModel):
|
||||
index: int
|
||||
status: str
|
||||
rpm: int | None = None
|
||||
fail: bool = False
|
||||
|
||||
|
||||
class TempSensor(BaseModel):
|
||||
index: int
|
||||
status: str
|
||||
temperature_c: float | None = None
|
||||
|
||||
|
||||
class VoltageSensor(BaseModel):
|
||||
index: int
|
||||
status: str
|
||||
voltage: float | None = None
|
||||
|
||||
|
||||
class EnclosureHealth(BaseModel):
|
||||
overall_status: str = "OK"
|
||||
psus: list[PsuStatus] = []
|
||||
fans: list[FanStatus] = []
|
||||
temps: list[TempSensor] = []
|
||||
voltages: list[VoltageSensor] = []
|
||||
|
||||
|
||||
class EnclosureWithDrives(BaseModel):
|
||||
id: str
|
||||
sg_device: str | None = None
|
||||
@@ -74,6 +109,7 @@ class EnclosureWithDrives(BaseModel):
|
||||
total_slots: int
|
||||
populated_slots: int
|
||||
slots: list[SlotWithDrive]
|
||||
health: EnclosureHealth | None = None
|
||||
|
||||
|
||||
class HostDrive(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user