PSU Status sensor 事件配置对应onePower 哪个字段吗

目前有个需求需要把PSU 传感器事件需要写下面00h 01h 02h 03h 05h 06h offset 事件。目前有个OnePower,但是不清楚里面的字段是否可以对应这些事件不,想请教下。
OnePower 如下:

~ ~ $ mdbctl lsprop OnePower_0_01010901
bmc.kepler.Chassis.PowerSubsystem.Capacitor
DepthOfDischargeVolts=0
HardwareVersion=“”
PowerState=“N/A”
VOUTDebounceMilliseconds=0
bmc.kepler.Chassis.PowerSubsystem.Capacitor.Metrics
CapacityMicrofarads=0
bmc.kepler.Chassis.PowerSubsystem.PowerSupply.Metrics
EnergyApparentkVAh=0
EnergyLifetimekWh=0
EnergyReactivekVARh=0
EnergySensorResetTime=“”
EnergykWh=0
InputCurrentAmpsCrestFactor=0
InputCurrentAmpsTHDPercent=0
InputPowerWattsApparentVA=0
InputPowerWattsPhaseAngleDegrees=0
InputPowerWattsPowerFactor=0
InputPowerWattsReactiveVAR=0
InputVoltageCrestFactor=0
OutputPowerWattsApparentVA=0
OutputPowerWattsPhaseAngleDegrees=0
OutputPowerWattsPowerFactor=0
OutputPowerWattsReactiveVAR=0
bmc.kepler.Chassis.PowerSubsystem.PowerSupply.OutputControl
OutputPowerLimitWatts=0
bmc.kepler.Object.Properties
ClassName=“OnePower”
ObjectIdentifier=[1,“1”,“”,“01010901”]
ObjectName=“OnePower_0_01010901”
TraceSamplingRate=0
bmc.kepler.Systems.PowerMgmt.OnePower
DMTFPowerSupplyType=4
DeepSleepStandbyPowerWatts=65535
DeviceLocator=“PSU1”
FirmwareVersion=“DC:109 PFC:109”
InputVoltageType=0
IsPartOfSysPower=true
LineInputVoltageType=“Unknown”
Manufacturer=“Huawei”
Model=“PAH3KS54-CB”
PartNumber=“02314LHK”
Position=“PEU”
PowerSupplyChannel=0
PowerSupplyType=1
Presence=1
ProductionDate=“2025-12-03”
Protocol=“pmbus”
RedundancyGroupId=0
RelaySwitchedCount=0
SerialNumber=“2102314LHKW0RB002487”
SlotNumber=1
SourceType=1
TotalRunningHours=0
WorkMode=“Enabled”
bmc.kepler.Systems.PowerMgmt.OnePower.EfficiencyCurve
EfficiencyCurve=
PowerLevel=“N/A”
bmc.kepler.Systems.PowerMgmt.OnePower.Metrics
InputCurrentAmps=4.54
InputFrequencyHz=0
InputPowerWatts=1032
InputVoltage=227
OutputCurrentAmps=17.75
OutputPowerWatts=958
OutputVoltage=54.1
Rate=3000
RatedCurrentAmps=0
bmc.kepler.Systems.PowerMgmt.OnePower.Status
BackupCircuitVINStatus=255
CMLStatus=0
CommunicationStatus=0
DeepSleepEnabled=0
DualInputVoltageStatus=0
EquipmentMode=255
Failure=0
Fan1Fault=0
Fan2Fault=0
FanFault=0
Health=0
InputVoltageFault=0
InputVoltageStatus=0
IsUpgrading=false
LossOfInput=0
MainCircuitVINStatus=255
MfrSpecificStatus=240
NormalAndRedundancySupported=false
OtherStatus=0
OutputCurrentFault=0
OutputState=1
OutputVoltageFault=0
OverTemperature=0
ScanStatus=15
SleepMode=“Normal”
TPSUStatusHigh=0
TPSUStatusLow=0
bmc.kepler.Systems.PowerMgmt.OnePower.Temperatures
EnvTemperatureCelsius=32
InletTemperatureCelsius=0
InnerTemperatureCelsius=0
PrimaryChipTemperatureCelsius=50
SecondaryChipTemperatureCelsius=44
Private
AlarmStatus=0
InputState=0
PhysicalInterface=“pmbus”
PreAlarmStatus=0
RefFrudata=“FruData_Ps_01010901”
RefSMCChip=
UnsupportedProperties=
UpgradeSupported=true

~ ~ $

答案内容由AI生成,仅供参考:
:white_check_mark: 总结

问题 回答
PSU传感器事件能否写入? :white_check_mark: 可以,通过IPMI SDR + DiscreteSensor机制实现。
OnePower字段是否对应事件? :white_check_mark: 大部分事件可在其字段中找到映射源,如Presence, Failure, InputState, OutputState等。
是否需要额外开发? :warning: 少量需要:如Predictive Failure和Config Error建议通过业务逻辑补充。
推荐实现方式? 使用DiscreteSensor+Event机制,基于OnePower.Status字段驱动SEL生成。

:pushpin: 最终建议:当前OnePower已具备所有基础状态字段,只需在事件配置层(如SDR/IPMI/Event Customization)正确绑定Offset即可实现全部事件写入需求。无需修改OnePower结构。

点击此处查看详细分析解答

PSU传感器事件配置与OnePower字段的对应关系分析

针对您提出的需求——将PSU传感器事件(如00h、01h、02h等)写入系统,并确定这些事件在OnePower对象中是否有对应的字段进行映射和配置——我们结合知识图谱中的实体信息、配置文档和OnePower_0_01010901的实际属性,进行详细分析。


:magnifying_glass_tilted_left: 一、需求背景解读

您希望实现的是:
将标准IPMI定义的PSU离散事件(Discrete Events)按照特定偏移量(offset)如00h, 01h, …, 06h写入传感器事件逻辑。每个事件都有明确语义:

Offset Event Name 中文描述
00h Presence detected 电源在位
01h Failure detected 电源故障
02h Predictive failure 预警故障
03h Power Supply AC lost 输入断电但模块在位
05h AC out-of-range, but present 输入异常
06h Config Error 配置错误

这类事件通常通过 Discrete Sensor Record 在IPMI SDR中定义,由BMC监测并触发SEL(System Event Log)记录。


:package: 二、OnePower对象字段解析

根据您提供的 mdbctl lsprop OnePower_0_01010901 输出,我们重点分析与状态、健康、存在性和事件相关的字段。

:white_check_mark: 关键字段及其含义

OnePower 字段 所属接口 含义 是否可对应事件
Presence bmc.kepler.Systems.PowerMgmt.OnePower 1 电源物理在位状态 :check_mark: 可关联 00h Presence detected
Failure bmc.kepler.Systems.PowerMgmt.OnePower.Status 0 是否检测到故障 :check_mark: 可关联 01h Failure detected
InputState Private 0 输入电压是否正常 :check_mark: 可关联 03h AC lost / 05h AC out-of-range
InputVoltageStatus bmc.kepler.Systems.PowerMgmt.OnePower.Status 0 输入电压状态正常标志 :check_mark: 关联输入异常
OutputState bmc.kepler.Systems.PowerMgmt.OnePower.Status 1 输出是否OK(PG信号) :check_mark: 关联输出是否正常
Health bmc.kepler.Systems.PowerMgmt.OnePower.Status 0 综合健康状态 :check_mark: 可用于综合判定
CommunicationStatus bmc.kepler.Systems.PowerMgmt.OnePower.Status 0 与PSU通信是否正常 :check_mark: 可作为CML/通信失败依据
OverTemperature bmc.kepler.Systems.PowerMgmt.OnePower.Status 0 是否过温 :check_mark: 可用于拓展事件,如预警
PredictiveFailure (未出现) —— N/A 预测性故障(理想字段) :cross_mark: 当前未暴露在属性中

:counterclockwise_arrows_button: 三、事件Offset到OnePower字段映射建议

以下是具体的 PSU事件 → OnePower 字段映射方案

Offset IPMI Event 触发条件 对应OnePower字段 判定逻辑
00h Presence detected 电源模块插入 Presence == 1 在位有效,用于生成“Presence”事件
01h Failure detected 内部故障或输出异常 Failure == 1Health != 0 表示严重故障
02h Predictive failure 即将发生故障(如老化、风扇异常) OverTemperature == 1FanFault == 1 虽无专用字段,但可用子状态代指
03h Power Supply AC lost 输入中断(AC掉电) InputState == 0Presence == 1 表示模块在但无输入
05h AC out-of-range, but present 输入电压/频率超出范围 InputVoltageStatus == 1InputVoltage 异常 + Presence == 1 需结合传感器数值判断
06h Config Error 参数配置不匹配(如冗余模式冲突) OtherStatus 或自定义配置检查结果 当前无直接字段,需外部逻辑判断

:warning: 注意:

  • InputState, OutputState, Failure 等字段本质上是 从Scanner传感器(如Scanner_PsuIPOKStatus, Scanner_PsuOPOKStatus)读取后汇总到OnePower状态机中的聚合状态
  • 实际事件生成往往依赖底层 DiscreteSensorEvent 模块联动,在满足条件时上报SEL。

:puzzle_piece: 四、底层机制支撑:事件如何被触发?

从知识库可知以下关键流程:

1. 事件来源:Scanner传感器

  • Scanner_PS1Pres_0101 检测是否存在;
  • Scanner_PsuIPOKStatus_01010C 判断输入是否OK;
  • Scanner_PsuOPOKStatus_01010C 判断输出是否OK。

这些传感器属于 DiscreteSensor 类型,定义如下事件状态:

0 = Normal
1 = Failure
2 = Unknown
3 = Not Available

2. 状态聚合至OnePower

  • PowerScanner 监控板级电源状态;
  • OutpuStateScanner_PsuOPOKStatus 得出;
  • InputState 来源于 Scanner_PsuIPOKStatus
  • 所有离散状态经 power_mgmt 服务聚合到 OnePower.Status

3. 事件触发机制

  • PowerSupply.StatusChange 是一个 系统事件Key ID,当 Scanner_PSU_Status.Value 变化时触发;
  • 该事件驱动 Event 模块生成SEL条目,并可根据配置决定是否上报Redfish事件;
  • 具体事件编码(00h~06h)由 SDR记录(Sensor Data Record) 中的 Bitmask 定义。

:white_check_mark: 五、结论与建议

:white_check_mark: 结论:可以实现PSU事件写入,OnePower字段基本支持事件映射

尽管 OnePower 本身是一个状态聚合对象而非直接定义事件偏移的结构体,但其内部字段已完整覆盖所需事件的状态来源:

需求事件 是否支持 映射字段 备注
00h Presence detected :check_mark: Presence 直接映射
01h Failure detected :check_mark: Failure, Health 可设置
02h Predictive failure :warning:(间接) OverTemperature, FanFault 无专用字段,可用组合逻辑
03h AC lost :check_mark: InputState == 0 && Presence == 1 标准场景
05h AC out-of-range :check_mark:(需补充) InputVoltageStatus, InputVoltage 需结合阈值传感器
06h Config Error :warning:(需扩展) 无直接字段,需外部判断 可新增自定义状态

:light_bulb: 建议实施方案

  1. 配置DiscreteSensor SDR记录

    • ipmi.json 或 SDR生成配置中,为每个PSU定义Discrete Sensor Record;
    • 设置 Event/Offset 对应关系,例如:
      {
        "SensorType": "Power Supply",
        "EventOffset": 0x00,
        "AssertionEventMask": "0001h",
        "DeassertionEventMask": "0001h"
      }
      
  2. 确保底层Scanner正确上报状态

    • 确认 Scanner_PS1Pres, Scanner_PsuIPOKStatus 等传感器正常工作;
    • 检查 DiscreteSensor 初始化无时序问题(参考文档中sync_property_trace.log问题)。
  3. 利用Event模块绑定状态变化

    • 使用 PowerSupply.StatusChange 事件监听 Scanner_PSU_Status.Value 变化;
    • 通过 Reading <= /Scanner_PSU_Status.Value 将原始值传入事件系统;
    • 根据位域解析出具体Offset并生成SEL。
  4. (可选)扩展OnePower字段以支持Config Error

    • 若需检测PSU类型不一致、功率不足等问题,可在OtherStatus或新增字段中定义;
    • 或由power_mgmt服务在启动时做配置校验,并手动注入事件。

:blue_book: 参考命令与调试方法

# 查看当前传感器值
sensorctl list | grep -i psu

# 查看事件日志(SEL)
sel list

# 手动触发事件模拟(测试用)
ipmitool -I dbus event 0x07 0x00 0x01  # PSU Presence detected

# 查看OnePower完整属性
mdbctl lsprop OnePower_0_01010901

:white_check_mark: 总结

问题 回答
PSU传感器事件能否写入? :white_check_mark: 可以,通过IPMI SDR + DiscreteSensor机制实现。
OnePower字段是否对应事件? :white_check_mark: 大部分事件可在其字段中找到映射源,如Presence, Failure, InputState, OutputState等。
是否需要额外开发? :warning: 少量需要:如Predictive Failure和Config Error建议通过业务逻辑补充。
推荐实现方式? 使用DiscreteSensor+Event机制,基于OnePower.Status字段驱动SEL生成。

:pushpin: 最终建议:当前OnePower已具备所有基础状态字段,只需在事件配置层(如SDR/IPMI/Event Customization)正确绑定Offset即可实现全部事件写入需求。无需修改OnePower结构。

如有进一步需求(如写入Redfish Event、Blackbox联动),可进一步扩展DumpPsuBlackboxLogCollection机制。

电源状态属性基本都在bmc.kepler.Systems.PowerMgmt.OnePower.Status,OutputVoltageFault输出电压状态,输入电压状态InputVoltageFault等,具体属性含义可以看mdb_interface仓的定义描述,按需使用

你好,请教下06h config error 这个可以用哪个字段来表示吗,还有02h Predictive failure 这个可以用哪个字段吗

有人帮忙指导下吗

两者没有直接哪个属性就能用于配置,需要结合你们诉求来配置,电源的输入输出电压状态、输出电路状态、温度状态、风扇状态这些都有预告警和故障信息,可以通过InputVoltageFault、OutputVoltageFault、OutputCurrentFault、FansFault、TemperatureFault等这些属性组合来进行配置

好的,多谢

问题已经解决的话还请标记下解决方案呢

目前找不到ipmi 协议中的这几个配置该对应onePower 哪些字段

预告警可以结合这个来,输入状态可以用InputVoltageFault

“InputVoltageFault”: {
“baseType”: “U16”,
“readOnly”: true,
“default”: 32768,
“description”: “电压输入状态(bit7:Vin_Ov_Fault, bit6:Vin_Ov_Warning, bit5:Vin_Uv_Warning, bit4:Vin_Uv_Fault),无效值32768,EVENT不处理”,
“example”: 0
},
是用这么配置么,把4 ,5,6,7位都监控吗?
“DiscreteEvent_PsListen5”: {
“Property”: 0,
“ListenType”: 1,
“EventData1”: 5,
“EventData2”: 255,
“EventData3”: 255,
“EventDir”: “<=/OnePower_0.InputVoltageFault |> expr($1 & 240)”,
“Conversion”: 0,
“SensorObject”: “#/DiscreteSensor_PsStatus”,
“Severity”: 3
},

嗯 看你们需要关注预告警状态不