Skip to content

Sensor output: zero thresholds reported as missing, readings for 'no analog reading' records, OEM sensors with one state byte #129

Description

@bertysentry

Where: src/main/java/org/metricshub/ipmi/client/IpmiResultConverter.java (getThresholdValue, getAvailableThreshold, extractFullSensorReadingValue), src/main/java/org/metricshub/ipmi/client/runner/GetSensorsRunner.java (buildStates, buildOemState), src/main/java/org/metricshub/ipmi/core/coding/commands/sdr/record/FullSensorRecord.java (calcFormula).

What happens:

  1. A threshold of 0 is reported as missing. getThresholdValue() emits an empty field whenever the decoded threshold is 0.0, and getAvailableThreshold() skips such thresholds to fall back to the next one. A real threshold of 0 (a lower fan threshold of 0 RPM, a lower temperature threshold of 0 °C) is therefore reported as absent, or replaced by the next threshold of the fallback chain. FullSensorRecord leaves undefined and unreadable thresholds at 0.0, so the two cases cannot be told apart.
  2. Full records with no analog reading produce reading lines. When the data format of Sensor Units 1 is 11b (IPMI 2.0 Table 43-1: no analog reading), calcFormula() still converts the reading byte as an unsigned value, and IpmiResultConverter emits a Temperature/Voltage/Fan/Current/PowerConsumption/Energy line with a value that the BMC does not define as a reading.
  3. OEM sensors with one state byte get no state. For event/reading type 7Fh, buildOemState() requires 4 response bytes and throws otherwise; buildStates() turns the exception into an empty state. The second state byte (states 8-14) is optional in Get Sensor Reading, so a valid 3-byte response loses the state of the sensor.

Evidence: by the code and the specification (found by Codex while reviewing #124); not reproduced on the test BMCs.

Suggested fix: keep the availability of each threshold (the readable mask of byte 19, and the access support of byte 12) next to its value and test that instead of 0.0; skip the reading (keep the states) of Full records whose data format is 11b; format the available state byte(s) of OEM sensors (0xLL with one byte). Unit tests for each case.

Related: #82, #83 (threshold decoding), #110 (unavailable readings).

Activity

  1. bertysentry commented on Oct 8, 2026

    @bertysentry
    ContributorAuthor

    One more case, also found by Codex on #124: getStates() only returns the asserted states that have an entry in ReadingTypeDescription; createStateEntry() returns null for the others and appendReadingTypes() drops them. 30 of the 264 ReadingType constants have no description, including SessionActivated, SessionDeactivated and the threshold transitions (LowerNonCriticalGoingLow, UpperCriticalGoingHigh, ...). A sensor whose only asserted state is one of them gets an empty state, and its device-state line disappears from the text output. Suggested fix: add the missing descriptions (in the ipmiutil wording, like the others), and fall back to the enum name rather than dropping the state. By the code; not reproduced on the test BMCs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions