From 55031e72e6c02b4ae63e9052bad1a4b40002ac18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 1 Dec 2014 12:15:48 +0100 Subject: Imported Upstream version 1.8.15 --- lib/ipmi_sensor.c | 84 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 34 deletions(-) (limited to 'lib/ipmi_sensor.c') 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 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 "); - 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 lower "); - lprintf(LOG_NOTICE, - " Set all lower thresholds at the same time"); - lprintf(LOG_NOTICE, ""); - lprintf(LOG_NOTICE, - "sensor thresh upper "); - 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 lower "); + "usage: sensor thresh lower "); 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]"); 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 "); + 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 lower "); + lprintf(LOG_NOTICE, +" Set all lower thresholds at the same time"); + lprintf(LOG_NOTICE, +""); + lprintf(LOG_NOTICE, +"sensor thresh upper "); + lprintf(LOG_NOTICE, +" Set all upper thresholds at the same time"); + lprintf(LOG_NOTICE, ""); +} -- cgit v1.2.3