11
29
Fork
You've already forked ipmitool
33

dcmi get_temp_reading output alignment is inconsistent #88

Open
opened 2026年06月13日 11:15:38 +02:00 by cpt1020 · 0 comments

Describe the bug

The output columns in ipmitool dcmi get_temp_reading are not consistently aligned.

The Entity Instance and Temp. Readings columns for inlet and CPU sensors appear in different positions compared to the baseboard sensor entries.

IPMITOOL Version

$ ipmitool -V
ipmitool version 1.8.19.59.gd62a996

To Reproduce
Steps to reproduce the behavior:

  1. Build the latest code from the current master branch.
  2. Run ipmitool -I lanplus -H <bmc-ip> -U <user> -P <password> dcmi get_temp_reading
  3. Observe the abnormal reply:
 Entity ID Entity Instance Temp. Readings
Inlet air temperature(40h) 1 +30 C
CPU temperature sensors(41h) 1 +41 C
CPU temperature sensors(41h) 2 +36 C
CPU temperature sensors(41h) 3 +37 C
Baseboard temperature sensors(42h) 1 +34 C
Baseboard temperature sensors(42h) 2 +33 C
Baseboard temperature sensors(42h) 3 +35 C
Baseboard temperature sensors(42h) 4 +33 C
Baseboard temperature sensors(42h) 5 +33 C
Baseboard temperature sensors(42h) 6 +32 C
Baseboard temperature sensors(42h) 7 +31 C
Baseboard temperature sensors(42h) 8 +36 C

Expected behavior

The Entity Instance and Temp. Readings columns should appear at the same positions for every row.

Additional context

The current implementation relies on tab characters (\t) for alignment. Since the sensor description strings have different lengths, the resulting column positions vary between sensor categories.

A possible solution is to use fixed-width formatting instead of tab-based alignment.

For example:

  • Entity ID field: fixed width of 45 characters
  • Entity Instance field: fixed width of 15 characters
  • Temp. Readings field follows afterward

I have tested a local patch that uses fixed-width formatting and it produces consistently aligned output.

 Entity ID Entity Instance Temp. Readings
Inlet air temperature(40h) 1 +30 C
CPU temperature sensors(41h) 1 +41 C
CPU temperature sensors(41h) 2 +36 C
CPU temperature sensors(41h) 3 +37 C
Baseboard temperature sensors(42h) 1 +35 C
Baseboard temperature sensors(42h) 2 +33 C
Baseboard temperature sensors(42h) 3 +35 C
Baseboard temperature sensors(42h) 4 +33 C
Baseboard temperature sensors(42h) 5 +33 C
Baseboard temperature sensors(42h) 6 +32 C
Baseboard temperature sensors(42h) 7 +31 C
Baseboard temperature sensors(42h) 8 +36 C

If this approach is acceptable, I would be happy to submit a pull request.

**Describe the bug** The output columns in `ipmitool dcmi get_temp_reading` are not consistently aligned. The `Entity Instance` and `Temp. Readings` columns for inlet and CPU sensors appear in different positions compared to the baseboard sensor entries. **IPMITOOL Version** ```none $ ipmitool -V ipmitool version 1.8.19.59.gd62a996 ``` **To Reproduce** Steps to reproduce the behavior: 1. Build the latest code from the current master branch. 2. Run `ipmitool -I lanplus -H <bmc-ip> -U <user> -P <password> dcmi get_temp_reading` 3. Observe the abnormal reply: ```none Entity ID Entity Instance Temp. Readings Inlet air temperature(40h) 1 +30 C CPU temperature sensors(41h) 1 +41 C CPU temperature sensors(41h) 2 +36 C CPU temperature sensors(41h) 3 +37 C Baseboard temperature sensors(42h) 1 +34 C Baseboard temperature sensors(42h) 2 +33 C Baseboard temperature sensors(42h) 3 +35 C Baseboard temperature sensors(42h) 4 +33 C Baseboard temperature sensors(42h) 5 +33 C Baseboard temperature sensors(42h) 6 +32 C Baseboard temperature sensors(42h) 7 +31 C Baseboard temperature sensors(42h) 8 +36 C ``` **Expected behavior** The `Entity Instance` and `Temp. Readings` columns should appear at the same positions for every row. **Additional context** The current implementation relies on tab characters (`\t`) for alignment. Since the sensor description strings have different lengths, the resulting column positions vary between sensor categories. A possible solution is to use fixed-width formatting instead of tab-based alignment. For example: - `Entity ID` field: fixed width of 45 characters - `Entity Instance` field: fixed width of 15 characters - `Temp. Readings` field follows afterward I have tested a local patch that uses fixed-width formatting and it produces consistently aligned output. ```none Entity ID Entity Instance Temp. Readings Inlet air temperature(40h) 1 +30 C CPU temperature sensors(41h) 1 +41 C CPU temperature sensors(41h) 2 +36 C CPU temperature sensors(41h) 3 +37 C Baseboard temperature sensors(42h) 1 +35 C Baseboard temperature sensors(42h) 2 +33 C Baseboard temperature sensors(42h) 3 +35 C Baseboard temperature sensors(42h) 4 +33 C Baseboard temperature sensors(42h) 5 +33 C Baseboard temperature sensors(42h) 6 +32 C Baseboard temperature sensors(42h) 7 +31 C Baseboard temperature sensors(42h) 8 +36 C ``` If this approach is acceptable, I would be happy to submit a pull request.
Sign in to join this conversation.
No Branch/Tag specified
master
bugfix/43-Fix-timezone-and-DST-in-SEL
pages
bugfix/fix-ci-builds
feature/refactor-sdr-name-handling
cleanup/nm
feature/add-support-for-boot-mailbox
codefactor
bugfix/26
IPMITOOL_1_8_19
IPMITOOL_1_8_18
IPMITOOL_1_8_17
IPMITOOL_1_8_16
IPMITOOL_1_8_15
IPMITOOL_1_8_15RC1
IPMITOOL_1_8_14
IPMITOOL_1_8_14RC2
IPMITOOL_1_8_14RC1
ipmitool
IPMITOOL_1_8_13
IPMITOOL_1_8_13RC1
IPMITOOL_1_8_12
IPMITOOL_1_8_9
IPMITOOL_1_8_8
IPMITOOL_1_8_7
IPMITOOL_1_8_6
IPMITOOL_1_8_5
IPMITOOL_1_8_0
IPMITOOL_S10_U1
IPMITOOL_1_6_1
IPMITOOL_1_6_0
IPMITOOL_1_5_9
IPMITOOL_1_5_8
IPMITOOL_1_5_7
IPMITOOL_1_5_6
IPMITOOL_1_5_4
IPMITOOL_1_4_1_1
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
IPMITool/ipmitool#88
Reference in a new issue
IPMITool/ipmitool
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?