[Nagiosplug-devel] check_http patch against 1.3.1

Jason Martin jhmartin at toger.us
Tue Jun 1 09:49:07 CEST 2004


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

The attached check_http patch against the 1.3.1 release does the 
following:

>  * * 02-06-04 Jason Martin <jhmartin at toger.us>
>  *    Allow non-integer timing thresholds
>  *    Timing thresholds checked first
>  *    Removed ^L's.
>  * * 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 a "" in 
linux.
>  * The result is in solaris this condition causes this plugin to core 
dump


It also makes several textual changes that are not important and should 
not be used.

'Timing changes checked first' means that it checks the response time of a 
webserver prior to checking the response code, so even if redirect is 
'ok', if the redirect comes back too slowly it'll still result in a 
warning.

This patch 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/

iD8DBQFAvLNTl2ODWuqVSBMRAixdAJ0ZEkFOS0mnguQUZsF6m45SrOmBLgCghAw2
qQHg9C2uhLVZddPr387QrWc=
=t11r
-----END PGP SIGNATURE-----
-------------- next part --------------
22c22
<  * $Id: check_http.c,v 1.24.2.4 2003/06/21 05:31:23 kdebisschop Exp $
---
>  * $Id: aws_check_http.c,v 1.1.1.1 2004/02/26 20:29:26 nagios Exp $
23a24,39
>  * $Log: aws_check_http.c,v $
>  * Revision 1.1.1.1  2004/02/26 20:29:26  nagios
>  * Imported sources
>  * 
>  *
>  * Revision:
>  * * 02-06-04 Jason Martin <jhmartin at toger.us>
>  *    Allow non-integer timing thresholds
>  *    Timing thresholds checked first
>  *    Removed ^L's.
>  * * 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 a "" in linux.
>  * The result is in solaris this condition causes this plugin to core dump
>  * - corrected. Also corrected in check_tcp, check_udp, aws_check_http, check_nt,
>  * check_overcr and check_dns plugins.  
26,27c42,43
< const char *progname = "check_http";
< #define REVISION "$Revision: 1.24.2.4 $"
---
> const char *progname = "aws_check_http";
> #define REVISION "$Revision: 1.1.1.1 $"
35a52
> #include "aws-utils.h"
120c137
< CHECK CONTENT: check_http -w 5 -c 10 --ssl www.verisign.com\n\n\
---
> CHECK CONTENT: aws_check_http -w 5 -c 10 --ssl www.verisign.com\n\n\
125c142
< CHECK CERTIFICATE: check_http www.verisign.com -C 14\n\n\
---
> CHECK CERTIFICATE: aws_check_http www.verisign.com -C 14\n\n\
229c246
< int check_http (void);
---
> int aws_check_http (void);
243c260
< 		usage ("check_http: could not parse arguments\n");
---
> 		usage ("aws_check_http: could not parse arguments\n");
280c297
< 		result = check_http ();
---
> 		result = aws_check_http ();
283c300
< 	result = check_http ();
---
> 	result = aws_check_http ();
287d303
< 
346a363,364
> 			/* TEC and JHM - Fix 2/6/04 */
> 			if (optarg = NULL)
363c381
< 			if (!is_intnonneg (optarg))
---
> 			if (!is_numnonneg (optarg))
369c387
< 			if (!is_intnonneg (optarg))
---
> 			if (!is_numnonneg (optarg))
382c400
< 			usage ("check_http: invalid option - SSL is not available\n");
---
> 			usage ("aws_check_http: invalid option - SSL is not available\n");
395c413
< 			usage ("check_http: invalid option - SSL is not available\n");
---
> 			usage ("aws_check_http: invalid option - SSL is not available\n");
450c468
< 			usage ("check_http: call for regex which was not a compiled option\n");
---
> 			usage ("aws_check_http: call for regex which was not a compiled option\n");
485c503
< 			usage ("check_http: you must specify a server address or host name\n");
---
> 			usage ("aws_check_http: you must specify a server address or host name\n");
492d509
< 
534d550
< 
538c554
< check_http (void)
---
> aws_check_http (void)
589c605
< 	asprintf (&buf, "%sUser-Agent: check_http/%s (nagios-plugins %s)\r\n",
---
> 	asprintf (&buf, "%sUser-Agent: aws_check_http/%s (nagios-plugins %s)\r\n",
689a706,715
> 	/* check elapsed time first */
> 	elapsed_time = delta_time (tv);
> 	asprintf (&msg, "HTTP problem: %s - %7.3f second response time %s%s|time=%7.3f\n",
> 	               status_line, elapsed_time, timestamp,
> 	               (display_html ? "</A>" : ""), elapsed_time);
> 	if (check_critical_time == TRUE && elapsed_time > critical_time)
> 		terminate (STATE_CRITICAL, msg);
> 	if (check_warning_time == TRUE && elapsed_time > warning_time)
> 		terminate (STATE_WARNING, msg);
> 
757c783
< 						check_http ();
---
> 						aws_check_http ();
763c789
< 						check_http ();
---
> 						aws_check_http ();
770c796
< 						check_http ();
---
> 						aws_check_http ();
777c803
< 						check_http ();
---
> 						aws_check_http ();
784c810
< 						check_http ();
---
> 						aws_check_http ();
813,821d838
< 	/* check elapsed time */
< 	elapsed_time = delta_time (tv);
< 	asprintf (&msg, "HTTP problem: %s - %7.3f second response time %s%s|time=%7.3f\n",
< 	               status_line, elapsed_time, timestamp,
< 	               (display_html ? "</A>" : ""), elapsed_time);
< 	if (check_critical_time == TRUE && elapsed_time > critical_time)
< 		terminate (STATE_CRITICAL, msg);
< 	if (check_warning_time == TRUE && elapsed_time > warning_time)
< 		terminate (STATE_WARNING, msg);
999d1015
< 
1037d1052
< 


More information about the Devel mailing list