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. --- .../266466-check_http.extented_status_codes.patch | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 web/attachments/266466-check_http.extented_status_codes.patch (limited to 'web/attachments/266466-check_http.extented_status_codes.patch') diff --git a/web/attachments/266466-check_http.extented_status_codes.patch b/web/attachments/266466-check_http.extented_status_codes.patch new file mode 100644 index 0000000..47ff717 --- /dev/null +++ b/web/attachments/266466-check_http.extented_status_codes.patch @@ -0,0 +1,46 @@ +169c170,198 +< +--- +> +> /* checks if status code statcode is in server reply reply */ +> int +> check_statuscode (char * reply, char * statcode) +> { +> int status = 0; +> char scode[4] = "201"; +> int ipos = 0; +> char *kpos = strchr(statcode, ','); +> +> while (kpos) +> { +> memcpy(scode, &statcode[ipos], 3); +> ipos += 4; +> kpos = strchr(&statcode[ipos], ','); +> +> if (strstr(reply, scode)) +> { +> status = 1; +> } +> } +> +> memcpy(scode, &statcode[ipos], 3); +> if (strstr(reply, scode)) +> { +> status = 1; +> } +> return status; +> } +871c913 +< if (!strstr (status_line, server_expect)) { +--- +> if (!check_statuscode(status_line, server_expect)) { +874c916 +< _("Invalid HTTP response received from host\n")); +--- +> _("Invalid HTTP response received from host \"%s\"\n"), status_line); +877,878c919,920 +< _("Invalid HTTP response received from host on port %d\n"), +< server_port); +--- +> _("Invalid HTTP response received from host on port %d \"%s\"\n"), +> server_port, status_line); -- cgit v1.2.3-74-g34f1