ID:343 - Print actual sensor thresholds in 'sensors' comand

Use Get Sensor Threshold command for obtaining thresholds, since SDR records may
contain not actual threhsolds.
This commit is contained in:
Zdenek Styblik 2014-11-29 17:44:07 +01:00
parent f56d740d98
commit 0eaa2eae51

View File

@ -892,8 +892,20 @@ ipmi_sensor_get(struct ipmi_intf *intf, int argc, char **argv)
/* need to set verbose level to 1 */
v = verbose;
verbose = 1;
if (ipmi_sdr_print_listentry(intf, sdr) < 0) {
rc = (-1);
switch (sdr->type) {
case SDR_RECORD_TYPE_FULL_SENSOR:
case SDR_RECORD_TYPE_COMPACT_SENSOR:
if (ipmi_sensor_print_fc(intf,
(struct sdr_record_common_sensor *) sdr->record.common,
sdr->type)) {
rc = -1;
}
break;
default:
if (ipmi_sdr_print_listentry(intf, sdr) < 0) {
rc = (-1);
}
break;
}
verbose = v;
sdr = NULL;