diff options
Diffstat (limited to 'plugins/check_by_ssh.c')
-rw-r--r-- | plugins/check_by_ssh.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c index bc172c97..39d49070 100644 --- a/plugins/check_by_ssh.c +++ b/plugins/check_by_ssh.c | |||
@@ -101,6 +101,13 @@ main (int argc, char **argv) | |||
101 | 101 | ||
102 | result = cmd_run_array (commargv, &chld_out, &chld_err, 0); | 102 | result = cmd_run_array (commargv, &chld_out, &chld_err, 0); |
103 | 103 | ||
104 | if (verbose) { | ||
105 | for(i = 0; i < chld_out.lines; i++) | ||
106 | printf("stdout: %s\n", chld_out.line[i]); | ||
107 | for(i = 0; i < chld_err.lines; i++) | ||
108 | printf("stderr: %s\n", chld_err.line[i]); | ||
109 | } | ||
110 | |||
104 | if (skip_stdout == -1) /* --skip-stdout specified without argument */ | 111 | if (skip_stdout == -1) /* --skip-stdout specified without argument */ |
105 | skip_stdout = chld_out.lines; | 112 | skip_stdout = chld_out.lines; |
106 | if (skip_stderr == -1) /* --skip-stderr specified without argument */ | 113 | if (skip_stderr == -1) /* --skip-stderr specified without argument */ |
@@ -214,10 +221,10 @@ process_arguments (int argc, char **argv) | |||
214 | switch (c) { | 221 | switch (c) { |
215 | case 'V': /* version */ | 222 | case 'V': /* version */ |
216 | print_revision (progname, NP_VERSION); | 223 | print_revision (progname, NP_VERSION); |
217 | exit (STATE_OK); | 224 | exit (STATE_UNKNOWN); |
218 | case 'h': /* help */ | 225 | case 'h': /* help */ |
219 | print_help (); | 226 | print_help (); |
220 | exit (STATE_OK); | 227 | exit (STATE_UNKNOWN); |
221 | case 'v': /* help */ | 228 | case 'v': /* help */ |
222 | verbose = TRUE; | 229 | verbose = TRUE; |
223 | break; | 230 | break; |
@@ -228,7 +235,6 @@ process_arguments (int argc, char **argv) | |||
228 | timeout_interval = atoi (optarg); | 235 | timeout_interval = atoi (optarg); |
229 | break; | 236 | break; |
230 | case 'H': /* host */ | 237 | case 'H': /* host */ |
231 | host_or_die(optarg); | ||
232 | hostname = optarg; | 238 | hostname = optarg; |
233 | break; | 239 | break; |
234 | case 'p': /* port number */ | 240 | case 'p': /* port number */ |
@@ -330,7 +336,6 @@ process_arguments (int argc, char **argv) | |||
330 | if (c <= argc) { | 336 | if (c <= argc) { |
331 | die (STATE_UNKNOWN, _("%s: You must provide a host name\n"), progname); | 337 | die (STATE_UNKNOWN, _("%s: You must provide a host name\n"), progname); |
332 | } | 338 | } |
333 | host_or_die(argv[c]); | ||
334 | hostname = argv[c++]; | 339 | hostname = argv[c++]; |
335 | } | 340 | } |
336 | 341 | ||