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/41493-http.patch | 82 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 web/attachments/41493-http.patch (limited to 'web/attachments/41493-http.patch') diff --git a/web/attachments/41493-http.patch b/web/attachments/41493-http.patch new file mode 100644 index 0000000..8492cb2 --- /dev/null +++ b/web/attachments/41493-http.patch @@ -0,0 +1,82 @@ +Index: check_http.c +=================================================================== +RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_http.c,v +retrieving revision 1.15 +diff -u -p -r1.15 check_http.c +--- check_http.c 16 Jan 2003 06:29:02 -0000 1.15 ++++ check_http.c 22 Jan 2003 17:53:43 -0000 +@@ -45,7 +45,7 @@ certificate expiration times.\n" + [-w ] [-c ] [-t ] [-L]\n\ + [-a auth] [-f ] [-e ]\n\ + [-s string] [-l] [-r | -R ]\n\ +- [-P string]" ++ [-P string] [-m min_pg_size]" + + #define LONGOPTIONS "\ + -H, --hostname=ADDRESS\n\ +@@ -75,6 +75,8 @@ certificate expiration times.\n" + Wrap output in HTML link (obsoleted by urlize)\n\ + -f, --onredirect=\n\ + How to handle redirected pages\n%s%s\ ++ -m, --min=INTEGER\n\ ++ Minimum page size required (bytes)\n\ + -v, --verbose\n\ + Show details for command-line debugging (do not use with nagios server)\n\ + -h, --help\n\ +@@ -212,6 +214,7 @@ int onredirect = STATE_OK; + int use_ssl = FALSE; + int verbose = FALSE; + int sd; ++int min_page_len = 0; + /*@null@*/ char *http_method = NULL; + /*@null@*/ char *http_post_data = NULL; + char buffer[MAX_INPUT_BUFFER]; +@@ -301,6 +304,7 @@ process_arguments (int argc, char **argv + {"linespan", no_argument, 0, 'l'}, + {"onredirect", required_argument, 0, 'f'}, + {"certificate", required_argument, 0, 'C'}, ++ {"min",required_argument,0,'m'}, + {0, 0, 0, 0} + }; + #endif +@@ -321,7 +325,7 @@ process_arguments (int argc, char **argv + strcpy (argv[c], "-n"); + } + +-#define OPTCHARS "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLS" ++#define OPTCHARS "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:" + + while (1) { + #ifdef HAVE_GETOPT_H +@@ -459,6 +463,9 @@ process_arguments (int argc, char **argv + case 'v': /* verbose */ + verbose = TRUE; + break; ++ case 'm': /* min_page_length */ ++ min_page_len = atoi (optarg); ++ break; + } + } + +@@ -548,6 +555,7 @@ check_http (void) + char *x = NULL; + char *orig_url = NULL; + double elapsed_time; ++ int page_len = 0; + + /* try to connect to the host at the given port number */ + #ifdef HAVE_SSL +@@ -895,6 +903,13 @@ check_http (void) + } + #endif + ++ /* make sure the page is of an appropriate size */ ++ page_len = strlen (page); ++ if ((min_page_len > 0) && (page_len < min_page_len)) { ++ printf ("HTTP WARNING: page size too small%s|size=%i\n", ++ (display_html ? "" : ""), page_len ); ++ exit (STATE_WARNING); ++ } + /* We only get here if all tests have been passed */ + asprintf (&msg, "HTTP ok: %s - %7.3f second response time %s%s|time=%7.3f\n", + status_line, (float)elapsed_time, -- cgit v1.2.3-74-g34f1