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/113160-check_http.diff | 65 ++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 web/attachments/113160-check_http.diff (limited to 'web/attachments/113160-check_http.diff') diff --git a/web/attachments/113160-check_http.diff b/web/attachments/113160-check_http.diff new file mode 100644 index 0000000..c2b1a45 --- /dev/null +++ b/web/attachments/113160-check_http.diff @@ -0,0 +1,65 @@ +--- check_http.c.old 2004-12-01 15:57:08.000000000 +0100 ++++ check_http.c 2004-12-06 11:56:11.000000000 +0100 +@@ -112,6 +112,7 @@ + char *http_method; + char *http_post_data; + char buffer[MAX_INPUT_BUFFER]; ++int do_soap = FALSE; + + int process_arguments (int, char **); + static char *base64 (const char *bin, size_t len); +@@ -210,6 +211,7 @@ + {"min", required_argument, 0, 'm'}, + {"use-ipv4", no_argument, 0, '4'}, + {"use-ipv6", no_argument, 0, '6'}, ++ {"soap", no_argument, 0, 'W'}, + {0, 0, 0, 0} + }; + +@@ -230,7 +232,7 @@ + } + + while (1) { +- c = getopt_long (argc, argv, "Vvh46t:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:", longopts, &option); ++ c = getopt_long (argc, argv, "Vvh46tW:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:", longopts, &option); + if (c == -1 || c == EOF) + break; + +@@ -384,6 +386,9 @@ + case 'm': /* min_page_length */ + min_page_len = atoi (optarg); + break; ++ case 'W': /* use SOAP mode */ ++ do_soap = TRUE; ++ break; + } + } + +@@ -519,9 +524,16 @@ + + /* either send http POST data */ + if (http_post_data) { +- asprintf (&buf, "%sContent-Type: application/x-www-form-urlencoded\r\n", buf); +- asprintf (&buf, "%sContent-Length: %i\r\n\r\n", buf, strlen (http_post_data)); +- asprintf (&buf, "%s%s%s", buf, http_post_data, CRLF); ++ if (do_soap) { ++ asprintf (&buf, "%sSOAPAction:\r\n", buf); ++ asprintf (&buf, "%sContent-Type: text/xml; charset=utf-8\r\n", buf); ++ asprintf (&buf, "%sContent-Length: %i\r\n\r\n", buf, strlen (http_post_data)); ++ asprintf (&buf, "%s%s%s", buf, http_post_data, CRLF); ++ } else { ++ asprintf (&buf, "%sContent-Type: application/x-www-form-urlencoded\r\n", buf); ++ asprintf (&buf, "%sContent-Length: %i\r\n\r\n", buf, strlen (http_post_data)); ++ asprintf (&buf, "%s%s%s", buf, http_post_data, CRLF); ++ } + } + else { + /* or just a newline so the server knows we're done with the request */ +@@ -1214,6 +1226,6 @@ + [-w ] [-c ] [-t ] [-L]\n\ + [-a auth] [-f ] [-e ]\n\ + [-s string] [-l] [-r | -R ]\n\ +- [-P string] [-m min_pg_size] [-4|-6]\n"), progname); ++ [-P string] [-m min_pg_size] [-4|-6] [-W]\n"), progname); + printf (_(UT_HLP_VRS), progname, progname); + } -- cgit v1.2.3-74-g34f1