diff options
Diffstat (limited to 'web/attachments/41493-http.patch')
-rw-r--r-- | web/attachments/41493-http.patch | 82 |
1 files changed, 82 insertions, 0 deletions
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 @@ | |||
1 | Index: check_http.c | ||
2 | =================================================================== | ||
3 | RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_http.c,v | ||
4 | retrieving revision 1.15 | ||
5 | diff -u -p -r1.15 check_http.c | ||
6 | --- check_http.c 16 Jan 2003 06:29:02 -0000 1.15 | ||
7 | +++ check_http.c 22 Jan 2003 17:53:43 -0000 | ||
8 | @@ -45,7 +45,7 @@ certificate expiration times.\n" | ||
9 | [-w <warn time>] [-c <critical time>] [-t <timeout>] [-L]\n\ | ||
10 | [-a auth] [-f <ok | warn | critcal | follow>] [-e <expect>]\n\ | ||
11 | [-s string] [-l] [-r <regex> | -R <case-insensitive regex>]\n\ | ||
12 | - [-P string]" | ||
13 | + [-P string] [-m min_pg_size]" | ||
14 | |||
15 | #define LONGOPTIONS "\ | ||
16 | -H, --hostname=ADDRESS\n\ | ||
17 | @@ -75,6 +75,8 @@ certificate expiration times.\n" | ||
18 | Wrap output in HTML link (obsoleted by urlize)\n\ | ||
19 | -f, --onredirect=<ok|warning|critical|follow>\n\ | ||
20 | How to handle redirected pages\n%s%s\ | ||
21 | + -m, --min=INTEGER\n\ | ||
22 | + Minimum page size required (bytes)\n\ | ||
23 | -v, --verbose\n\ | ||
24 | Show details for command-line debugging (do not use with nagios server)\n\ | ||
25 | -h, --help\n\ | ||
26 | @@ -212,6 +214,7 @@ int onredirect = STATE_OK; | ||
27 | int use_ssl = FALSE; | ||
28 | int verbose = FALSE; | ||
29 | int sd; | ||
30 | +int min_page_len = 0; | ||
31 | /*@null@*/ char *http_method = NULL; | ||
32 | /*@null@*/ char *http_post_data = NULL; | ||
33 | char buffer[MAX_INPUT_BUFFER]; | ||
34 | @@ -301,6 +304,7 @@ process_arguments (int argc, char **argv | ||
35 | {"linespan", no_argument, 0, 'l'}, | ||
36 | {"onredirect", required_argument, 0, 'f'}, | ||
37 | {"certificate", required_argument, 0, 'C'}, | ||
38 | + {"min",required_argument,0,'m'}, | ||
39 | {0, 0, 0, 0} | ||
40 | }; | ||
41 | #endif | ||
42 | @@ -321,7 +325,7 @@ process_arguments (int argc, char **argv | ||
43 | strcpy (argv[c], "-n"); | ||
44 | } | ||
45 | |||
46 | -#define OPTCHARS "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLS" | ||
47 | +#define OPTCHARS "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:" | ||
48 | |||
49 | while (1) { | ||
50 | #ifdef HAVE_GETOPT_H | ||
51 | @@ -459,6 +463,9 @@ process_arguments (int argc, char **argv | ||
52 | case 'v': /* verbose */ | ||
53 | verbose = TRUE; | ||
54 | break; | ||
55 | + case 'm': /* min_page_length */ | ||
56 | + min_page_len = atoi (optarg); | ||
57 | + break; | ||
58 | } | ||
59 | } | ||
60 | |||
61 | @@ -548,6 +555,7 @@ check_http (void) | ||
62 | char *x = NULL; | ||
63 | char *orig_url = NULL; | ||
64 | double elapsed_time; | ||
65 | + int page_len = 0; | ||
66 | |||
67 | /* try to connect to the host at the given port number */ | ||
68 | #ifdef HAVE_SSL | ||
69 | @@ -895,6 +903,13 @@ check_http (void) | ||
70 | } | ||
71 | #endif | ||
72 | |||
73 | + /* make sure the page is of an appropriate size */ | ||
74 | + page_len = strlen (page); | ||
75 | + if ((min_page_len > 0) && (page_len < min_page_len)) { | ||
76 | + printf ("HTTP WARNING: page size too small%s|size=%i\n", | ||
77 | + (display_html ? "</A>" : ""), page_len ); | ||
78 | + exit (STATE_WARNING); | ||
79 | + } | ||
80 | /* We only get here if all tests have been passed */ | ||
81 | asprintf (&msg, "HTTP ok: %s - %7.3f second response time %s%s|time=%7.3f\n", | ||
82 | status_line, (float)elapsed_time, | ||