diff options
Diffstat (limited to 'plugins/check_procs.c')
-rw-r--r-- | plugins/check_procs.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/plugins/check_procs.c b/plugins/check_procs.c index d39bfa5..011661c 100644 --- a/plugins/check_procs.c +++ b/plugins/check_procs.c | |||
@@ -14,6 +14,8 @@ | |||
14 | along with this program; if not, write to the Free Software | 14 | along with this program; if not, write to the Free Software |
15 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 15 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
16 | 16 | ||
17 | $Id$ | ||
18 | |||
17 | ******************************************************************************/ | 19 | ******************************************************************************/ |
18 | 20 | ||
19 | const char *progname = "check_procs"; | 21 | const char *progname = "check_procs"; |
@@ -73,9 +75,6 @@ char tmp[MAX_INPUT_BUFFER]; | |||
73 | 75 | ||
74 | 76 | ||
75 | 77 | ||
76 | |||
77 | |||
78 | |||
79 | int | 78 | int |
80 | main (int argc, char **argv) | 79 | main (int argc, char **argv) |
81 | { | 80 | { |
@@ -117,8 +116,7 @@ main (int argc, char **argv) | |||
117 | metric = METRIC_PROCS; | 116 | metric = METRIC_PROCS; |
118 | 117 | ||
119 | if (process_arguments (argc, argv) == ERROR) | 118 | if (process_arguments (argc, argv) == ERROR) |
120 | usage (_("Unable to parse command line\n")); | 119 | usage (_("check_procs: could not parse arguments\n")); |
121 | |||
122 | 120 | ||
123 | /* Set signal handling and alarm timeout */ | 121 | /* Set signal handling and alarm timeout */ |
124 | if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) { | 122 | if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) { |
@@ -127,7 +125,6 @@ main (int argc, char **argv) | |||
127 | } | 125 | } |
128 | alarm (timeout_interval); | 126 | alarm (timeout_interval); |
129 | 127 | ||
130 | |||
131 | if (verbose >= 2) | 128 | if (verbose >= 2) |
132 | printf (_("CMD: %s\n"), PS_COMMAND); | 129 | printf (_("CMD: %s\n"), PS_COMMAND); |
133 | 130 | ||
@@ -296,9 +293,6 @@ main (int argc, char **argv) | |||
296 | 293 | ||
297 | 294 | ||
298 | 295 | ||
299 | |||
300 | |||
301 | |||
302 | /* process command-line arguments */ | 296 | /* process command-line arguments */ |
303 | int | 297 | int |
304 | process_arguments (int argc, char **argv) | 298 | process_arguments (int argc, char **argv) |
@@ -338,6 +332,7 @@ process_arguments (int argc, char **argv) | |||
338 | 332 | ||
339 | switch (c) { | 333 | switch (c) { |
340 | case '?': /* help */ | 334 | case '?': /* help */ |
335 | printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); | ||
341 | print_usage (); | 336 | print_usage (); |
342 | exit (STATE_UNKNOWN); | 337 | exit (STATE_UNKNOWN); |
343 | case 'h': /* help */ | 338 | case 'h': /* help */ |
@@ -495,7 +490,6 @@ process_arguments (int argc, char **argv) | |||
495 | 490 | ||
496 | 491 | ||
497 | 492 | ||
498 | |||
499 | int | 493 | int |
500 | validate_arguments () | 494 | validate_arguments () |
501 | { | 495 | { |
@@ -543,9 +537,6 @@ validate_arguments () | |||
543 | 537 | ||
544 | 538 | ||
545 | 539 | ||
546 | |||
547 | |||
548 | |||
549 | /* Check thresholds against value */ | 540 | /* Check thresholds against value */ |
550 | int | 541 | int |
551 | check_thresholds (int value) | 542 | check_thresholds (int value) |
@@ -580,9 +571,6 @@ check_thresholds (int value) | |||
580 | 571 | ||
581 | 572 | ||
582 | 573 | ||
583 | |||
584 | |||
585 | |||
586 | void | 574 | void |
587 | print_help (void) | 575 | print_help (void) |
588 | { | 576 | { |
@@ -671,6 +659,8 @@ Examples:\n\ | |||
671 | printf (_(UT_SUPPORT)); | 659 | printf (_(UT_SUPPORT)); |
672 | } | 660 | } |
673 | 661 | ||
662 | |||
663 | |||
674 | void | 664 | void |
675 | print_usage (void) | 665 | print_usage (void) |
676 | { | 666 | { |
@@ -681,3 +671,4 @@ Usage: %s -w <range> -c <range> [-m metric] [-s state] [-p ppid]\n\ | |||
681 | printf (_(UT_HLP_VRS), progname, progname); | 671 | printf (_(UT_HLP_VRS), progname, progname); |
682 | } | 672 | } |
683 | 673 | ||
674 | |||