Skip to content

Read each sensor from its owner: Send Message bridging, LUN and Device SDRs (#84, #105) - #192

Merged
bertysentry merged 6 commits into
mainfrom
84-105-sensor-owner-bridging
Oct 16, 2026
Merged

bertysentry merged 6 commits into
mainfrom
84-105-sensor-owner-bridging

Conversation

@bertysentry

Copy link
Copy Markdown
Contributor

Fixes #84. Fixes #105.

Each sensor is now read from the owner its SDR record names (IPMI 2.0 section 5.4), where the library sent every Get Sensor Reading to LUN 0 of the BMC.

Owner in the record Before Now
The BMC (20h, channel 0) LUN 0 the LUN of the record
Another controller Get Sensor Reading to the BMC, which answered for its own sensor of that number, or CBh Get Sensor Reading forwarded by the BMC with Send Message (section 6.13.3)
System software (owner ID bit 0 set) same: the state of an unrelated BMC sensor no request: UNAVAILABLE, no states, problem() says why

Protocol core

  • SendMessage<R> (App 34h) carries any command to a controller behind the BMC with response tracking (40h | channel), the IPMB message addressed to the controller, requester 81h and the same sequence number as the Send Message request, as ipmitool lanplus does. The BMC answers Send Message at once and forwards the controller's response under that sequence number; some BMCs put it in their response to Send Message instead: both are accepted. describeCompletionCode() names the Send Message codes 80h-83h.
  • IpmiCommandCoder.answers(IpmiLanMessage): the reply matching of IpmiMessageHandler moved to the coder, so that SendMessage can wait past the empty response to Send Message itself.
  • LUN argument on GetSensorReading and GetSensorReadingFactors.
  • GetDeviceSdrInfo (S/E 20h), GetDeviceSdr (S/E 21h, 80h record changed decoded as a canceled reservation), ReserveDeviceSdrRepository (S/E 22h).

Client

  • sensors() routes each reading as in the table above. A controller that does not answer costs its own sensors only: a lost reply to Send Message never marks the session lost, and the other sensors of that controller are not requested again during the same operation.
  • A BMC that refuses Get SDR Repository Info and whose Get Device ID says Sensor Device + provides Device SDRs + no SDR Repository Device (the ipmitool rule) is walked with Get Device SDR.

Privilege

Send Message to another channel needs Operator (table G-1, note 2). Live: the HPE iLO 5 allows it at User, the AMI-based GIGABYTE BMC only at Administrator (D4h at User and Operator). Below the level the BMC requires, the bridged sensors come back without reading with the D4h in problem(); the BMC's own sensors are unaffected. Documented in sensors.md, configuration.md, cli.md, supported-commands.md.

Live results (lab, 2026-10-16)

Survey of the SDR owners on 36 cards:

  • Dell iDRAC 6, iDRAC 8 and the F200 cards: 33 to 55 Compact sensors owned by B1h (system software) on every card. main returned for them the state of the BMC sensor with the same number (e.g. Memory Mirrored = VCore PG); the branch returns them UNAVAILABLE with The sensor belongs to system software (owner ID B1h), not to a controller: it has no reading.
  • HPE iLO 5: 50 sensors on satellite controllers 44h (ChasMC: fans, power supplies), 2Ch (embedded NIC) and 28h (embedded RAID: drive status). main got CBh or another sensor's value; the branch reads them all through the BMC at User level (separate-reply style), with consistent values (PS 1 output 80 W ≈ 12 V × 6.6 A, input 100 W ≈ 227 V × 0.4 A).
  • GIGABYTE (AMI): no sensor owned by another controller; Send Message to the Intel ME at 2Ch on channel 6 works as Administrator (Get Device ID: manufacturer 343, firmware 4.44, reply from 2Ch).
  • All other cards (Lenovo IMM/XCC, Cisco IMC, Fujitsu iRMC, Supermicro): every sensor owned by 20h, channel 0, LUN 0: unchanged path.
  • No lab sensor sits at a LUN other than 0 or on another channel, and no lab BMC lacks an SDR repository: the LUN and the Device SDR walk are covered by the fake BMC only (the Intel ME answers C1h to Get Device SDR Info).

Tests

The fake BMC models a controller behind it (satellite(), reply separate, embedded or never, 83h for an unknown address), the request LUN, and Device SDRs. New tests: each sensor read from its owner (both reply styles), a silent and an absent controller, a BMC walked through its Device SDRs. Mutation-checked: ignoring the empty Send Message response, losing the session on a bridged timeout, dropping the LUN and skipping the Device SDR rule each fail a test.

🤖 Generated with Claude Code

bertysentry and others added 3 commits October 16, 2026 00:35
SendMessage carries any command to a controller behind the BMC (Send
Message with response tracking, IPMI 2.0 sections 6.13.3 and 22.7): the
IPMB message is addressed to the controller, keeps the remote console as
requester and the sequence number of the Send Message request, as
ipmitool lanplus does. The empty response to Send Message itself does not
end the exchange: the response of the controller follows under the same
tag, or comes in the data of that response on some BMCs.

To let a command wait past such a reply, the reply matching of
IpmiMessageHandler moves to IpmiCommandCoder.answers(), which SendMessage
overrides.

GetSensorReading and GetSensorReadingFactors take the LUN of the sensor
owner. GetDeviceSdrInfo, GetDeviceSdr and ReserveDeviceSdrRepository read
the SDRs a Sensor Device holds itself (section 35).

Refs #84, #105

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sensors() sent every Get Sensor Reading to LUN 0 of the BMC, which
answered for its own sensor of that number when the record named another
owner: the BIOS sensors of Dell iDRACs (owner B1h, a software ID) got the
states of unrelated BMC sensors, and the fan, power supply, NIC and drive
sensors of an HPE iLO 5 (satellite controllers 44h, 2Ch, 28h) got CBh or
another sensor's reading.

Now a sensor of the BMC is read at the LUN of its record, a sensor of
another controller through the BMC with Send Message, and a sensor of
system software not at all (UNAVAILABLE, with its problem). A controller
that does not answer costs its own sensors only: a lost reply to Send
Message does not lose the session, and the walk does not wait for that
controller again.

A BMC that refuses Get SDR Repository Info and reports Device SDRs without
SDR Repository in Get Device ID is walked with Get Device SDR, as ipmitool
does.

Live: iLO 5 bridged at User level (50 sensors), the GIGABYTE AMI BMC
bridges to the Intel ME (2Ch, channel 6) at Administrator only. No lab BMC
has a sensor at another LUN or lacks an SDR repository: those paths are
covered by the fake BMC, which now models a controller behind the BMC,
the request LUN and Device SDRs.

Fixes #84
Fixes #105

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sensors.md explains how each owner is read and the privilege Send Message
needs (Operator by the specification, User on iLO 5, Administrator on an
AMI BMC); low-level-api.md shows SendMessage to the Intel ME; the
supported commands, the privilege tables, the CLI page, troubleshooting
and upgrading.md follow.

Refs #84, #105

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T12:27:38.155929Z 58d70f6 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 318a8a2493

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main/java/org/metricshub/ipmi/client/IpmiClient.java Outdated
Comment thread src/main/java/org/metricshub/ipmi/client/SdrWalker.java Outdated
Comment thread src/site/markdown/configuration.md
A Send Message request without reply kept the session whatever went
wrong, so a BMC that stopped answering while only bridged sensors were
left gave a list of unavailable sensors instead of a lost session and its
replay. SendMessage now records whether the BMC answered Send Message
itself; only then is a missing response that of the controller.

Without the count of the Device SDRs (Get Device SDR Info refused or
malformed), "record not present" to the first record ends the walk with
no record instead of failing it; the same holds for a repository whose
Get SDR Repository Info is refused. GetDeviceSdrInfo rejects a dynamic
population without its change indicator, and README.md gives the
privilege the sensors of other controllers need.

Refs #84, #105

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db5145001b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/main/java/org/metricshub/ipmi/client/IpmiClient.java Outdated
The acknowledgment of the BMC is reset each time SendMessage is encoded,
so that the last try decides: a BMC that acknowledged an earlier try and
then stopped answering loses the session instead of passing for a silent
controller.

A bridged non-linear sensor whose controller answers Get Sensor Reading
but not Get Sensor Reading Factors loses its conversion only: the
controller is no longer taken for silent for the rest of the walk.

GetDeviceSdrInfo takes the LUN to address, for the sensor count of each
LUN (IPMI 2.0 table 35-2).

Refs #84, #105

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3548401fea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

acknowledged = true;
return reply.getData() != null;
}
return command.answers(reply);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Match bridged replies to the intended controller

When a satellite responds after its request has timed out and the 6-bit tag is later reused during a long sensor walk, this branch accepts the stale reply for another SendMessage whenever the carried command and network function match. Because it ignores the reply's responder address and LUN, a delayed Get Sensor Reading response from one controller can become another controller's sensor value; match the carried response to the target controller and LUN as well.

AGENTS.md reference: AGENTS.md:L42-L42

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changed. The spec (IPMI 2.0 section 6.13.4) lets the BMC answer a bridged request with its own address (20h) or the controller's, and asks the console to accept both. The iLO 5 in our lab answers with 20h for every controller, so the responder address cannot tell two controllers apart there, and a LUN check would rely on BMCs preserving fields the spec does not ask them to keep. A stale reply would also have to outlive the 5-second IPMB pending-response expiry of the BMC and a full cycle of the 48 tags, the same window every command has, direct ones included. If that window ever matters, the fix belongs in the tag allocation of the message queue, not in Send Message.

🤖 Addressed by Claude Code

Comment thread src/main/java/org/metricshub/ipmi/client/IpmiClient.java Outdated
Comment thread src/site/markdown/low-level-api.md Outdated
Comment thread src/main/java/org/metricshub/ipmi/client/SdrWalker.java Outdated
…ation

A controller that does not answer at one LUN no longer hides the sensors
of its other LUNs for the rest of the walk, and the problem names the
LUN when it is not 0.

A device with a dynamic sensor population may lose its records between
Get Device SDR Info and the first Get Device SDR: "record not present" to
the first record then ends the walk with no record, as when the count is
unknown.

low-level-api.md says that only a reply lost after the BMC acknowledged
Send Message keeps the session.

Refs #84, #105

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bertysentry

Copy link
Copy Markdown
Contributor Author

@codex please review the last commit that you haven't reviewed yet

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 58d70f6495

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

Labels

None yet

Projects

None yet

1 participant