diff options
Diffstat (limited to 'plugins/check_dns.c')
| -rw-r--r-- | plugins/check_dns.c | 88 |
1 files changed, 50 insertions, 38 deletions
diff --git a/plugins/check_dns.c b/plugins/check_dns.c index 8b3bb4f6..afc23a4f 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c | |||
| @@ -54,47 +54,11 @@ const char *revision = "$Revision$"; | |||
| 54 | const char *copyright = "2000-2003"; | 54 | const char *copyright = "2000-2003"; |
| 55 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; | 55 | const char *email = "nagiosplug-devel@lists.sourceforge.net"; |
| 56 | 56 | ||
| 57 | void | ||
| 58 | print_usage (void) | ||
| 59 | { | ||
| 60 | printf (_("\ | ||
| 61 | Usage: %s -H host [-s server] [-a expected-address] [-t timeout]\n\ | ||
| 62 | %s --help\n\ | ||
| 63 | %s --version\n"), | ||
| 64 | progname, progname, progname); | ||
| 65 | } | ||
| 66 | |||
| 67 | void | ||
| 68 | print_help (void) | ||
| 69 | { | ||
| 70 | print_revision (progname, revision); | ||
| 71 | |||
| 72 | printf (_(COPYRIGHT), copyright, email); | ||
| 73 | |||
| 74 | print_usage (); | ||
| 75 | |||
| 76 | printf (_(UT_HELP_VRSN)); | ||
| 77 | |||
| 78 | printf (_("\ | ||
| 79 | -H, --hostname=HOST\n\ | ||
| 80 | The name or address you want to query\n\ | ||
| 81 | -s, --server=HOST\n\ | ||
| 82 | Optional DNS server you want to use for the lookup\n\ | ||
| 83 | -a, --expected-address=IP-ADDRESS\n\ | ||
| 84 | Optional IP address you expect the DNS server to return\n")); | ||
| 85 | |||
| 86 | printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT); | ||
| 87 | |||
| 88 | printf (_("\n\ | ||
| 89 | This plugin uses the nslookup program to obtain the IP address\n\ | ||
| 90 | for the given host/domain query. A optional DNS server to use may\n\ | ||
| 91 | be specified. If no DNS server is specified, the default server(s)\n\ | ||
| 92 | specified in /etc/resolv.conf will be used.\n")); | ||
| 93 | } | ||
| 94 | |||
| 95 | int process_arguments (int, char **); | 57 | int process_arguments (int, char **); |
| 96 | int validate_arguments (void); | 58 | int validate_arguments (void); |
| 97 | int error_scan (char *); | 59 | int error_scan (char *); |
| 60 | void print_help (void); | ||
| 61 | void print_usage (void); | ||
| 98 | 62 | ||
| 99 | #define ADDRESS_LENGTH 256 | 63 | #define ADDRESS_LENGTH 256 |
| 100 | char query_address[ADDRESS_LENGTH] = ""; | 64 | char query_address[ADDRESS_LENGTH] = ""; |
| @@ -421,3 +385,51 @@ validate_arguments () | |||
| 421 | else | 385 | else |
| 422 | return OK; | 386 | return OK; |
| 423 | } | 387 | } |
| 388 | |||
| 389 | |||
| 390 | |||
| 391 | |||
| 392 | |||
| 393 | |||
| 394 | void | ||
| 395 | print_help (void) | ||
| 396 | { | ||
| 397 | print_revision (progname, revision); | ||
| 398 | |||
| 399 | printf (_(COPYRIGHT), copyright, email); | ||
| 400 | |||
| 401 | print_usage (); | ||
| 402 | |||
| 403 | printf (_(UT_HELP_VRSN)); | ||
| 404 | |||
| 405 | printf (_("\ | ||
| 406 | -H, --hostname=HOST\n\ | ||
| 407 | The name or address you want to query\n\ | ||
| 408 | -s, --server=HOST\n\ | ||
| 409 | Optional DNS server you want to use for the lookup\n\ | ||
| 410 | -a, --expected-address=IP-ADDRESS\n\ | ||
| 411 | Optional IP address you expect the DNS server to return\n")); | ||
| 412 | |||
| 413 | printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT); | ||
| 414 | |||
| 415 | printf (_("\n\ | ||
| 416 | This plugin uses the nslookup program to obtain the IP address\n\ | ||
| 417 | for the given host/domain query. A optional DNS server to use may\n\ | ||
| 418 | be specified. If no DNS server is specified, the default server(s)\n\ | ||
| 419 | specified in /etc/resolv.conf will be used.\n")); | ||
| 420 | |||
| 421 | printf (_(UT_SUPPORT)); | ||
| 422 | } | ||
| 423 | |||
| 424 | |||
| 425 | |||
| 426 | |||
| 427 | void | ||
| 428 | print_usage (void) | ||
| 429 | { | ||
| 430 | printf (_("\ | ||
| 431 | Usage: %s -H host [-s server] [-a expected-address] [-t timeout]\n\ | ||
| 432 | %s --help\n\ | ||
| 433 | %s --version\n"), | ||
| 434 | progname, progname, progname); | ||
| 435 | } | ||
