diff options
Diffstat (limited to 'plugins/check_by_ssh.c')
| -rw-r--r-- | plugins/check_by_ssh.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c index 59e41786..5c505309 100644 --- a/plugins/check_by_ssh.c +++ b/plugins/check_by_ssh.c | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | * | 22 | * |
| 23 | *****************************************************************************/ | 23 | *****************************************************************************/ |
| 24 | 24 | ||
| 25 | #define PROGRAM check_by_ssh | 25 | const char *progname = "check_by_ssh"; |
| 26 | #define DESCRIPTION "Run checks on a remote system using ssh, wrapping the proper timeout around the ssh invocation." | 26 | #define DESCRIPTION "Run checks on a remote system using ssh, wrapping the proper timeout around the ssh invocation." |
| 27 | #define AUTHOR "Karl DeBisschop" | 27 | #define AUTHOR "Karl DeBisschop" |
| 28 | #define EMAIL "karl@debisschop.net" | 28 | #define EMAIL "karl@debisschop.net" |
| @@ -34,11 +34,9 @@ | |||
| 34 | #include "utils.h" | 34 | #include "utils.h" |
| 35 | #include <time.h> | 35 | #include <time.h> |
| 36 | 36 | ||
| 37 | #define PROGNAME "check_by_ssh" | ||
| 38 | |||
| 39 | int process_arguments (int, char **); | 37 | int process_arguments (int, char **); |
| 40 | int validate_arguments (void); | 38 | int validate_arguments (void); |
| 41 | void print_help (char *command_name); | 39 | void print_help (const char *command_name); |
| 42 | void print_usage (void); | 40 | void print_usage (void); |
| 43 | 41 | ||
| 44 | 42 | ||
| @@ -223,10 +221,10 @@ process_arguments (int argc, char **argv) | |||
| 223 | print_usage (); | 221 | print_usage (); |
| 224 | exit (STATE_UNKNOWN); | 222 | exit (STATE_UNKNOWN); |
| 225 | case 'V': /* version */ | 223 | case 'V': /* version */ |
| 226 | print_revision (PROGNAME, "$Revision$"); | 224 | print_revision (progname, "$Revision$"); |
| 227 | exit (STATE_OK); | 225 | exit (STATE_OK); |
| 228 | case 'h': /* help */ | 226 | case 'h': /* help */ |
| 229 | print_help (PROGNAME); | 227 | print_help (progname); |
| 230 | exit (STATE_OK); | 228 | exit (STATE_OK); |
| 231 | case 'v': /* help */ | 229 | case 'v': /* help */ |
| 232 | verbose = TRUE; | 230 | verbose = TRUE; |
| @@ -286,7 +284,7 @@ process_arguments (int argc, char **argv) | |||
| 286 | c = optind; | 284 | c = optind; |
| 287 | if (hostname == NULL) { | 285 | if (hostname == NULL) { |
| 288 | if (!is_host (argv[c])) | 286 | if (!is_host (argv[c])) |
| 289 | terminate (STATE_UNKNOWN, "%s: Invalid host name %s\n", PROGNAME, argv[c]); | 287 | terminate (STATE_UNKNOWN, "%s: Invalid host name %s\n", progname, argv[c]); |
| 290 | hostname = argv[c++]; | 288 | hostname = argv[c++]; |
| 291 | } | 289 | } |
| 292 | 290 | ||
| @@ -317,10 +315,10 @@ validate_arguments (void) | |||
| 317 | return ERROR; | 315 | return ERROR; |
| 318 | 316 | ||
| 319 | if (passive && commands != services) | 317 | if (passive && commands != services) |
| 320 | terminate (STATE_UNKNOWN, "%s: In passive mode, you must provide a service name for each command.\n", PROGNAME); | 318 | terminate (STATE_UNKNOWN, "%s: In passive mode, you must provide a service name for each command.\n", progname); |
| 321 | 319 | ||
| 322 | if (passive && host_shortname == NULL) | 320 | if (passive && host_shortname == NULL) |
| 323 | terminate (STATE_UNKNOWN, "%s: In passive mode, you must provide the host short name from the nagios configs.\n", PROGNAME); | 321 | terminate (STATE_UNKNOWN, "%s: In passive mode, you must provide the host short name from the nagios configs.\n", progname); |
| 324 | 322 | ||
| 325 | return OK; | 323 | return OK; |
| 326 | } | 324 | } |
| @@ -330,7 +328,7 @@ validate_arguments (void) | |||
| 330 | 328 | ||
| 331 | 329 | ||
| 332 | void | 330 | void |
| 333 | print_help (char *cmd) | 331 | print_help (const char *cmd) |
| 334 | { | 332 | { |
| 335 | print_revision (cmd, "$Revision$"); | 333 | print_revision (cmd, "$Revision$"); |
| 336 | 334 | ||
