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/39582-check_http_patch | 123 +++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 web/attachments/39582-check_http_patch (limited to 'web/attachments/39582-check_http_patch') diff --git a/web/attachments/39582-check_http_patch b/web/attachments/39582-check_http_patch new file mode 100644 index 0000000..cb9f624 --- /dev/null +++ b/web/attachments/39582-check_http_patch @@ -0,0 +1,123 @@ +Index: plugins/check_http.c +=================================================================== +RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_http.c,v +retrieving revision 1.13 +diff -c -r1.13 check_http.c +*** plugins/check_http.c 19 Dec 2002 19:20:25 -0000 1.13 +--- plugins/check_http.c 13 Jan 2003 03:52:29 -0000 +*************** +*** 44,50 **** + \(-H | -I ) [-u ] [-p ]\n\ + [-w ] [-c ] [-t ] [-L]\n\ + [-a auth] [-f ] [-e ]\n\ +! [-s string] [-r | -R ]\n\ + [-P string]" + + #define LONGOPTIONS "\ +--- 44,50 ---- + \(-H | -I ) [-u ] [-p ]\n\ + [-w ] [-c ] [-t ] [-L]\n\ + [-a auth] [-f ] [-e ]\n\ +! [-s string] [-l] [-r | -R ]\n\ + [-P string]" + + #define LONGOPTIONS "\ +*************** +*** 75,80 **** +--- 75,82 ---- + Wrap output in HTML link (obsoleted by urlize)\n\ + -f, --onredirect=\n\ + How to handle redirected pages\n%s\ ++ -l, --linespan\n\ ++ Allow regex to span newlines (must precede -r or -R)\n\ + -v, --verbose\n\ + Show details for command-line debugging (do not use with nagios server)\n\ + -h, --help\n\ +*************** +*** 286,291 **** +--- 288,294 ---- + {"regex", required_argument, 0, 'r'}, + {"ereg", required_argument, 0, 'r'}, + {"eregi", required_argument, 0, 'R'}, ++ {"linespan", no_argument, 0, 'l'}, + {"onredirect", required_argument, 0, 'f'}, + {"certificate", required_argument, 0, 'C'}, + {0, 0, 0, 0} +*************** +*** 308,314 **** + strcpy (argv[c], "-n"); + } + +! #define OPTCHARS "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nLS" + + while (1) { + #ifdef HAVE_GETOPT_H +--- 311,317 ---- + strcpy (argv[c], "-n"); + } + +! #define OPTCHARS "Vvht:c:w:H:P:I:a:e:p:s:R:r:lu:f:C:nLS" + + while (1) { + #ifdef HAVE_GETOPT_H +*************** +*** 420,434 **** + server_expect[MAX_INPUT_BUFFER - 1] = 0; + server_expect_yn = 1; + break; + case 'R': /* regex */ +! #ifdef HAVE_REGEX_H +! cflags = REG_ICASE; +! #else + usage ("check_http: call for regex which was not a compiled option\n"); +! #endif + case 'r': /* regex */ +! #ifdef HAVE_REGEX_H + cflags |= REG_EXTENDED | REG_NOSUB | REG_NEWLINE; + strncpy (regexp, optarg, MAX_RE_SIZE - 1); + regexp[MAX_RE_SIZE - 1] = 0; + errcode = regcomp (&preg, regexp, cflags); +--- 423,444 ---- + server_expect[MAX_INPUT_BUFFER - 1] = 0; + server_expect_yn = 1; + break; ++ #ifndef HAVE_REGEX_H ++ case 'l': /* linespan */ + case 'R': /* regex */ +! case 'r': /* regex */ + usage ("check_http: call for regex which was not a compiled option\n"); +! break; +! #else +! case 'l': /* linespan */ +! cflags &= ~REG_NEWLINE; +! break; +! case 'R': /* regex */ +! cflags |= REG_ICASE; + case 'r': /* regex */ +! /* this is not required here, as it's initialized + cflags |= REG_EXTENDED | REG_NOSUB | REG_NEWLINE; ++ */ + strncpy (regexp, optarg, MAX_RE_SIZE - 1); + regexp[MAX_RE_SIZE - 1] = 0; + errcode = regcomp (&preg, regexp, cflags); +*************** +*** 437,446 **** + printf ("Could Not Compile Regular Expression: %s", errbuf); + return ERROR; + } +- #else +- usage ("check_http: call for regex which was not a compiled option\n"); +- #endif + break; + case 'v': /* verbose */ + verbose = TRUE; + break; +--- 447,454 ---- + printf ("Could Not Compile Regular Expression: %s", errbuf); + return ERROR; + } + break; ++ #endif + case 'v': /* verbose */ + verbose = TRUE; + break; -- cgit v1.2.3-74-g34f1