diff options
Diffstat (limited to 'plugins/check_ide_smart.c')
-rw-r--r-- | plugins/check_ide_smart.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/plugins/check_ide_smart.c b/plugins/check_ide_smart.c index 0b7b2304..6487d085 100644 --- a/plugins/check_ide_smart.c +++ b/plugins/check_ide_smart.c | |||
@@ -45,6 +45,9 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net"; | |||
45 | #include "common.h" | 45 | #include "common.h" |
46 | #include "utils.h" | 46 | #include "utils.h" |
47 | 47 | ||
48 | void print_help (void); | ||
49 | void print_usage (void); | ||
50 | |||
48 | #include <sys/stat.h> | 51 | #include <sys/stat.h> |
49 | #include <sys/ioctl.h> | 52 | #include <sys/ioctl.h> |
50 | #include <fcntl.h> | 53 | #include <fcntl.h> |
@@ -145,6 +148,8 @@ enum SmartCommand | |||
145 | SMART_CMD_AUTO_OFFLINE | 148 | SMART_CMD_AUTO_OFFLINE |
146 | }; | 149 | }; |
147 | 150 | ||
151 | void print_values (values_t * p, thresholds_t * t); | ||
152 | int smart_cmd_simple (int fd, enum SmartCommand command, __u8 val0, char show_error); | ||
148 | 153 | ||
149 | int | 154 | int |
150 | main (int argc, char *argv[]) | 155 | main (int argc, char *argv[]) |
@@ -249,7 +254,7 @@ main (int argc, char *argv[]) | |||
249 | case 4: | 254 | case 4: |
250 | smart_read_values (fd, &values); | 255 | smart_read_values (fd, &values); |
251 | smart_read_thresholds (fd, &thresholds); | 256 | smart_read_thresholds (fd, &thresholds); |
252 | retval = net_saint (&values, &thresholds); | 257 | retval = nagios (&values, &thresholds); |
253 | break; | 258 | break; |
254 | default: | 259 | default: |
255 | smart_read_values (fd, &values); | 260 | smart_read_values (fd, &values); |
@@ -324,7 +329,7 @@ values_not_passed (values_t * p, thresholds_t * t) | |||
324 | 329 | ||
325 | 330 | ||
326 | int | 331 | int |
327 | net_saint (values_t * p, thresholds_t * t) | 332 | nagios (values_t * p, thresholds_t * t) |
328 | { | 333 | { |
329 | value_t * value = p->values; | 334 | value_t * value = p->values; |
330 | threshold_t * threshold = t->thresholds; | 335 | threshold_t * threshold = t->thresholds; |
@@ -397,7 +402,7 @@ print_value (value_t * p, threshold_t * t) | |||
397 | 402 | ||
398 | 403 | ||
399 | void | 404 | void |
400 | print_values (values_t * p, thresholds_t * t) | 405 | print_values (values_t * p, thresholds_t * t) |
401 | { | 406 | { |
402 | value_t * value = p->values; | 407 | value_t * value = p->values; |
403 | threshold_t * threshold = t->thresholds; | 408 | threshold_t * threshold = t->thresholds; |
@@ -506,13 +511,15 @@ Usage: %s [DEVICE] [OPTION]\n\ | |||
506 | Turn on automatic offline tests\n\ | 511 | Turn on automatic offline tests\n\ |
507 | -0, --auto-off\n\ | 512 | -0, --auto-off\n\ |
508 | Turn off automatic offline tests\n\ | 513 | Turn off automatic offline tests\n\ |
509 | -n, --net-saint\n\ | 514 | -n, --nagios\n\ |
510 | Output suitable for Net Saint\n", progname); | 515 | Output suitable for Nagios\n", progname); |
511 | } | 516 | } |
512 | 517 | ||
513 | 518 | ||
514 | void | 519 | void |
515 | print_usage (void) | 520 | print_usage (void) |
516 | { | 521 | { |
517 | printf ("Usage: %s \n", progname); | 522 | printf ("\ |
523 | Usage: %s [-d <device>] [-i <immediate>] [-q quiet] [-1 <auto-on>]\n\ | ||
524 | [-O <auto-off>] [-n <nagios>]\n", progname); | ||
518 | } | 525 | } |