[Nagiosplug-devel] check_udp patch against 1.3.1

Jason Martin jhmartin at toger.us
Tue Jun 1 09:30:01 CEST 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The attached patch against check_udp from the 1.3.1 release does the 
following:

> * 02-13-04  Jason Martin <jhmartin at toger.us>
> *   Changed to only print one line, hide netutils.c pollution
> *   Accept non-integer timing thresholds
> * 02-06-04 Todd Carter <na_ape_finder at yahoo.com>
> * Corrected core problem in solaris 2.6 - 2.9 enviroments.
> * Seems that getopt_long.c returns a NULL value in Solaris and "" in 
Linux.
> * The result is in solaris this condition causes this plugin to core 
dump

It requires the is_numnonneg function from the check_tcp patch.

- -Jason Martin

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.3.5 (GNU/Linux)
Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/

iD8DBQFAvK69l2ODWuqVSBMRArN0AKCPxNrDSE2CfrV3XzDDvfzWMzjbowCePoH6
GwIw6R7rniE4k78RkHcT9wU=
=oPzp
-----END PGP SIGNATURE-----
-------------- next part --------------
9c9
< * Last Modified: $Date: 2003/03/07 06:40:33 $
---
> * Last Modified: $Date: 2004/02/26 20:29:26 $
36a37,46
> * Revision
> * 02-13-04  Jason Martin <jhmartin at toger.us>
> *   Changed to only print one line, hide netutils.c pollution
> *   Accept non-integer timing thresholds
> * 02-06-04 Todd Carter <na_ape_finder at yahoo.com>
> * Corrected core problem in solaris 2.6 - 2.9 enviroments.
> * Seems that getopt_long.c returns a NULL value in Solaris and "" in Linux.
> * The result is in solaris this condition causes this plugin to core dump
> * - corrected. Also corrected in check_tcp, check_udp, check_http, check_nt,
> * check_overcr and check_dns plugins.
42a53
> #include "unistd.h"
45a57
> int stdout_save;
59a72,73
> struct timeval tv;
> double elapsed_time;
76c90,97
< 	time (&start_time);
---
> 	gettimeofday (&tv, NULL);
> 
> 	/* hide stdout during process_udp request since it pollutes unless verbose*/
> 	if (! verbose) {
> 		dup2(1,stdout_save);	
> 		close(1);
> 	}
> 
80c101,107
< 	time (&end_time);
---
> 
> 	/* restore stdout if we hid it during process_udp_request */
> 	if (! verbose) {
> 		fflush(stdout);
> 		dup2(stdout_save,1);
> 	}
> 
97a125
> 	elapsed_time = delta_time (tv);
103c131
< 				&& (end_time - start_time) > critical_time) result = STATE_CRITICAL;
---
> 				&& elapsed_time > critical_time) result = STATE_CRITICAL;
105c133
< 						 && (end_time - start_time) > warning_time) result =
---
> 						 && elapsed_time > warning_time) result =
108c136
< 		printf ("Connection %s on port %d - %d second response time\n",
---
> 		printf ("Connection %s on port %d - %7.3f second response time\n",
110c138
< 						(int) (end_time - start_time));
---
> 						 elapsed_time);
115d142
< 
168a196,197
> 			/* TEC and JHM Fix 2/6/04 */
> 			if (optarg != NULL)
176c205
< 			print_revision (progname, "$Revision: 1.4.2.1 $");
---
> 			print_revision (progname, "$Revision: 1.1.1.1 $");
187,188c216,217
< 			if (!is_intnonneg (optarg))
< 				usage ("Critical threshold must be a nonnegative integer\n");
---
> 			if (!is_numnonneg (optarg))
> 				usage ("Critical threshold must be a nonnegative number\n");
193,194c222,223
< 			if (!is_intnonneg (optarg))
< 				usage ("Warning threshold must be a nonnegative integer\n");
---
> 			if (!is_numnonneg (optarg))
> 				usage ("Warning threshold must be a nonnegative number\n");
249c278
< 	print_revision (progname, "$Revision: 1.4.2.1 $");
---
> 	print_revision (progname, "$Revision: 1.1.1.1 $");


More information about the Devel mailing list