Fix the help for the sdr get command to make it clear that the user
needs to specify the sensor ID string and that it only returns the
_first_ sensor that matches, not all of them.

Fix the help for the sdt type command to make it clear that the type
can be specified as either hex or the string value for the type.
Add the hex value for the sensor type to displays so that the user
can correlate sensor type values with their hex values without having
to look them up in the IPMI spec.

Signed-off-by: Dan Gora <d...@adax.com>
---
 ipmitool/lib/ipmi_sdr.c |   36 ++++++++++++++++++++++--------------
 1 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/ipmitool/lib/ipmi_sdr.c b/ipmitool/lib/ipmi_sdr.c
index 272dee0..63dfced 100644
--- a/ipmitool/lib/ipmi_sdr.c
+++ b/ipmitool/lib/ipmi_sdr.c
@@ -1702,8 +1702,9 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf,
 
        if (!IS_THRESHOLD_SENSOR(sensor)) {
                /* Discrete */
-               printf(" Sensor Type (Discrete): %s\n",
-                      ipmi_sdr_get_sensor_type_desc(sensor->sensor.type));
+               printf(" Sensor Type (Discrete): %s (0x%02x)\n",
+                      ipmi_sdr_get_sensor_type_desc(sensor->sensor.type),
+                       sensor->sensor.type);
                lprintf(LOG_DEBUG, " Event Type Code       : 0x%02x",
                        sensor->event_type);
 
@@ -1763,8 +1764,9 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf,
 
                return 0;       /* done */
        }
-       printf(" Sensor Type (Threshold)  : %s\n",
-              ipmi_sdr_get_sensor_type_desc(sensor->sensor.type));
+       printf(" Sensor Type (Threshold)  : %s (0x%02x)\n",
+               ipmi_sdr_get_sensor_type_desc(sensor->sensor.type),
+               sensor->sensor.type);
 
        printf(" Sensor Reading        : ");
        if (sr->s_reading_valid) {
@@ -2087,8 +2089,9 @@ ipmi_sdr_print_sensor_eventonly(struct ipmi_intf *intf,
                printf("Entity ID              : %d.%d (%s)\n",
                       sensor->entity.id, sensor->entity.instance,
                       val2str(sensor->entity.id, entity_id_vals));
-               printf("Sensor Type            : %s\n",
-                      ipmi_sdr_get_sensor_type_desc(sensor->sensor_type));
+               printf("Sensor Type            : %s (0x%02x)\n",
+                      ipmi_sdr_get_sensor_type_desc(sensor->sensor_type),
+                       sensor->sensor_type);
                lprintf(LOG_DEBUG, "Event Type Code        : 0x%02x",
                        sensor->event_type);
                printf("\n");
@@ -4382,8 +4385,9 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
            strncasecmp(type, "list", 4) == 0) {
                printf("Sensor Types:\n");
                for (x = 1; x < SENSOR_TYPE_MAX; x += 2) {
-                       printf("\t%-25s   %-25s\n",
-                              sensor_type_desc[x], sensor_type_desc[x + 1]);
+                       printf("\t%-25s (0x%02x)   %-25s (0x%02x)\n",
+                              sensor_type_desc[x], x, 
+                               sensor_type_desc[x + 1], x + 1);
                }
                return 0;
        }
@@ -4409,9 +4413,9 @@ ipmi_sdr_print_type(struct ipmi_intf *intf, char *type)
                        printf("Sensor Type %s not found.\n", type);
                        printf("Sensor Types:\n");
                        for (x = 1; x < SENSOR_TYPE_MAX; x += 2) {
-                               printf("\t%-25s   %-25s\n",
-                                      sensor_type_desc[x],
-                                      sensor_type_desc[x + 1]);
+                               printf("\t%-25s (0x%02x)   %-25s (0x%02x)\n",
+                                      sensor_type_desc[x], x, 
+                                       sensor_type_desc[x + 1], x + 1);
                        }
                        return 0;
                }
@@ -4573,13 +4577,17 @@ ipmi_sdr_main(struct ipmi_intf *intf, int argc, char 
**argv)
                lprintf(LOG_ERR, 
  "               type [sensor type] | list");
                lprintf(LOG_ERR,
- "                     Retrieve sensors matching [sensor type]");
+ "                     Retrieve sensors matching [sensor type].");
+               lprintf(LOG_ERR,
+ "                     [sensor type] can be specified as hex value or a 
string.");
                lprintf(LOG_ERR,
  "                     list          Get a list of available sensor types");
                lprintf(LOG_ERR,
- "               get");
+ "               get [Sensor ID string]");
+               lprintf(LOG_ERR,
+ "                     Retrieve the first sensor with Sensor ID matching");
                lprintf(LOG_ERR,
- "                     Retrieve the state of a specified sensor");
+ "                     [Sensor ID string].");
                lprintf(LOG_ERR, 
  "               info");
                lprintf(LOG_ERR,
-- 
1.7.7


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to