openbmc / dbus-sensors

D-Bus configurable sensor scanning applications
Apache License 2.0
27 stars 44 forks source link

Add a possibility to set thresholds for the secondary temperatures in a `hwmontempsensor` app #12

Closed Kostr closed 3 years ago

Kostr commented 3 years ago

I have a temperature sensor with several temp_* files. To export all of them I use several NameX keys in my EM *.json file:

"Name": "LM95232_Local",
"Name1": "LM95232_TD1",
"Name2": "LM95232_TD2",
"Name3": "LM95232_TD3",
"Name4": "LM95232_TD4",

But how to set thresholds for them? When I use

"Thresholds": [
...
]

it only sets thresholds for the first sensor. This is example output from the ipmitool sensor:

LM95232_Local  | 29.000     | degrees C  | ok    | na        | 0.000     | 5.000     | 38.000    | 40.000    | na
LM95232_TD1    | 37.000     | degrees C  | ok    | na        | na        | na        | na        | na        | na
LM95232_TD2    | 35.000     | degrees C  | ok    | na        | na        | na        | na        | na        | na
LM95232_TD3    | 35.000     | degrees C  | ok    | na        | na        | na        | na        | na        | na
LM95232_TD4    | 48.000     | degrees C  | ok    | na        | na        | na        | na        | na        | na

From the code inspection of https://github.com/openbmc/dbus-sensors/blob/7ea918f22b7df400dd11f909342ac4d256536000/src/HwmonTempMain.cpp#L248 it seems like for the keys Name1,Name2,... the thresholds are currenly set to be empty std::vector<thresholds::Threshold>(). So there is no way to set them with the dbus-sensors app. Am I correct?

edtanous commented 3 years ago

https://gerrit.openbmc-project.xyz/c/openbmc/dbus-sensors/+/41389

I believe resolves this, please comment in the context of that review. Because this isn't explicitly a bug I'm going to close this for now and let it resolve through gerrit. Once that patchset is merged, if you think there are bugs with the implementation, feel free to reopen.