Sensor Adaptation Guide
更新时间: 2026/02/28
在Gitcode上查看源码

openUBMC Sensor Adaptation Guide

Overview

openUBMC sensor management is designed and implemented in accordance with the IPMI 2.0 protocol specification. The openUBMC design divides sensors into two main categories: continuous sensors and discrete sensors.

  • Continuous Sensor: Also known as a threshold sensor, this sensor monitors quantifiable and continuously changing physical quantities such as temperature, voltage, current, and fan speed. The system represents sensor readings as analog values and compares them with preset thresholds to determine whether the monitored parameters are within the normal operating range.
  • Discrete Sensor: Discrete sensors monitor discontinuous parameters and generally output discrete binary signals, such as "Present/Not Present" or "Normal/Faulty." These sensors do not provide specific quantitative values; their core functionality lies in state identification and event triggering, where the system implements alarm mechanisms by determining the status of the monitored object.

The following figure shows the relationship between configuration items. For mandatory elements during sensor configuration, see the following table:

Configuration ItemMandatoryConfiguration Description
EntityYesHardware entity corresponding to the sensor
Sensor Object: Threshold or DiscreteYesSensor object for the resource collaboration interface
Sensor EventYesThis item is required only for discrete events
Event FilterNoEvent filtering method
Event DescriptionNoLevel and description of sensor reported events

Configuration Guidance

Sensor Entity Configuration

The sensor entity is the basis of subsequent configurations, so you must define entity objects first.

Configuring Properties

PropertyTypeDescription
Iduint8Entity ID corresponding to the sensor.
For details, see Table 43, Entity ID Codes (P550).
Instanceuint8Entity instance ID corresponding to the sensor, which usually starts with 0x60.
For details, see section 39.1 System- and Device-relative Entity Instance Values (P492)*.
Slotuint8Entity slot. The default value is 0xFF. If the slot is not the default one, the system generates a unique instance based on the slot.
NamestringName of the entity.
Presenceuint8The presence status of the entity, associated with the corresponding presence signal source.
If no component requires dynamic removal or insertion, set this parameter to 1.
PowerStateuint8Power-on/off status of the entity, associated with the corresponding power-on/off signal source.
If the power-on/off status is irrelevant, set this parameter to 1.

Key Configuration Points

  1. Configure the Entity Id according to the table in the IPMI specification.
  2. The Entity Instance must be unique for the same Entity Id. That is, the combination of ID and instance must uniquely identify a single entity.

Configuration Example

The following example describes how to add a sensor entity by using a fan. In the southbound management framework, entity objects interact with hardware through the Accessor/Scanner objects. Entity_Fan1 obtains the presence status and power-on/off status of the fan by synchronizing the values of Scanner_Fan1_Presence and Scanner_PowerGood. The system configures the following sensors in the CSR file of the fan board. The following example uses TaiShan 2280. The CSR file of the fan board is manifest/temp/build_openUBMC_debug_dev/conan_install/vpd/opt/bmc/sr/14100363_00000001050302035475.sr.

json
"Entity_FanBoard": {
    "Id": 11,
    "Instance": 117,    //Unique ID + instance
    "Name": "FanBoard${Slot}",
    "PowerState": 1,    // Power-on or power-off status
    "Presence": 1       // Presence status
},
"Entity_Fan1": {
    "Id": 30,
    "Instance": 96,
    "Name": "Fan1",
    "Presence": "<=/Scanner_Fan1_Presence.Value",
    "PowerState": "<=/Scanner_PowerGood.Value"
},
"Scanner_Fan1_Presence": { // For details about the scanner configuration, see Board Adaptation.
    "Chip": "#/Smc_FanBoardSMC",
    "Offset": 402656001,
    "Size": 1,
    "Mask": 1,
    "Type": 0,
    "Period": 2000,     // Scanning period
    "Debounce": "None", // Anti-jitter configuration
    "ScanEnabled": "<=/Scanner_PowerGood.Value",
    "NominalValue": 1,
    "@Default": {
        "ScanEnabled": 0
    },
    "Value": 0
},
"Scanner_PowerGood": {
    "Chip": "#/Smc_ExpBoardSMC",
    "Offset": 469765888,
    "Size": 1,
    "Mask": 255,
    "Type": 0,
    "Period": 100,
    "Debounce": "None",
    "Value": 0
},
"Smc_FanBoardSMC": {    // Defined according to the SMC specifications
    "Address": 96,
    "AddrWidth": 1,
    "OffsetWidth": 1,
    "WriteTmout": 0,
    "ReadTmout": 0
},

After the configuration is complete, verify whether Entity_FanBoard and Entity_Fan1 are successfully mounted to the resource collaboration interface.

bash
> busctl --user tree bmc.kepler.sensor
...
├─/bmc/kepler/Systems
 └─/bmc/kepler/Systems/1
    ...
    ├─/bmc/kepler/Systems/1/Entities
 └─/bmc/kepler/Systems/1/Entities/Entity_FanBoard_0101
 └─/bmc/kepler/Systems/1/Entities/Entity_Fan1_0101
    ...

Threshold Sensor Configuration

Threshold sensors monitor quantifiable and continuously changing physical quantities such as temperature, voltage, current, and fan speed. The system represents readings as analog values and compares them with preset thresholds to determine whether the monitored parameters are within the normal operating range. The sensor class name is ThresholdSensor.

Configuring Properties

PropertyTypeDescription
OwnerIduint8Owner ID of the sensor.
BMC - 0x20
OwnerLunuint8Owner LUN of the sensor.
The owner is the system software - 0x00.
EntityIduint8The entity ID of to the sensor, which is associated with the Entity.Id of the sensor.
EntityInstanceuint8The entity instance of to the sensor, which is associated with the Entity.Instance of the sensor.
Initializationuint8Sensor initialization (threshold sensor - 0x7F)
Capabilitiesuint8Sensor capabilities, used to configure features such as automatic adjustment mode, hysteresis, threshold access, and event control.
For details, see Table 43, Full Sensor Record -SDR Type 01h (P521).
SensorTypeuint8Sensor type.
For details, see Table 42, Sensor Type Codes (P505).
ReadingTypeuint8Sensor read value type (threshold sensor - 0x01).
For details, see Table 42, Event/Reading Type Code Ranges (P503).
SensorNamestringSensor name. If the value of this field contains more than 16 characters, the system truncates the excess characters.
AssertMaskuint16Sensor event generation mask, which determines whether the system can generate an event. The mask must match the threshold configured for the sensor.
DeassertMaskuint16Sensor event recovery mask, which determines whether the system can recover an event. The mask must match the threshold configured for the sensor.
ReadingMaskuint16Sensor read value mask, which determines whether the threshold can be displayed externally. The mask must match the threshold configured for the sensor.
Unituint8Sensor unit.
For details, see Table 43, Sensor Unit Type Codes (P554).
BaseUnituint8Sensor base unit.
For details, see Table 43, Sensor Unit Type Codes (P554).
ModifierUnituint8Unit descriptor.
For details, see Table 43, Sensor Unit Type Codes (P554).
Linearizationuint8Linear calculation equation. For details about the calculation method, see Conversion from the Raw Value to the Read Value for Threshold Sensors.
Analoguint8Analog feature flag of the sensor. Generally, set this parameter to 1.
NominalReadinguint8Nominal read value of the sensor, derived from the IPMI specifications and following the data format range.
MaximumReadinguint8The maximum read value of the sensor, related to the data format.
If the number is unsigned, set this parameter to 255. If the number is signed, set this parameter to 127.
MinimumReadinguint8The minimum read value of the sensor, related to the data format.
If the number is unsigned, set this parameter to 0. If the number is signed, set this parameter to 128.
Readinguint8Raw read value of the sensor, synchronized with the sensor data source (such as Scanner).
If the data source is too long, the system reads the lower eight bits, which causes a read value error. For details about the solution, see the third key configuration point.
ReadingStatusuint8Reading status, synchronized with the sensor data source (such as Scanner).
If the value is configured using an expression, configure the value by strictly referring to Definition and Conversion of Reading Status for Threshold Sensors.

If necessary, you can select the following fields.

PropertyTypeDescription
Linearizationuint8Linear calculation equation. For details about the calculation method, see Conversion from the Raw Value to the Read Value for Threshold Sensors.
Muint8One of the linearization parameters. The default value is 1, corresponding to the lower eight bits of the sensor M computation expression.
MTuint8One of the linearization parameters, corresponding to the upper two bits of the sensor M computation expression and the tolerance.
Buint8One of the linearization parameters, corresponding to the lower eight bits of the sensor B computation expression.
BAuint8One of the linearization parameters, corresponding to the upper two bits of the sensor B computation expression and the lower six bits of the accuracy.
Accuracyuint8One of the linearization parameters, corresponding to the upper six bits of the sensor accuracy and the sensor direction.
RBExpuint8One of the linearization parameters, corresponding to the four bits of the sensor R/B calculation expression.
NormalMaximumuint8The maximum read value of the sensor. The default value is 0.
NormalMinimumuint8The minimum read value of the sensor. The default value is 0.
UpperNonrecoverableuint8Upper limit of sensor emergency events, configured on demand.
UpperCriticaluint8Upper limit of sensor critical events, configured on demand.
UpperNoncriticaluint8Upper limit of sensor minor events, configured on demand.
LowerNonrecoverableuint8Lower limit of sensor emergency events, configured on demand.
LowerCriticaluint8Lower limit of sensor critical events, configured on demand.
LowerNonCriticaluint8Lower limit of sensor minor events, configured on demand.
PositiveHysteresisuint8Sensor rising event recovery hysteresis, configured on demand.
NegativeHysteresisuint8Sensor decrease event recovery hysteresis, configured on demand.
SensorNumberuint16(Optional) Sensor number. The default value is 255, specified by the IPMI and generated by the BMC. If you require a special number, customize the number on the sensor customization page. (Sensors for components that are hot-inserted while the BMC is running cannot be customized.)

Key Configuration Points for Threshold Sensors

  1. Set SensorType according to Table 42- SensorType Codes (P505) in the IPMI specifications.
  2. The Mask properties must match the configured thresholds. If you configure a threshold, the corresponding bit of Mask must be set.
  3. Note that the current Reading (that is, the raw value) cannot exceed 255. If it does, you must scale down the Reading using an expression and then restore it using the sensor expression formula. Generally, the actual values of data sources of sensors such as power and voltage sensors are likely to exceed the upper limit. You must convert these values to the int8 range. If the data range is not constrained and converted, the Reading value may not behave as expected.

Configuration Example

The following example uses a temperature sensor to describe how to configure a common threshold sensor, and uses a fan power sensor as an example to describe how to configure a threshold sensor that requires scaling. The system usually scales down the Reading value using the pipeline syntax. For details, see Expression syntax.

Non-Scaling Sensor
json
//Fan temperature sensor
"ThresholdSensor_FanBoardTemp": {
    "OwnerId": 32,
    "OwnerLun": 0,
    "EntityId": "<=/Entity_FanBoard.Id",
    "EntityInstance": "<=/Entity_FanBoard.Instance",
    "Initialization": 127, // Fixed value
    "Capabilities": 104,
    "SensorType": 1,
    "ReadingType": 1,
    "SensorName": "CLU${Slot} Temp",
    "AssertMask": 0, // Event generation mask
    "DeassertMask": 0, // Event recovery mask
    "ReadingMask": 0, // Reading value mask
    "Unit": 128, //Unit
    "BaseUnit": 1,
    "ModifierUnit": 0,
    "Linearization": 0, // Linear calculation equation parameter
    "M": 100, // Linear calculation equation parameter
    "RBExp": 224, // Linear calculation equation parameter
    "Analog": 1, // Linear calculation equation parameter
    "NominalReading": 0, // Nominal reading value of the sensor
    "NormalMaximum": 0,
    "NormalMinimum": 0,
    "MaximumReading": 127,
    "MinimumReading": 128,
    "Reading": "<=/Scanner_FanBrdTemp.Value",       // Raw read value
    "ReadingStatus": "≤/Scanner_FanBrdTemp.Status" // Read value status, configurable with expressions.
},
"Scanner_FanBrdTemp": {
    "Chip": "#/Smc_FanBoardSMC",
    "Size": 2,
    "Offset": 4865,
    "Mask": 65280,
    "Period": 2000,
    "Debounce": "None",
    "Value": 0,
    "Status": 0
}

Related property value ranges:

  • AssertMask:
  • DeassertMask:
  • ReadingMask:
  • Unit:
  • Capabilities:
Scaling Sensor
json
//Fan power sensor
"ThresholdSensor_FanBoardPower": {
    "OwnerId": 32,
    "OwnerLun": 0,
    "EntityId": "<=/Entity_FanBoard.Id",
    "EntityInstance": "<=/Entity_FanBoard.Instance",
    "Initialization": 127,
    "Capabilities": 104,
    "SensorType": 11,
    "ReadingType": 1,
    "SensorName": "FanBoard${Slot} Power",
    "AssertMask": 0,
    "DeassertMask": 0,
    "ReadingMask": 0,
    "Unit": 0,
    "BaseUnit": 6,
    "ModifierUnit": 0,
    "Linearization": 0,
    "M": 5,
    "Analog": 1,
    "NominalReading": 0,
    "NormalMaximum": 0,
    "NormalMinimum": 0,
    "MaximumReading": 255,
    "MinimumReading": 0,
    "Reading": "≤/Scanner_Fan1_Pwr.Value |> expr($1 * 0.0002 / 5)", // You can scale the raw read value to the uint8 range using an expression.
    "ReadingStatus": "<=/Scanner_Fan1_Pwr.Status"
},
"Scanner_Fan1_Pwr": {
    "Chip": "#/Smc_FanBoardSMC",
    "Offset": 4864,
    "Size": 3,
    "Mask": 0,
    "Type": 1,
    "Value": 0,
    "Status": 0,
    "Period": 1000,
    "Debounce": "None"
}

The expr syntax scales the sensor Reading value so that it falls within the expected range. The service determines the specific scaling rules.

Conversion from the Raw Value to the Read Value for Threshold Sensors

The system converts the raw value of a threshold sensor to the read value using the following calculation formula. For details, see section 36.3 "Sensor Reading Conversion Formula" (P483) in the IPMI standard.

1. Properties involved in the conversion formula

PropertyTypeDescription
Linearizationuint8Sensor calculation expression
[7] - Reserved field
[6:0] - Formula
00h-0bh: enum (linear, ln, log10, log2, ...)
70h: non-linear
The most commonly used linear expression. Set this parameter to 0x00.
Muint8[7:0] - Least significant 8 bits of M (signed, two's complement, 10-bit total)
MTuint8[7:6] - Most significant 2 bits of M (signed, two's complement, 10-bit total)
[5:0] - Tolerance (unsigned, 6-bit)
Buint8[7:0] - Least significant 8 bits of B (signed, two's complement, 10-bit total)
BAuint8[7:6] - Most significant 2 bits of B (signed, two's complement, 10-bit total)
[5:0] - Least significant 6 bits of precision (unsigned, 10-bit total)
Accuracyuint8[7:4] - Most significant 4 bits of precision (unsigned, 10-bit total)
[3:2] - Precision (unsigned, 2-bit total)
[1:0] - Sensor direction
RBExpuint8[7:4] - RExp (K2, signed, two's complement, 4-bit total)
[3:0] - BExp (K1, signed, two's complement, 4-bit total)
Readinguint8Raw sensor value

2. Formula

  • Two's complement: You must convert the property value to a signed number.

  • The system converts the raw value into a read value according to the following formula:

    text
    temp = (M * x + B * 10<sup>K1</sup>) * 10<sup>K2</sup> <br>
    y = L(temp)

Example: M = 100, B = 3, K1 = 2, K2 = -2, ori_v = 200, L = 0x00 (linear expression, the calculated value is the actual value) Calculation result: y = (100 x ori_v + 3 x 100) x 0.01 = ori_v + 3 = 203

Definition and Conversion of Reading Status for Threshold Sensors

1. The reading status corresponds to the value of the Status property of the scanner.

Reading StatusValueStatus Description
SCAN_NORMAL0Normal scanning
SCAN_FAILURE1The scanning fails for N (configurable) consecutive anti-jitter periods.
After the failure, the system disables the sensor and reports an SEL.
SCAN_PRE_FAILURE2The scanning fails for one anti-jitter period. If all scanning pre-failures occur, the scanning fails.
After the failure, the system disables the sensor.
SCAN_NOT_ACCESSIBLE3The scanning is not available. The scanned component object does not support scanning.
For example, the power is off, the status is being updated, or the read value is NA.
SCAN_NOT_SCANNED4Initial unscanned status

2. Conversion between the read value status and conversion conditions

Current StatusChanged StatusConversion Condition
02One-time read failure
03ScanEnable value changed from 1 to 0
10Read success for M consecutive times
13ScanEnable value changed from 1 to 0
20One-time read success
21Read failure for N consecutive times
23ScanEnable value changed from 1 to 0
30The ScanEnable value is changed from 0 to 1, and the next read is successful.
32The ScanEnable value is changed from 0 to 1, and the next read fails.

Discrete Sensor Configuration

Discrete sensors describe the discrete status of the hardware where the sensor is located, such as fan status or power status. They typically use discrete values like 0-Normal, 1-Faulty, 2-Unknown, and 3-NA for event alarms. The discrete sensor type is DiscreteSensor.

Configuring Properties

PropertyTypeDescription
OwnerIduint8Same as ThresholdSensor.
OwnerLunuint8Same as ThresholdSensor.
EntityIduint8Same as ThresholdSensor.
EntityInstanceuint8Same as ThresholdSensor.
Initializationuint8Sensor initialization option. The value is 0x63 for discrete sensors.
Capabilitiesuint8Sensor capabilities, used to configure features such as automatic adjustment mode, hysteresis, threshold access, and event control.
For details, see Table 43, Full Sensor Record -SDR Type 01h (P521).
SensorTypeuint8Sensor type
For details, see Table 42, Sensor Type Codes (P505).
ReadingTypeuint8Sensor read value type
For details, see Table 42, Event/Reading Type Code Ranges (P503).
SensorNamestringSensor name
AssertMaskuint16Sensor event generation mask, which determines whether the system can generate an event. Bit definitions:
[15]: Reserved (0b)
[14:0]: 15 discrete events. The configuration must match the discrete events of the associated sensor.
  Example: If the current configuration involves discrete events with EventData1 values of 1 and 3, set bit 1 and bit 3 of the assert mask.
DeassertMaskuint16Sensor event recovery mask, which determines whether the system can recover an event. Bit definitions:
[15]: Reserved (0b)
[14:0]: 15 discrete events. The configuration must match the discrete events of the associated sensor.
  Example: If the discrete events EventData1 are 1 and 3 and you need to report the recovery event, set bit 1 and bit 3 of the deassert mask.
DiscreteMaskuint16Sensor discrete value mask Bit definitions:
[15]: Reserved (0b)
[14:0]: Indicates whether the sensor can report a discrete state, corresponding to 15 discrete events. The configuration must match the discrete events of the associated sensor.
  Example: If the current configuration involves discrete events with EventData1 values of 1 and 3, set bit 1 and bit 3 of the discrete value mask.
Unituint8Sensor unit. The value is 0xC0 for discrete sensors.
BaseUnituint8Sensor base unit. The value is 0 for discrete sensors.
ModifierUnituint8Sensor unit descriptor. The value is 0 for discrete sensors.
DiscreteTypeuint8Sensor discrete type. For details, see Table 42, Sensor Type Codes (P505).
0: common discrete; 1: digital discrete
RecordSharinguint16Sensor record sharing and discrete reference direction. Set this parameter to 1.
SensorNumberuint16(Optional) Sensor number. The default value is 255, specified by the IPMI and generated by the BMC. If you require a special number, customize the number on the sensor customization page. (Sensors for components that are hot-inserted while the BMC is running cannot be customized.)

Key Configuration Points

  1. Set SensorType according to the table in the IPMI specifications.
  2. The ReadingType of a discrete sensor is 02h to 0Ch or 6Fh. You must set this property according to the configuration scenario of the discrete event.
  3. The configuration of the discrete sensor is related to the mounted discrete event. The two parameters must match each other. The Mask properties must match the discrete event configuration.

Configuration Example

json
"DiscreteSensor_FAN1FPresence": {
    "OwnerId": 32,
    "OwnerLun": 0,
    "EntityId": "<=/Entity_Fan1.Id",
    "EntityInstance": "<=/Entity_Fan1.Instance",
    "Initialization": 99, // Fixed value
    "Capabilities": 64,
    "SensorType": 10,
    "ReadingType": 8,
    "SensorName": "FAN1 Presence",
    "DiscreteType": 0, // Discrete value mask
    "Unit": 192,
    "BaseUnit": 0,
    "ModifierUnit": 0,
    "RecordSharing": 1, // Sensor record sharing and discrete reference direction
    "Reading": 0, // This parameter is meaningless for discrete sensors and you do not need to set it.
    "SensorNumber": 255
}

Value range of the related properties:

  • Capabilities:

Discrete Event Configuration

If you do not configure a discrete event for a discrete sensor, the BMC cannot manage the sensor. You usually configure discrete events in the software CSR.

Configuring Properties

PropertyTypeDescription
ListenTypeuint8Discrete event listening methods:
0: Combined listening. The system derives all three data points and the direction for SEL from the Property.
1: Independent listening. The system derives the three data points and the direction for SEL from the current object property.
Propertyuint32Property of discrete event listening method, used for combined listening.
The value is 4 bytes. The four bytes from high to low indicate event_dir, event_data3, event_data2, and event_data1. For details about the data, see the description of the corresponding property of the current object.
Conversionuint8Discrete event flip flag. The upper four bits serve as the mask of event_data1 during combined listening, and the lower four bits indicate whether to flip the event direction.
1: flip
Non-1: no flip
EventDiruint8Property of discrete event listening method, used for independent listening.
Directions of discrete event:
0: recovery
Non-0: generation
EventData1uint8This property is used for independent listening.
This is the primary data field generated upon a discrete event. For the data meaning, see 29.7 Event Data Field Formats. Specifically, the lower 4 bits represent the event offset. When configuring this field, refer to the Offset column in Table 42-, Generic Event/Reading Type Codes or Table 42-, Sensor Type Codes.
EventData2uint8This property is used for independent listening.
This is the secondary data field generated upon a discrete event. For the data meaning, see 29.7 Event Data Field Formats. For the application requirements, see Table 42-, Generic Event/Reading Type Codes or Table 42-, Sensor Type Codes. If there is no application requirement, set this field to the default value 255.
EventData3uint8This property is used for independent listening.
This is the third data field generated upon a discrete event. For the data meaning, see 29.7 Event Data Field Formats. For the application requirements, see Table 42-, Generic Event/Reading Type Codes or Table 42-, Sensor Type Codes. If there is no application requirement, set this field to the default value 255.
SensorObjectstringDiscrete sensor associated with the discrete event. When the system generates or clears the IPMI SEL, it displays the health status and SEL of the current sensor.

Key Configuration Points

  1. There is no requirement for the listening mode. You can select the listening mode as needed. If you select combined listening, ensure that you set the Property attribute as required and correctly configure the data of each byte according to the meaning. If you select independent listening, ensure that you correctly configure the three pieces of EventData data and EventDir properties according to the meaning.
  2. The IPMI specifications define discrete events. Configure discrete events according to the descriptions and definitions in the IPMI specifications.

Configuration Example

The following example describes how to configure a fan presence event by using a fan presence sensor.

json
"DiscreteEvent_FAN1FPresence": {
    "Property": "<=/Scanner_Fan1_Presence.Value",
    "ListenType": 1, //Independent listening
    "EventData1": 0,
    "EventData2": 255,
    "EventData3": 255,
    "EventDir": "<=/Scanner_Fan1_Presence.Value",
    "Conversion": 1, //Event flip
    "SensorObject": "#/DiscreteSensor_FAN1FPresence" //Associate with the discrete sensor in the previous section.
}

After you complete the preceding configurations, the BMC can manage the FAN1 presence status, temperature, and power status. You can then proceed with commissioning.

Event Filter and Description Configuration

Before an event is reported, openUBMC filters it based on preset configurations (for example, to prevent frequent reporting of insignificant alarms). If the filter result is true, the system reports the event; if false, the system ignores it.

IpmiSelFilter and IpmiSelDesc serve as common mechanisms. For details about the design and implementation, see [sensor].

A sensor can report events only if they pass the event filtering criteria. The system ignores events that fail the filter and does not report them. Currently, openUBMC has developed 60 general IpmiSelFilters, which are stored in the proto/datas.yaml directory of the sensor repository. You can use the filters as required. If the existing filters do not meet the requirements, you must add new filters.

Configuring Properties

PropertyTypeDescription
SensorTypeuint8Event sensor type, which must be the same as the SensorType of the sensor.
ReadingTypeuint8Event reading value type, which must be the same as the ReadingType of the sensor.
FilterMask1uint16Filter mask 1, which must be the same as the AssertMask of the sensor.
FilterMask2uint16Filter mask 2. The default value is 0xFFFF.
FilterMask3uint16Filter mask 3. The default value is 0xFFFF.

Configuration Example

yaml
t_ipmi_sel_filters: //The specific configuration is determined by the actual service.
  - FilterMask1: 0x0a94
    FilterMask2: 0xffff
    FilterMask3: 0xffff
    ReadingType: 0x01
    SensorType: 0x01

Configuring Properties

PropertyTypeDescription
SensorTypeuint8Event sensor type, which must be the same as the SensorType of the sensor.
ReadingTypeuint8Event reading value type, which must be the same as the ReadingType of the sensor.
SelData1uint8Parameter 1. The default value is 0xFFFF.
SelData2uint8Parameter 2. The default value is 0xFFFF.
SelData3uint8Parameter 3. The default value is 0xFFFF.
SelDescstringEvent description.
AlarmLeveluint8Level of the corresponding event.
ShieldFlaguint8Whether the system masks the event. The default value is 0.

Configuration Example

yaml
t_ipmi_sel_descs:       //The specific configuration is determined by the actual service.
  - SensorType: 0xff
    ReadingType: 0x01
    SelData1: 0x00
    SelData2: 0xff
    SelData3: 0xff
    SelDesc: "Lower Non-critical going low"
    AlarmLevel: 1
    ShieldFlag: 0

Debugging Methods

You can check whether the sensor configuration is successful through package generation and board debugging. After building components, building the entire package, and upgrading the entire package by referring to [integrate_a_device], you can query the sensor using the following methods:

Web

The openUBMC WebUI provides threshold sensor query. Log in to the openUBMC WebUI, choose System > System Info > Sensor Info, and query the current threshold sensor.

IPMI

The openUBMC WebUI supports IPMI commands to query all sensors. You can run the sensor list command to query the information in in-band or out-of-band mode.

  • In-band query: ipmitool sensor list
  • Out-of-band query: ipmitool -I lanplus -H <host> -p 623 -U <username> -P <password> -C 17 sensor list

CLI

openUBMC supports CLI commands to query all sensors. Log in to openUBMC using SSH and run the ipmcget -t sensor -d list command.

Redfish

openUBMC supports Redfish interfaces for query. You can query the threshold sensor and discrete sensor using the GET request. Use the Postman tool to send the following requests to the test environment:

  • Threshold sensor URI: redfish/v1/Chassis/:chassisid/ThresholdSensors
  • Discrete sensor URI: redfish/v1/Chassis/:chassisid/DiscreteSensors

Sensor Adaptation FAQ Guide

Q01: Can sensors displayed by ipmitool sdr elist be sorted numerically by the sensor name?

Symptoms:

Current discrete sensors, for example, DIMMxxx, are not displayed in the numerical order of their names. The expectation is that DIMMs should be displayed in the order of DIMM000, DIMM001, DIMM010, and so on.

Solution:

The registration of sensor objects and corresponding SDR data is processed in the order of sensor CSR object distribution. The sequence in which the system distributes CSR objects to components cannot be guaranteed. To address this requirement, you can optimize the sensor object registration process in the sensor repository. The current registration process is as follows:

When the system distributes a sensor CSR object (on_add_object), it first caches the object (temp_store_sensor). After the system distributes all objects for a given position (on_add_object_complete), it handles the registration of sensors and SDRs collectively (register_sensors). You can optimize the register_sensors processing as follows:

lua
-- Original Process
Step 1: Retrieve all cached sensor objects for the current position from the cache.
local pos_sensors = unregistered_sensors[position]
Step 2: Iterate through the sensor objects in pos_sensors and perform registration.

-- Optimized Process
Step 1: Retrieve all cached sensor objects for the current position from the cache.
local pos_sensors = unregistered_sensors[position]
Step 2: Sort pos_sensors based on the SensorName attribute of all sensor objects.
Step 3: Iterate through the sensor objects in pos_sensors and perform registration.

Q02: A new threshold sensor .sr file was added, but it is not displayed on the sensor page. How to analyze?

Solution:

  1. Taking the board name openUBMC as an example, check if you added the new .sr file path to vpd/vendor/Huawei/Server/Kunpeng/openUBMC/profile.txt.
  2. Check the Presence configuration in the Entity. If the attribute is 0, the system will not load the .sr file.
  3. Check the PowerState configuration in the Entity. If the attribute is 0, the Entity becomes invalid, which causes the system to set the sensor Status to Disabled.
  4. Check the Capabilities attribute in the ThresholdSensor. If bit 7 is set to 1, the sensor will be disabled if the Entity is invalid.
  5. Check the ReadingStatus and Status attributes in the ThresholdSensor. If ReadingStatus is 0 or Status is Disabled, the sensor will not display a reading.

Q03: How to view sensor alarms via commands?

Solution:

Run the ipmitool sel list/elist command to view sensor alarms. Note that ipmcget -d sel -v list reads precise alarms, not sensor events, which correspond to system events on the Web page.

Q04: What are the methods for simulating discrete and threshold sensor alarms?

Solution:

You can use mdbctl setprop to modify the Value in the Scanner to trigger an alarm.
Command Description:

shell
setprop <operation type> <object name> <interface name> <property name>

Parameter Description:

  • operation type: Mandatory. Provides two modes: set and unset, representing setting a property value or clearing it.
  • object name: Mandatory. The object to which the specified attribute interface belongs. You can use lsobj to query which objects the component has.
  • interface name: Mandatory. The interface where the specified attribute is located. You can use lsprop to query which interfaces are attached to the object.
  • property name: Mandatory. The specified attribute. You can use lsprop to query the attributes under the object.

Usage Example: Simulating an alarm for the threshold sensor Inlet Temp. It is known that the upper non-critical and upper critical thresholds for Inlet Temp are 41 and 43, respectively.

shell
# The debug mode interface has been accessed and the hardware proxy module is connected.
% attach hwproxy
Success
# Check objects under Scanner
% lsobj Scanner
Scanner_Lm75_Inlet_0101
...
# Check the attributes of the Scanner_Lm75_Inlet_0101 object. Current Value is 29.
% lsprop Scanner_Lm75_Inlet_0101 
bmc.kepler.Object.Properties
  ClassName="Scanner"
  ObjectIdentifier=[1,"1","1","0101"]
  ObjectName="Scanner_Lm75_Inlet_0101"
  TraceSamplingRate=0
bmc.kepler.Scanner
  Status=0
  Value=29
bmc.kepler.Scanner.Aggregate
  AggregateOffset=0
  AggregateStatus=false
Private
  Chip="Lm75_InletTemp_0101"
  Debounce="MidAvg_Inlet_0101"
  FailureDebounceCount=10
  Mask=255
  NominalValue=0
  Offset=0
  Period=1000
  ScanEnabled=1
  Size=1
  SuccessDebounceCount=10
  Type=0
# Modify the Value of the Scanner to 50 to trigger an alarm.
% setprop set Scanner_Lm75_Inlet_0101 bmc.kepler.Scanner Value 50
Success
# Check the attributes of the Scanner_Lm75_Inlet_0101 object again. The Value has been successfully modified.
% lsprop Scanner_Lm75_Inlet_0101                                 
bmc.kepler.Object.Properties
  ClassName="Scanner"
  ObjectIdentifier=[1,"1","1","0101"]
  ObjectName="Scanner_Lm75_Inlet_0101"
  TraceSamplingRate=0
bmc.kepler.Scanner
  Status=0
  Value=50
bmc.kepler.Scanner.Aggregate
  AggregateOffset=0
  AggregateStatus=false
Private
  Chip="Lm75_InletTemp_0101"
  Debounce="MidAvg_Inlet_0101"
  FailureDebounceCount=10
  Mask=255
  NominalValue=0
  Offset=0
  Period=1000
  ScanEnabled=1
  Size=1
  SuccessDebounceCount=10
  Type=0

# Clear the setting and resume normal scanning to clear the alarm.
% setprop unset Scanner_Lm75_Inlet_0101 bmc.kepler.Scanner Value   
Success

Q05: What is the meaning of the discrete sensor status displayed on the Web page?

Solution:

Discrete Sensor Status Description:

  • Disabled: Indicates that the current discrete sensor is disabled.
  • 0xXXXX (for example, 0x8000) is defined according to the IPMI specification. It represents the current sensor status in hexadecimal. For specific meanings, please refer to the explanation of the Generic Offset field in Table 42-2 Generic Event/Reading Type Codes and the Sensor specific Offset field in Table 42-3 Sensor Type Codes in the IPMI specification.

Using DIMM000 as an example, a status value of 0x8040 means bit 6 is 1. Since the SensorType for DIMM000 is configured as 12 (0x0c) and ReadingType is 0x6f, according to the standard specification, a "Presence Detected" event has been generated.