diff options
Diffstat (limited to 'plugins/check_by_ssh.c')
-rw-r--r-- | plugins/check_by_ssh.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c index 6daa1a1..8f6cde9 100644 --- a/plugins/check_by_ssh.c +++ b/plugins/check_by_ssh.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_by_ssh"; | 21 | const char *progname = "check_by_ssh"; |
@@ -67,7 +69,7 @@ main (int argc, char **argv) | |||
67 | 69 | ||
68 | /* process arguments */ | 70 | /* process arguments */ |
69 | if (process_arguments (argc, argv) == ERROR) | 71 | if (process_arguments (argc, argv) == ERROR) |
70 | usage (_("Could not parse arguments\n")); | 72 | usage (_("check_by_ssh: could not parse arguments\n")); |
71 | 73 | ||
72 | 74 | ||
73 | /* Set signal handling and alarm timeout */ | 75 | /* Set signal handling and alarm timeout */ |
@@ -214,10 +216,11 @@ process_arguments (int argc, char **argv) | |||
214 | 216 | ||
215 | switch (c) { | 217 | switch (c) { |
216 | case '?': /* help */ | 218 | case '?': /* help */ |
219 | printf (_("%s: Unknown argument: %s\n\n"), progname, optarg); | ||
217 | print_usage (); | 220 | print_usage (); |
218 | exit (STATE_UNKNOWN); | 221 | exit (STATE_UNKNOWN); |
219 | case 'V': /* version */ | 222 | case 'V': /* version */ |
220 | print_revision (progname, "$Revision$"); | 223 | print_revision (progname, revision); |
221 | exit (STATE_OK); | 224 | exit (STATE_OK); |
222 | case 'h': /* help */ | 225 | case 'h': /* help */ |
223 | print_help (); | 226 | print_help (); |
@@ -233,12 +236,12 @@ process_arguments (int argc, char **argv) | |||
233 | break; | 236 | break; |
234 | case 'H': /* host */ | 237 | case 'H': /* host */ |
235 | if (!is_host (optarg)) | 238 | if (!is_host (optarg)) |
236 | usage2 (_("Invalid hostname/adress"), optarg); | 239 | usage2 (_("Invalid hostname/address"), optarg); |
237 | hostname = optarg; | 240 | hostname = optarg; |
238 | break; | 241 | break; |
239 | case 'p': /* port number */ | 242 | case 'p': /* port number */ |
240 | if (!is_integer (optarg)) | 243 | if (!is_integer (optarg)) |
241 | usage2 (_("port must be a positive integer"), optarg); | 244 | usage2 (_("Port must be a positive integer"), optarg); |
242 | asprintf (&comm,"%s -p %s", comm, optarg); | 245 | asprintf (&comm,"%s -p %s", comm, optarg); |
243 | break; | 246 | break; |
244 | case 'O': /* output file */ | 247 | case 'O': /* output file */ |
@@ -292,7 +295,7 @@ process_arguments (int argc, char **argv) | |||
292 | if (c <= argc) { | 295 | if (c <= argc) { |
293 | die (STATE_UNKNOWN, _("%s: You must provide a host name\n"), progname); | 296 | die (STATE_UNKNOWN, _("%s: You must provide a host name\n"), progname); |
294 | } else if (!is_host (argv[c])) | 297 | } else if (!is_host (argv[c])) |
295 | die (STATE_UNKNOWN, "%s: %s %s\n", progname, _("Invalid host name"), argv[c]); | 298 | die (STATE_UNKNOWN, "%s: %s %s\n", progname, _("Invalid hostname/address"), argv[c]); |
296 | hostname = argv[c++]; | 299 | hostname = argv[c++]; |
297 | } | 300 | } |
298 | 301 | ||
@@ -317,8 +320,6 @@ process_arguments (int argc, char **argv) | |||
317 | 320 | ||
318 | 321 | ||
319 | 322 | ||
320 | |||
321 | |||
322 | int | 323 | int |
323 | validate_arguments (void) | 324 | validate_arguments (void) |
324 | { | 325 | { |
@@ -408,8 +409,6 @@ $ cat /tmp/foo\n\ | |||
408 | 409 | ||
409 | 410 | ||
410 | 411 | ||
411 | |||
412 | |||
413 | void | 412 | void |
414 | print_usage (void) | 413 | print_usage (void) |
415 | { | 414 | { |