From fe432781968b417bf57895bcda0c227efe66f1f4 Mon Sep 17 00:00:00 2001 From: Jean-Michel Audet Date: Thu, 29 Apr 2010 18:45:12 +0000 Subject: [PATCH] - Add sensor hysteresis (positive & negative) to the following command: ipmitool sensor -v --- ipmitool/lib/ipmi_sensor.c | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/ipmitool/lib/ipmi_sensor.c b/ipmitool/lib/ipmi_sensor.c index f956d69..e39041c 100644 --- a/ipmitool/lib/ipmi_sensor.c +++ b/ipmitool/lib/ipmi_sensor.c @@ -386,8 +386,7 @@ ipmi_sensor_print_full_analog(struct ipmi_intf *intf, status ? : ""); if (thresh_available) { - if (rsp-> - data[0] & LOWER_NON_RECOV_SPECIFIED) + if (rsp->data[0] & LOWER_NON_RECOV_SPECIFIED) printf (" Lower Non-Recoverable : %.3f\n", sdr_convert_sensor_reading @@ -403,8 +402,7 @@ ipmi_sensor_print_full_analog(struct ipmi_intf *intf, else printf (" Lower Critical : na\n"); - if (rsp-> - data[0] & LOWER_NON_CRIT_SPECIFIED) + if (rsp->data[0] & LOWER_NON_CRIT_SPECIFIED) printf (" Lower Non-Critical : %.3f\n", sdr_convert_sensor_reading @@ -412,8 +410,7 @@ ipmi_sensor_print_full_analog(struct ipmi_intf *intf, else printf (" Lower Non-Critical : na\n"); - if (rsp-> - data[0] & UPPER_NON_CRIT_SPECIFIED) + if (rsp->data[0] & UPPER_NON_CRIT_SPECIFIED) printf (" Upper Non-Critical : %.3f\n", sdr_convert_sensor_reading @@ -429,8 +426,7 @@ ipmi_sensor_print_full_analog(struct ipmi_intf *intf, else printf (" Upper Critical : na\n"); - if (rsp-> - data[0] & UPPER_NON_RECOV_SPECIFIED) + if (rsp->data[0] & UPPER_NON_RECOV_SPECIFIED) printf (" Upper Non-Recoverable : %.3f\n", sdr_convert_sensor_reading @@ -438,6 +434,28 @@ ipmi_sensor_print_full_analog(struct ipmi_intf *intf, else printf (" Upper Non-Recoverable : na\n"); + + if ( + sensor->threshold.hysteresis.positive == 0x00 + || + sensor->threshold.hysteresis.positive == 0xff + ) + printf(" Positive Hysteresis : Unspecified\n"); + else + printf(" Positive Hysteresis : %.3f\n", + sdr_convert_sensor_hysterisis + (sensor,sensor->threshold.hysteresis.positive)); + + if ( + sensor->threshold.hysteresis.negative == 0x00 + || + sensor->threshold.hysteresis.negative == 0xff + ) + printf(" Negative Hysteresis : Unspecified\n"); + else + printf(" Negative Hysteresis : %.3f\n", + sdr_convert_sensor_hysterisis + (sensor,sensor->threshold.hysteresis.negative)); } else { printf(" Sensor Threshold Settings not available\n"); }