IPMI spec, chap. 35.14 Get Sensor Reading Command says, that the last byte of discrete reading sensor has bit 7 always set to 1 and it should be ignored when reading. So let's ignore it.
Without the patch: $ ipmitool sensor list RAC Status | 0x0 | discrete | 0x0780| na | na | na | na | na | na ... With the patch: RAC Status | 0x0 | discrete | 0x0700| na | na | na | na | na | na Signed-off-by: Jan Safranek <jsafr...@redhat.com> --- lib/ipmi_sensor.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ipmi_sensor.c b/lib/ipmi_sensor.c index ab76b47..738a2bd 100644 --- a/lib/ipmi_sensor.c +++ b/lib/ipmi_sensor.c @@ -188,7 +188,7 @@ ipmi_sensor_print_full_discrete(struct ipmi_intf *intf, if (validread) { printf("| 0x%-8x | %-10s | 0x%02x%02x", val, - unitstr, rsp->data[2], rsp->data[3]); + unitstr, rsp->data[2], rsp->data[3] & 0x7f); } else { printf("| %-10s | %-10s | %-6s", "na", unitstr, "na"); @@ -545,7 +545,7 @@ ipmi_sensor_print_compact(struct ipmi_intf *intf, if (validread) { printf("| 0x%-8x | %-10s | 0x%02x%02x", val, unitstr, - rsp->data[2], rsp->data[3]); + rsp->data[2], rsp->data[3] & 0x7f); } else { printf("| %-10s | %-10s | %-6s", "na", unitstr, "na"); ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Ipmitool-devel mailing list Ipmitool-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ipmitool-devel