diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-12-01 12:21:52 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-12-01 12:21:52 +0100 |
commit | 096a497b36f208fb68a12c7ae7576ca0a69f919d (patch) | |
tree | 3845c9631fab6a3a6177813367ddd03f7867700b /lib/ipmi_sensor.c | |
parent | 7b5768ae6a3fee6cb80300824b9e758021b22f2e (diff) | |
parent | 55031e72e6c02b4ae63e9052bad1a4b40002ac18 (diff) |
Import new upstream release 1.8.15
Diffstat (limited to 'lib/ipmi_sensor.c')
-rw-r--r-- | lib/ipmi_sensor.c | 84 |
1 files changed, 50 insertions, 34 deletions
diff --git a/lib/ipmi_sensor.c b/lib/ipmi_sensor.c index 4ef5138..c138c67 100644 --- a/lib/ipmi_sensor.c +++ b/lib/ipmi_sensor.c @@ -42,7 +42,8 @@ #include <ipmitool/ipmi_sensor.h> extern int verbose; -void printf_sensor_get_usage(); +void print_sensor_get_usage(); +void print_sensor_thresh_usage(); // Macro's for Reading the current sensor Data. #define SCANNING_DISABLED 0x40 @@ -515,7 +516,6 @@ __ipmi_sensor_threshold_value_to_raw(struct sdr_record_full_sensor *full, double } } - static int ipmi_sensor_set_threshold(struct ipmi_intf *intf, int argc, char **argv) { @@ -531,33 +531,7 @@ ipmi_sensor_set_threshold(struct ipmi_intf *intf, int argc, char **argv) struct sdr_record_list *sdr; if (argc < 3 || strncmp(argv[0], "help", 4) == 0) { - lprintf(LOG_NOTICE, "sensor thresh <id> <threshold> <setting>"); - lprintf(LOG_NOTICE, - " id : name of the sensor for which threshold is to be set"); - lprintf(LOG_NOTICE, " threshold : which threshold to set"); - lprintf(LOG_NOTICE, - " unr = upper non-recoverable"); - lprintf(LOG_NOTICE, " ucr = upper critical"); - lprintf(LOG_NOTICE, - " unc = upper non-critical"); - lprintf(LOG_NOTICE, - " lnc = lower non-critical"); - lprintf(LOG_NOTICE, " lcr = lower critical"); - lprintf(LOG_NOTICE, - " lnr = lower non-recoverable"); - lprintf(LOG_NOTICE, - " setting : the value to set the threshold to"); - lprintf(LOG_NOTICE, ""); - lprintf(LOG_NOTICE, - "sensor thresh <id> lower <lnr> <lcr> <lnc>"); - lprintf(LOG_NOTICE, - " Set all lower thresholds at the same time"); - lprintf(LOG_NOTICE, ""); - lprintf(LOG_NOTICE, - "sensor thresh <id> upper <unc> <ucr> <unr>"); - lprintf(LOG_NOTICE, - " Set all upper thresholds at the same time"); - lprintf(LOG_NOTICE, ""); + print_sensor_thresh_usage(); return 0; } @@ -589,7 +563,7 @@ ipmi_sensor_set_threshold(struct ipmi_intf *intf, int argc, char **argv) } else if (strncmp(thresh, "lower", 5) == 0) { if (argc < 5) { lprintf(LOG_ERR, - "usage: sensor thresh <id> lower <unc> <ucr> <unr>"); + "usage: sensor thresh <id> lower <lnr> <lcr> <lnc>"); return -1; } allLower = 1; @@ -899,10 +873,10 @@ ipmi_sensor_get(struct ipmi_intf *intf, int argc, char **argv) if (argc < 1) { lprintf(LOG_ERR, "Not enough parameters given."); - printf_sensor_get_usage(); + print_sensor_get_usage(); return (-1); } else if (strcmp(argv[0], "help") == 0) { - printf_sensor_get_usage(); + print_sensor_get_usage(); return 0; } printf("Locating sensor record...\n"); @@ -952,13 +926,55 @@ ipmi_sensor_main(struct ipmi_intf *intf, int argc, char **argv) return rc; } -/* printf_sensor_get_usage - print usage for # ipmitool sensor get NAC; +/* print_sensor_get_usage - print usage for # ipmitool sensor get NAC; * * @returns: void */ void -printf_sensor_get_usage() +print_sensor_get_usage() { lprintf(LOG_NOTICE, "sensor get <id> ... [id]"); lprintf(LOG_NOTICE, " id : name of desired sensor"); } + +/* print_sensor_thresh_set_usage - print usage for # ipmitool sensor thresh; + * + * @returns: void + */ +void +print_sensor_thresh_usage() +{ + lprintf(LOG_NOTICE, +"sensor thresh <id> <threshold> <setting>"); + lprintf(LOG_NOTICE, +" id : name of the sensor for which threshold is to be set"); + lprintf(LOG_NOTICE, +" threshold : which threshold to set"); + lprintf(LOG_NOTICE, +" unr = upper non-recoverable"); + lprintf(LOG_NOTICE, +" ucr = upper critical"); + lprintf(LOG_NOTICE, +" unc = upper non-critical"); + lprintf(LOG_NOTICE, +" lnc = lower non-critical"); + lprintf(LOG_NOTICE, +" lcr = lower critical"); + lprintf(LOG_NOTICE, +" lnr = lower non-recoverable"); + lprintf(LOG_NOTICE, +" setting : the value to set the threshold to"); + lprintf(LOG_NOTICE, +""); + lprintf(LOG_NOTICE, +"sensor thresh <id> lower <lnr> <lcr> <lnc>"); + lprintf(LOG_NOTICE, +" Set all lower thresholds at the same time"); + lprintf(LOG_NOTICE, +""); + lprintf(LOG_NOTICE, +"sensor thresh <id> upper <unc> <ucr> <unr>"); + lprintf(LOG_NOTICE, +" Set all upper thresholds at the same time"); + lprintf(LOG_NOTICE, ""); +} |