SF.net SVN: nagiosplug: [1943] nagiosplug/trunk

[email protected]
Newsgroups gmane.network.nagios.plugins.cvs
Message-ID <[email protected]>
Revision: 1943
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=1943&view=rev
Author:   psychotrahe
Date:     2008-03-14 16:47:41 -0700 (Fri, 14 Mar 2008)

Log Message:
-----------
Added -A/--dig-arguments to check_dig (#1889453/#1874041)

Modified Paths:
--------------
    nagiosplug/trunk/NEWS
    nagiosplug/trunk/plugins/check_dig.c

Modified: nagiosplug/trunk/NEWS
===================================================================
--- nagiosplug/trunk/NEWS	2008-03-14 22:35:29 UTC (rev 1942)
+++ nagiosplug/trunk/NEWS	2008-03-14 23:47:41 UTC (rev 1943)
@@ -15,6 +15,7 @@
 	check_procs now accepts --ereg-argument-array for a regular expression match to the argument array
 	Reverted back to using pst3 for Solaris systems. Fixed issues re: -m64 needed to compile on 64bit systems
 	If applicable, Gettext linked dynamically instead of statically
+	check_dig can now pass arguments dig by using -A/--dig-arguments (#1874041/#1889453)
 
 1.4.11 13th December 2007
 	Fixed check_http regression in 1.4.10 where following redirects to

Modified: nagiosplug/trunk/plugins/check_dig.c
===================================================================
--- nagiosplug/trunk/plugins/check_dig.c	2008-03-14 22:35:29 UTC (rev 1942)
+++ nagiosplug/trunk/plugins/check_dig.c	2008-03-14 23:47:41 UTC (rev 1943)
@@ -57,6 +57,7 @@
 char *record_type = "A";
 char *expected_address = NULL;
 char *dns_server = NULL;
+char *dig_args = "";
 int verbose = FALSE;
 int server_port = DEFAULT_PORT;
 double warning_interval = UNDEFINED;
@@ -87,8 +88,8 @@
     usage_va(_("Could not parse arguments"));
 
   /* get the command to run */
-  asprintf (&command_line, "%s @%s -p %d %s -t %s",
-            PATH_TO_DIG, dns_server, server_port, query_address, record_type);
+  asprintf (&command_line, "%s @%s -p %d %s -t %s %s",
+            PATH_TO_DIG, dns_server, server_port, query_address, record_type, dig_args);
 
   alarm (timeout_interval);
   gettimeofday (&tv, NULL);
@@ -190,6 +191,7 @@
     {"warning", required_argument, 0, 'w'},
     {"critical", required_argument, 0, 'c'},
     {"timeout", required_argument, 0, 't'},
+    {"dig-arguments", required_argument, 0, 'A'},
     {"verbose", no_argument, 0, 'v'},
     {"version", no_argument, 0, 'V'},
     {"help", no_argument, 0, 'h'},
@@ -203,7 +205,7 @@
     return ERROR;
 
   while (1) {
-    c = getopt_long (argc, argv, "hVvt:l:H:w:c:T:p:a:", longopts, &option);
+    c = getopt_long (argc, argv, "hVvt:l:H:w:c:T:p:a:A:", longopts, &option);
 
     if (c == -1 || c == EOF)
       break;
@@ -254,6 +256,9 @@
         usage_va(_("Timeout interval must be a positive integer - %s"), optarg);
       }
       break;
+    case 'A':                 /* dig arguments */
+      dig_args = strdup(optarg);
+      break;
     case 'v':                 /* verbose */
       verbose = TRUE;
       break;
@@ -320,9 +325,14 @@
   printf ("    %s\n",_("record type to lookup (default: A)"));
   printf (" %s\n","-a, --expected_address=STRING");
   printf ("    %s\n",_("an address expected to be in the answer section.if not set, uses whatever was in -l"));
+  printf (" %s\n","-A, --dig-arguments=STRING");
+  printf ("    %s\n",_("pass STRING as argument(s) to dig"));
   printf (_(UT_WARN_CRIT));
   printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
   printf (_(UT_VERBOSE));
+  printf ("%s\n", _("Examples:"));
+  printf (" %s\n", "check_dig -H DNSSERVER -l www.example.com -A \"+tcp\"");
+  printf (" %s\n", "This will send a tcp query to DNSSERVER for www.example.com");
   printf (_(UT_SUPPORT));
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.