Output of 'sensor list' provides raw output without no explanation what the
values mean. This patch adds header to the output, which gives at least a
clue, what each column mean.
There is no way, how to disable the header output, which can confuse existing
scripts - should there be an option to disable the header?
---
lib/ipmi_sensor.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/lib/ipmi_sensor.c b/lib/ipmi_sensor.c
index 7e7615a..9d11f5a 100644
--- a/lib/ipmi_sensor.c
+++ b/lib/ipmi_sensor.c
@@ -569,6 +569,7 @@ ipmi_sensor_list(struct ipmi_intf *intf)
struct sdr_get_rs *header;
struct ipmi_sdr_iterator *itr;
int rc = 0;
+ int row = 0;
lprintf(LOG_DEBUG, "Querying SDR for sensor list");
@@ -588,6 +589,13 @@ ipmi_sensor_list(struct ipmi_intf *intf)
continue;
}
+ if (!verbose && row == 0) {
+ printf("SENSOR | VALUE | UNITS "
+ "| STATE | LO NOREC | LO CRIT | LO NOCRIT "
+ "| UP NOCRIT | UP CRIT | UP NOREC\n");
+ }
+ row++;
+
switch (header->type) {
case SDR_RECORD_TYPE_FULL_SENSOR:
r = ipmi_sensor_print_full(intf,
------------------------------------------------------------------------------
_______________________________________________
Ipmitool-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel