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

[email protected]
Newsgroups gmane.network.nagios.plugins.cvs
Message-ID <[email protected]>
Revision: 2186
          http://nagiosplug.svn.sourceforge.net/nagiosplug/?rev=2186&view=rev
Author:   dermoth
Date:     2009-03-25 12:53:26 +0000 (Wed, 25 Mar 2009)

Log Message:
-----------
check_nt: allow returning UNKNOWN on timeouts (-u)

From: Thomas Guyot-Sionnest <[email protected]>

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

Modified: nagiosplug/trunk/NEWS
===================================================================
--- nagiosplug/trunk/NEWS	2009-03-25 12:53:15 UTC (rev 2185)
+++ nagiosplug/trunk/NEWS	2009-03-25 12:53:26 UTC (rev 2186)
@@ -29,6 +29,7 @@
 	Fixed negate not printing the real timeout in ALRM handler when left to default
 	negate timeout result is now configurable
 	Fixed segfault in check_mysql with old slaves (#2696823 - Oskar Ahner)
+	check_nt can return UNKNOWN on timeouts (-u)
 
 1.4.13 25th Sept 2008
 	Fix Debian bug #460097: check_http --max-age broken (Hilko Bengen)

Modified: nagiosplug/trunk/plugins/check_nt.c
===================================================================
--- nagiosplug/trunk/plugins/check_nt.c	2009-03-25 12:53:15 UTC (rev 2185)
+++ nagiosplug/trunk/plugins/check_nt.c	2009-03-25 12:53:26 UTC (rev 2186)
@@ -480,6 +480,7 @@
 		{"params",   required_argument,0,'l'},
 		{"secret",   required_argument,0,'s'},
 		{"display",  required_argument,0,'d'},
+		{"unknown-timeout", no_argument, 0, 'u'},
 		{"version",  no_argument,      0,'V'},
 		{"help",     no_argument,      0,'h'},
 		{0,0,0,0}
@@ -506,7 +507,7 @@
 	}
 
 	while (1) {
-		c = getopt_long(argc,argv,"+hVH:t:c:w:p:v:l:s:d:",longopts,&option);
+		c = getopt_long(argc,argv,"+hVH:t:c:w:p:v:l:s:d:u",longopts,&option);
 
 		if (c==-1||c==EOF||c==1)
 			break;
@@ -574,6 +575,9 @@
 				if (!strcmp(optarg,"SHOWALL"))
 					show_all = TRUE;
 				break;
+			case 'u':
+				socket_timeout_state=STATE_UNKNOWN;
+				break;
 			case 't': /* timeout */
 				socket_timeout=atoi(optarg);
 				if(socket_timeout<=0)
@@ -671,6 +675,8 @@
 	printf ("   %s", _("Parameters passed to specified check (see below)"));
 	printf (" %s\n", "-d, --display={SHOWALL}");
 	printf ("   %s", _("Display options (currently only SHOWALL works)"));
+	printf (" %s\n", "-u, --unknown-timeout");
+	printf ("   %s", _("Return UNKNOWN on timeouts"));
 	printf ("%d)\n", DEFAULT_SOCKET_TIMEOUT);
 	printf (" %s\n", "-h, --help");
 	printf ("   %s\n", _("Print this help screen"));
@@ -754,6 +760,6 @@
 {
 	printf (_("Usage:"));
 	printf ("%s -H host -v variable [-p port] [-w warning] [-c critical]\n",progname);
-	printf ("[-l params] [-d SHOWALL] [-t timeout]\n");
+	printf ("[-l params] [-d SHOWALL] [-u] [-t timeout]\n");
 }
 


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

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
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.