From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- web/attachments/109117-check_dns.c.patch | 64 ++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 web/attachments/109117-check_dns.c.patch (limited to 'web/attachments/109117-check_dns.c.patch') diff --git a/web/attachments/109117-check_dns.c.patch b/web/attachments/109117-check_dns.c.patch new file mode 100644 index 0000000..9546cd6 --- /dev/null +++ b/web/attachments/109117-check_dns.c.patch @@ -0,0 +1,64 @@ +--- check_dns.c.old 2004-11-17 13:18:35.000000000 -0700 ++++ check_dns.c 2004-11-17 12:53:21.000000000 -0700 +@@ -38,6 +38,7 @@ + #define ADDRESS_LENGTH 256 + char query_address[ADDRESS_LENGTH] = ""; + char dns_server[ADDRESS_LENGTH] = ""; ++int dns_server_port = 53; + char ptr_server[ADDRESS_LENGTH] = ""; + int verbose = FALSE; + char expected_address[ADDRESS_LENGTH] = ""; +@@ -76,7 +77,7 @@ + } + + /* get the command to run */ +- asprintf (&command_line, "%s %s %s", NSLOOKUP_COMMAND, query_address, dns_server); ++ asprintf (&command_line, "%s %s %s -port=%d", NSLOOKUP_COMMAND, query_address, dns_server, dns_server_port); + + alarm (timeout_interval); + gettimeofday (&tv, NULL); +@@ -275,6 +276,7 @@ + {"timeout", required_argument, 0, 't'}, + {"hostname", required_argument, 0, 'H'}, + {"server", required_argument, 0, 's'}, ++ {"port", required_argument, 0, 'p'}, + {"reverse-server", required_argument, 0, 'r'}, + {"expected-address", required_argument, 0, 'a'}, + {"expect-authority", no_argument, 0, 'A'}, +@@ -289,7 +291,7 @@ + strcpy (argv[c], "-t"); + + while (1) { +- c = getopt_long (argc, argv, "hVvAt:H:s:r:a:", long_opts, &opt_index); ++ c = getopt_long (argc, argv, "hVvAt:H:p:s:r:a:", long_opts, &opt_index); + + if (c == -1 || c == EOF) + break; +@@ -316,6 +318,9 @@ + die (STATE_UNKNOWN, _("Input buffer overflow\n")); + strcpy (query_address, optarg); + break; ++ case 'p': /* hostname */ ++ dns_server_port = atoi(optarg); ++ break; + case 's': /* server name */ + /* TODO: this is_host check is probably unnecessary. */ + /* Better to confirm nslookup response matches */ +@@ -403,6 +408,8 @@ + The name or address you want to query\n\ + -s, --server=HOST\n\ + Optional DNS server you want to use for the lookup\n\ ++-p, --port=HOST\n\ ++ Optional DNS server port, defaults to 53\n\ + -a, --expected-address=IP-ADDRESS\n\ + Optional IP address you expect the DNS server to return\n\ + -A, --expect-authority\n\ +@@ -426,7 +433,7 @@ + print_usage (void) + { + printf (_("\ +-Usage: %s -H host [-s server] [-a expected-address] [-A] [-t timeout]\n\ ++Usage: %s -H host [-s server] [-p port] [-a expected-address] [-A] [-t timeout]\n\ + %s --help\n\ + %s --version\n"), progname, progname, progname); + } -- cgit v1.2.3-74-g34f1