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 Chain

Configuration Item Mandatory Configuration Description
Entity Yes Hardware entity corresponding to the sensor
Sensor Object: Threshold or Discrete Yes Sensor object for the resource collaboration interface
Sensor Event Yes This item is required only for discrete events
Event Filter No Event filtering method
Event Description No Level 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

Property Type Description
Id uint8 Entity ID corresponding to the sensor.
For details, see Table 43, Entity ID Codes (P550).
Instance uint8 Entity 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)*.
Slot uint8 Entity slot. The default value is 0xFF. If the slot is not the default one, the system generates a unique instance based on the slot.
Name string Name of the entity.
Presence uint8 The 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.
PowerState uint8 Power-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.

"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.

> 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

Property Type Description
OwnerId uint8 Owner ID of the sensor.
BMC - 0x20
OwnerLun uint8 Owner LUN of the sensor.
The owner is the system software - 0x00.
EntityId uint8 The entity ID of to the sensor, which is associated with the Entity.Id of the sensor.
EntityInstance uint8 The entity instance of to the sensor, which is associated with the Entity.Instance of the sensor.
Initialization uint8 Sensor initialization (threshold sensor - 0x7F)
Capabilities uint8 Sensor 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).
SensorType uint8 Sensor type.
For details, see Table 42, Sensor Type Codes (P505).
ReadingType uint8 Sensor read value type (threshold sensor - 0x01).
For details, see Table 42, Event/Reading Type Code Ranges (P503).
SensorName string Sensor name. If the value of this field contains more than 16 characters, the system truncates the excess characters.
AssertMask uint16 Sensor event generation mask, which determines whether the system can generate an event. The mask must match the threshold configured for the sensor.
DeassertMask uint16 Sensor event recovery mask, which determines whether the system can recover an event. The mask must match the threshold configured for the sensor.
ReadingMask uint16 Sensor read value mask, which determines whether the threshold can be displayed externally. The mask must match the threshold configured for the sensor.
Unit uint8 Sensor unit.
For details, see Table 43, Sensor Unit Type Codes (P554).
BaseUnit uint8 Sensor base unit.
For details, see Table 43, Sensor Unit Type Codes (P554).
ModifierUnit uint8 Unit descriptor.
For details, see Table 43, Sensor Unit Type Codes (P554).
Linearization uint8 Linear calculation equation. For details about the calculation method, see Conversion from the Raw Value to the Read Value for Threshold Sensors.
Analog uint8 Analog feature flag of the sensor. Generally, set this parameter to 1.
NominalReading uint8 Nominal read value of the sensor, derived from the IPMI specifications and following the data format range.
MaximumReading uint8 The 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.
MinimumReading uint8 The 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.
Reading uint8 Raw 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.
ReadingStatus uint8 Reading 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.

Property Type Description
Linearization uint8 Linear calculation equation. For details about the calculation method, see Conversion from the Raw Value to the Read Value for Threshold Sensors.
M uint8 One of the linearization parameters. The default value is 1, corresponding to the lower eight bits of the sensor M computation expression.
MT uint8 One of the linearization parameters, corresponding to the upper two bits of the sensor M computation expression and the tolerance.
B uint8 One of the linearization parameters, corresponding to the lower eight bits of the sensor B computation expression.
BA uint8 One of the linearization parameters, corresponding to the upper two bits of the sensor B computation expression and the lower six bits of the accuracy.
Accuracy uint8 One of the linearization parameters, corresponding to the upper six bits of the sensor accuracy and the sensor direction.
RBExp uint8 One of the linearization parameters, corresponding to the four bits of the sensor R/B calculation expression.
NormalMaximum uint8 The maximum read value of the sensor. The default value is 0.
NormalMinimum uint8 The minimum read value of the sensor. The default value is 0.
UpperNonrecoverable uint8 Upper limit of sensor emergency events, configured on demand.
UpperCritical uint8 Upper limit of sensor critical events, configured on demand.
UpperNoncritical uint8 Upper limit of sensor minor events, configured on demand.
LowerNonrecoverable uint8 Lower limit of sensor emergency events, configured on demand.
LowerCritical uint8 Lower limit of sensor critical events, configured on demand.
LowerNonCritical uint8 Lower limit of sensor minor events, configured on demand.
PositiveHysteresis uint8 Sensor rising event recovery hysteresis, configured on demand.
NegativeHysteresis uint8 Sensor decrease event recovery hysteresis, configured on demand.
SensorNumber uint16 (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
//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: image.png
  • DeassertMask: image.png
  • ReadingMask: image.png
  • Unit: image.png
  • Capabilities: image.png
Scaling Sensor
//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

Property Type Description
Linearization uint8 Sensor 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.
M uint8 [7:0] - Least significant 8 bits of M (signed, two's complement, 10-bit total)
MT uint8 [7:6] - Most significant 2 bits of M (signed, two's complement, 10-bit total)
[5:0] - Tolerance (unsigned, 6-bit)
B uint8 [7:0] - Least significant 8 bits of B (signed, two's complement, 10-bit total)
BA uint8 [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)
Accuracy uint8 [7:4] - Most significant 4 bits of precision (unsigned, 10-bit total)
[3:2] - Precision (unsigned, 2-bit total)
[1:0] - Sensor direction
RBExp uint8 [7:4] - RExp (K2, signed, two's complement, 4-bit total)
[3:0] - BExp (K1, signed, two's complement, 4-bit total)
Reading uint8 Raw 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:

    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 Status Value Status Description
SCAN_NORMAL 0 Normal scanning
SCAN_FAILURE 1 The scanning fails for N (configurable) consecutive anti-jitter periods.
After the failure, the system disables the sensor and reports an SEL.
SCAN_PRE_FAILURE 2 The 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_ACCESSIBLE 3 The 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_SCANNED 4 Initial unscanned status

2. Conversion between the read value status and conversion conditions

Current Status Changed Status Conversion Condition
0 2 One-time read failure
0 3 ScanEnable value changed from 1 to 0
1 0 Read success for M consecutive times
1 3 ScanEnable value changed from 1 to 0
2 0 One-time read success
2 1 Read failure for N consecutive times
2 3 ScanEnable value changed from 1 to 0
3 0 The ScanEnable value is changed from 0 to 1, and the next read is successful.
3 2 The 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

Property Type Description
OwnerId uint8 Same as ThresholdSensor.
OwnerLun uint8 Same as ThresholdSensor.
EntityId uint8 Same as ThresholdSensor.
EntityInstance uint8 Same as ThresholdSensor.
Initialization uint8 Sensor initialization option. The value is 0x63 for discrete sensors.
Capabilities uint8 Sensor 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).
SensorType uint8 Sensor type
For details, see Table 42, Sensor Type Codes (P505).
ReadingType uint8 Sensor read value type
For details, see Table 42, Event/Reading Type Code Ranges (P503).
SensorName string Sensor name
AssertMask uint16 Sensor 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.
DeassertMask uint16 Sensor 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.
DiscreteMask uint16 Sensor 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.
Unit uint8 Sensor unit. The value is 0xC0 for discrete sensors.
BaseUnit uint8 Sensor base unit. The value is 0 for discrete sensors.
ModifierUnit uint8 Sensor unit descriptor. The value is 0 for discrete sensors.
DiscreteType uint8 Sensor discrete type. For details, see Table 42, Sensor Type Codes (P505).
0: common discrete; 1: digital discrete
RecordSharing uint16 Sensor record sharing and discrete reference direction. Set this parameter to 1.
SensorNumber uint16 (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

"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:
    image.png

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

Property Type Description
ListenType uint8 Discrete 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.
Property uint32 Property 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.
Conversion uint8 Discrete 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
EventDir uint8 Property of discrete event listening method, used for independent listening.
Directions of discrete event:
0: recovery
Non-0: generation
EventData1 uint8 This 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.
EventData2 uint8 This 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.
EventData3 uint8 This 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.
SensorObject string Discrete 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.

"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

Property Type Description
SensorType uint8 Event sensor type, which must be the same as the SensorType of the sensor.
ReadingType uint8 Event reading value type, which must be the same as the ReadingType of the sensor.
FilterMask1 uint16 Filter mask 1, which must be the same as the AssertMask of the sensor.
FilterMask2 uint16 Filter mask 2. The default value is 0xFFFF.
FilterMask3 uint16 Filter mask 3. The default value is 0xFFFF.

Configuration Example

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

Property Type Description
SensorType uint8 Event sensor type, which must be the same as the SensorType of the sensor.
ReadingType uint8 Event reading value type, which must be the same as the ReadingType of the sensor.
SelData1 uint8 Parameter 1. The default value is 0xFFFF.
SelData2 uint8 Parameter 2. The default value is 0xFFFF.
SelData3 uint8 Parameter 3. The default value is 0xFFFF.
SelDesc string Event description.
AlarmLevel uint8 Level of the corresponding event.
ShieldFlag uint8 Whether the system masks the event. The default value is 0.

Configuration Example

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.

image.png

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

image.png

CLI

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

image.png

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 image.png
  • Discrete sensor URI: redfish/v1/Chassis/:chassisid/DiscreteSensors image.png

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. Symptoms 01

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:

-- 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:

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. Example 04

# 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

Example 04-2

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. Example 05