summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bc3c8c7)
raw | patch | inline | side by side (parent: bc3c8c7)
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | |
Tue, 22 Sep 2009 01:20:33 +0000 (21:20 -0400) | ||
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | |
Tue, 22 Sep 2009 01:20:33 +0000 (21:20 -0400) |
NEWS | patch | blob | history | |
THANKS.in | patch | blob | history | |
plugins/check_http.c | patch | blob | history |
index e6df5797af8bfa5d7835c69c6c5f383a984c127b..82315482ffbaed96ac690ba0224287e1cd99c18d 100644 (file)
--- a/NEWS
+++ b/NEWS
1.4.15 ...
Fix check_ircd binding to wrong interface (#668778)
+ Add proxy-authorization option to check_http (Peter Doherty - #2863772, Bryan Irvine - #2863925)
1.4.14 16th September 2009
check_http has options to specify the HTTP method (#2155152)
diff --git a/THANKS.in b/THANKS.in
index 038ad9358844d3533a68432f9f36837b3dd3bbc5..85ad0414d65b58cf6008cba2e420fcefb1345464 100644 (file)
--- a/THANKS.in
+++ b/THANKS.in
Will Preston
Nikita Kalabukhov
Grant Byers
+Peter Doherty
+Bryan Irvine
diff --git a/plugins/check_http.c b/plugins/check_http.c
index 79f6adf39962767c4d14a19d6d587c988afb6d8f..b4e60041f0fc1d27cb3b1f06007720590c1f05a3 100644 (file)
--- a/plugins/check_http.c
+++ b/plugins/check_http.c
double critical_time = 0;
int check_critical_time = FALSE;
char user_auth[MAX_INPUT_BUFFER] = "";
+char proxy_auth[MAX_INPUT_BUFFER] = "";
int display_html = FALSE;
char **http_opt_headers;
int http_opt_headers_count = 0;
{"url", required_argument, 0, 'u'},
{"port", required_argument, 0, 'p'},
{"authorization", required_argument, 0, 'a'},
+ {"proxy_authorization", required_argument, 0, 'b'},
{"string", required_argument, 0, 's'},
{"expect", required_argument, 0, 'e'},
{"regex", required_argument, 0, 'r'},
}
while (1) {
- c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:j:T:I:a:e:p:s:R:r:u:f:C:nlLSm:M:N", longopts, &option);
+ c = getopt_long (argc, argv, "Vvh46t:c:w:A:k:H:P:j:T:I:a:b:e:p:s:R:r:u:f:C:nlLSm:M:N", longopts, &option);
if (c == -1 || c == EOF)
break;
strncpy (user_auth, optarg, MAX_INPUT_BUFFER - 1);
user_auth[MAX_INPUT_BUFFER - 1] = 0;
break;
+ case 'b': /* proxy-authorization info */
+ strncpy (proxy_auth, optarg, MAX_INPUT_BUFFER - 1);
+ proxy_auth[MAX_INPUT_BUFFER - 1] = 0;
+ break;
case 'P': /* HTTP POST data in URL encoded format; ignored if settings already */
if (! http_post_data)
http_post_data = strdup (optarg);
asprintf (&buf, "%sAuthorization: Basic %s\r\n", buf, auth);
}
+ /* optionally send the proxy authentication info */
+ if (strlen(proxy_auth)) {
+ base64_encode_alloc (proxy_auth, strlen (proxy_auth), &auth);
+ asprintf (&buf, "%sProxy-Authorization: Basic %s\r\n", buf, auth);
+ }
+
/* either send http POST data (any data, not only POST)*/
if (http_post_data) {
if (http_content_type) {
printf (" %s\n", "-a, --authorization=AUTH_PAIR");
printf (" %s\n", _("Username:password on sites with basic authentication"));
+ printf (" %s\n", "-b, --proxy-authorization=AUTH_PAIR");
+ printf (" %s\n", _("Username:password on proxy-servers with basic authentication"));
printf (" %s\n", "-A, --useragent=STRING");
printf (" %s\n", _("String to be sent in http header as \"User Agent\""));
printf (" %s\n", "-k, --header=STRING");
printf (_("Usage:"));
printf (" %s -H <vhost> | -I <IP-address> [-u <uri>] [-p <port>]\n",progname);
printf (" [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n");
- printf (" [-a auth] [-f <ok | warn | critcal | follow | sticky | stickyport>]\n");
+ printf (" [-a auth] [-b proxy_auth] [-f <ok | warn | critcal | follow | sticky | stickyport>]\n");
printf (" [-e <expect>] [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n");
printf (" [-P string] [-m <min_pg_size>:<max_pg_size>] [-4|-6] [-N] [-M <age>]\n");
printf (" [-A string] [-k string] [-S] [-C <age>] [-T <content-type>] [-j method]\n");