bmc icon indicating copy to clipboard operation
bmc copied to clipboard

How to list discrete sensors

Open lukeyeager opened this issue 2 years ago • 1 comments

When I compare the results of ipmitool sensor list with the list of sensors in the result from RetrieveSDRRepository(), I see many more sensors returned by ipmitool. They are all "discrete" (binary?) sensors - here is an example:

Presence         | 0x0        | discrete   | 0x0180| na        | na        | na        | na        | na        | na

From a printf I added, it looks to me like the filtering happens on this line: https://github.com/gebn/bmc/blob/455e4875b22f031f29c6c8bd58c3a04e7221246c/sdr_repository.go#L91

Is there any way to list those filtered sensors using this library rather than discarding them?

lukeyeager avatar Apr 05 '23 20:04 lukeyeager

Not currently, as I only needed SDR Type 0x1 (Full Sensor Record), which is defined in 43.1 here. Discrete sensors are likely each represented by an SDR Type 0x2 (Compact Sensor Record), specified in 43.2, though it would be worth confirming with IPMItool's raw output mode before doing any work. SDRRepository would have to become a struct, as it is currently a map of only FSRs. Shouldn't be too tricky to write - less work than implementing FSR. Happy to review a PR!

gebn avatar Apr 06 '23 09:04 gebn