diff options
-rw-r--r-- | NEWS | 41 | ||||
-rwxr-xr-x | NP-VERSION-GEN | 2 | ||||
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | THANKS.in | 24 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | doc/RELEASING.md | 28 | ||||
-rw-r--r-- | plugins-root/check_icmp.c | 2 | ||||
-rwxr-xr-x | plugins-scripts/check_mailq.pl | 8 | ||||
-rw-r--r-- | plugins/check_curl.c | 39 | ||||
-rw-r--r-- | plugins/check_dns.c | 20 | ||||
-rw-r--r-- | plugins/check_http.c | 15 |
11 files changed, 151 insertions, 34 deletions
@@ -1,17 +1,56 @@ | |||
1 | This file documents the major additions and syntax changes between releases. | 1 | This file documents the major additions and syntax changes between releases. |
2 | 2 | ||
3 | 2.3 [...] | 3 | 2.4 [...] |
4 | ENHANCEMENTS | ||
5 | |||
6 | FIXES | ||
7 | |||
8 | 2.3 10th December 2020 | ||
4 | ENHANCEMENTS | 9 | ENHANCEMENTS |
5 | check_dns: allow 'expected address' (-a) to be specified in CIDR notation | 10 | check_dns: allow 'expected address' (-a) to be specified in CIDR notation |
6 | (IPv4 only). | 11 | (IPv4 only). |
7 | check_dns: allow for IPv6 RDNS | 12 | check_dns: allow for IPv6 RDNS |
13 | check_dns: Accept CIDR | ||
8 | check_dns: allow unsorted addresses | 14 | check_dns: allow unsorted addresses |
9 | check_dns: allow forcing complete match of all addresses | 15 | check_dns: allow forcing complete match of all addresses |
10 | check_apt: add --only-critical switch | 16 | check_apt: add --only-critical switch |
11 | check_apt: add -l/--list option to print packages | 17 | check_apt: add -l/--list option to print packages |
18 | check_file_age: add range checking | ||
19 | check_file_age: enable to test for maximum file size | ||
20 | check_apt: adding packages-warning option | ||
21 | check_load: Adding top consuming processes option | ||
22 | check_http: Adding Proxy-Authorization and extra headers | ||
23 | check_snmp: make calcualtion of timeout value in help output more clear | ||
24 | check_uptime: new plugin for checking uptime to see how long the system is running | ||
25 | check_curl: check_http replacement based on libcurl | ||
26 | check_http: Allow user to specify HTTP method after proxy CONNECT | ||
27 | check_http: Add new flag --show-body/-B to print body | ||
28 | check_cluster: Added data argument validation | ||
29 | check_icmp: Add IPv6 support | ||
30 | check_icmp: Automatically detect IP protocol | ||
31 | check_icmp: emit error if multiple protocol version | ||
32 | check_disk: add support to display inodes usage in perfdata | ||
33 | check_hpjd: Added -D option to disable warning on 'out of paper' | ||
34 | check_http: support the --show-body/-B flag when --expect is used | ||
35 | check_mysql: allow mariadbclient to be used | ||
36 | check_tcp: add --sni | ||
37 | check_dns: detect unreachable dns service in nslookup output | ||
12 | 38 | ||
13 | FIXES | 39 | FIXES |
14 | Fix regression where check_dhcp was rereading response in a tight loop | 40 | Fix regression where check_dhcp was rereading response in a tight loop |
41 | check_dns: fix error detection on sles nslookup | ||
42 | check_disk_smb: fix timeout issue | ||
43 | check_swap: repaired "-n" behaviour | ||
44 | check_icmp: Correctly set address_family on lookup | ||
45 | check_icmp: Do not overwrite -4,-6 on lookup | ||
46 | check_smtp: initializes n before it is used | ||
47 | check_dns: fix typo in parameter description | ||
48 | check_by_ssh: fix child process leak on timeouts | ||
49 | check_mysql: Allow sockets to be specified to -H | ||
50 | check_procs: improve command examples for 'at least' processes | ||
51 | check_swap: repaired "-n" behaviour | ||
52 | check_disk: include -P switch in help | ||
53 | check_mailq: restore accidentially removed options | ||
15 | 54 | ||
16 | 2.2 29th November 2016 | 55 | 2.2 29th November 2016 |
17 | ENHANCEMENTS | 56 | ENHANCEMENTS |
diff --git a/NP-VERSION-GEN b/NP-VERSION-GEN index cf78d69c..c353b1d1 100755 --- a/NP-VERSION-GEN +++ b/NP-VERSION-GEN | |||
@@ -6,7 +6,7 @@ | |||
6 | SRC_ROOT=`dirname $0` | 6 | SRC_ROOT=`dirname $0` |
7 | 7 | ||
8 | NPVF=NP-VERSION-FILE | 8 | NPVF=NP-VERSION-FILE |
9 | DEF_VER=2.2.git | 9 | DEF_VER=2.3git |
10 | 10 | ||
11 | LF=' | 11 | LF=' |
12 | ' | 12 | ' |
@@ -10,7 +10,7 @@ Monitoring Plugins | |||
10 | * For information on detailed changes that have been made or plugins | 10 | * For information on detailed changes that have been made or plugins |
11 | that have been added, read the `ChangeLog` file. | 11 | that have been added, read the `ChangeLog` file. |
12 | 12 | ||
13 | * Some plugins require that you have additional programs and/or | 13 | * Some plugins require that you have additional programs or |
14 | libraries installed on your system before they can be used. Plugins that | 14 | libraries installed on your system before they can be used. Plugins that |
15 | are dependent on other programs/libraries that are missing are usually not | 15 | are dependent on other programs/libraries that are missing are usually not |
16 | compiled. Read the `REQUIREMENTS` file for more information. | 16 | compiled. Read the `REQUIREMENTS` file for more information. |
@@ -19,7 +19,7 @@ Monitoring Plugins | |||
19 | the basic guidelines for development will provide detailed help when | 19 | the basic guidelines for development will provide detailed help when |
20 | invoked with the `-h` or `--help` options. | 20 | invoked with the `-h` or `--help` options. |
21 | 21 | ||
22 | You can check for the latest plugins at: | 22 | You can check the latest plugins at: |
23 | 23 | ||
24 | * <https://www.monitoring-plugins.org/> | 24 | * <https://www.monitoring-plugins.org/> |
25 | 25 | ||
@@ -357,3 +357,27 @@ Thomas Kurschel | |||
357 | Yannick Charton | 357 | Yannick Charton |
358 | Nicolai Søborg | 358 | Nicolai Søborg |
359 | Rolf Eike Beer | 359 | Rolf Eike Beer |
360 | Bernd Arnold | ||
361 | Andreas Baumann | ||
362 | Tobias Wolf | ||
363 | Lars Michelsen | ||
364 | Vincent Danjean | ||
365 | Kostyantyn Hushchyn | ||
366 | Christian Tacke | ||
367 | Alexander A. Klimov | ||
368 | Vadim Zhukov | ||
369 | Bernard Spil | ||
370 | Christian Schmidt | ||
371 | Guido Falsi | ||
372 | Harald Koch | ||
373 | Iustin Pop | ||
374 | Jacob Hansen | ||
375 | Jean-François Rameau | ||
376 | Karol Babioch | ||
377 | Lucas Bussey | ||
378 | Marc Sánchez | ||
379 | Markus Frosch | ||
380 | Michael Kraus | ||
381 | Patrick Rauscher | ||
382 | Prathamesh Bhanuse | ||
383 | Valentin Vidic | ||
diff --git a/configure.ac b/configure.ac index 4aebc2ad..7c17dcd1 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,6 +1,6 @@ | |||
1 | dnl Process this file with autoconf to produce a configure script. | 1 | dnl Process this file with autoconf to produce a configure script. |
2 | AC_PREREQ(2.59) | 2 | AC_PREREQ(2.59) |
3 | AC_INIT(monitoring-plugins,2.2) | 3 | AC_INIT(monitoring-plugins,2.3git) |
4 | AC_CONFIG_SRCDIR(NPTest.pm) | 4 | AC_CONFIG_SRCDIR(NPTest.pm) |
5 | AC_CONFIG_FILES([gl/Makefile]) | 5 | AC_CONFIG_FILES([gl/Makefile]) |
6 | AC_CONFIG_AUX_DIR(build-aux) | 6 | AC_CONFIG_AUX_DIR(build-aux) |
diff --git a/doc/RELEASING.md b/doc/RELEASING.md index 1f9db078..bcd2c5ac 100644 --- a/doc/RELEASING.md +++ b/doc/RELEASING.md | |||
@@ -11,14 +11,14 @@ Before you start | |||
11 | 11 | ||
12 | - Check Travis CI status. | 12 | - Check Travis CI status. |
13 | - Update local Git repository to the current `master` tip. For a | 13 | - Update local Git repository to the current `master` tip. For a |
14 | maintenance release (e.g., version 2.2.2), update to the current | 14 | maintenance release (e.g., version 2.3.2), update to the current |
15 | `maint-2.2` tip, instead. | 15 | `maint-2.3` tip, instead. |
16 | 16 | ||
17 | Prepare and commit files | 17 | Prepare and commit files |
18 | ------------------------ | 18 | ------------------------ |
19 | 19 | ||
20 | - Update `configure.ac` and `NP-VERSION-GEN` with new version. | 20 | - Update `configure.ac` and `NP-VERSION-GEN` with new version. |
21 | - Update `NEWS` from `git log --reverse v2.2.1..` output, and specify | 21 | - Update `NEWS` from `git log --reverse v2.3.1..` output, and specify |
22 | the release version/date. | 22 | the release version/date. |
23 | - Update `AUTHORS` if there are new team members. | 23 | - Update `AUTHORS` if there are new team members. |
24 | - Update `THANKS.in` using `tools/update-thanks`. | 24 | - Update `THANKS.in` using `tools/update-thanks`. |
@@ -29,27 +29,27 @@ Prepare and commit files | |||
29 | Create annotated tag | 29 | Create annotated tag |
30 | -------------------- | 30 | -------------------- |
31 | 31 | ||
32 | git tag -a -m 'Monitoring Plugins 2.3' v2.3 | 32 | git tag -a -m 'Monitoring Plugins 2.4' v2.4 |
33 | 33 | ||
34 | Push the code and tag to GitHub | 34 | Push the code and tag to GitHub |
35 | ------------------------------- | 35 | ------------------------------- |
36 | 36 | ||
37 | git push monitoring-plugins master | 37 | git push monitoring-plugins master |
38 | git push monitoring-plugins v2.3 | 38 | git push monitoring-plugins v2.4 |
39 | 39 | ||
40 | Create new maintenance branch | 40 | Create new maintenance branch |
41 | ----------------------------- | 41 | ----------------------------- |
42 | 42 | ||
43 | _Only necessary when creating a feature release._ | 43 | _Only necessary when creating a feature release._ |
44 | 44 | ||
45 | git checkout -b maint-2.3 v2.3 | 45 | git checkout -b maint-2.4 v2.4 |
46 | git push -u monitoring-plugins maint-2.3 | 46 | git push -u monitoring-plugins maint-2.4 |
47 | 47 | ||
48 | Checkout new version | 48 | Checkout new version |
49 | -------------------- | 49 | -------------------- |
50 | 50 | ||
51 | rm -rf /tmp/plugins | 51 | rm -rf /tmp/plugins |
52 | git archive --prefix=tmp/plugins/ v2.3 | (cd /; tar -xf -) | 52 | git archive --prefix=tmp/plugins/ v2.4 | (cd /; tar -xf -) |
53 | 53 | ||
54 | Build the tarball | 54 | Build the tarball |
55 | ----------------- | 55 | ----------------- |
@@ -62,26 +62,26 @@ Build the tarball | |||
62 | Upload tarball to web site | 62 | Upload tarball to web site |
63 | -------------------------- | 63 | -------------------------- |
64 | 64 | ||
65 | scp monitoring-plugins-2.3.tar.gz \ | 65 | scp monitoring-plugins-2.4.tar.gz \ |
66 | plugins@orwell.monitoring-plugins.org:web/download/ | 66 | plugins@orwell.monitoring-plugins.org:web/download/ |
67 | 67 | ||
68 | Generate SHA1 checksum file on web site | 68 | Generate SHA1 checksum file on web site |
69 | --------------------------------------- | 69 | --------------------------------------- |
70 | 70 | ||
71 | ssh plugins@orwell.monitoring-plugins.org \ | 71 | ssh plugins@orwell.monitoring-plugins.org \ |
72 | '(cd web/download; $HOME/bin/create-checksum monitoring-plugins-2.3.tar.gz)' | 72 | '(cd web/download; $HOME/bin/create-checksum monitoring-plugins-2.4.tar.gz)' |
73 | 73 | ||
74 | Announce new release | 74 | Announce new release |
75 | -------------------- | 75 | -------------------- |
76 | 76 | ||
77 | - In the site.git repository: | 77 | - In the site.git repository: |
78 | 78 | ||
79 | - Create `web/input/news/release-2-3.md`. | 79 | - Create `web/input/news/release-2-4.md`. |
80 | - Update the `plugins_release` version in `web/macros.py`. | 80 | - Update the `plugins_release` version in `web/macros.py`. |
81 | - Commit and push the result: | 81 | - Commit and push the result: |
82 | 82 | ||
83 | git add web/input/news/release-2-3.md | 83 | git add web/input/news/release-2-4.md |
84 | git commit web/input/news/release-2-3.md web/macros.py | 84 | git commit web/input/news/release-2-4.md web/macros.py |
85 | git push origin master | 85 | git push origin master |
86 | 86 | ||
87 | - Post an announcement on (at least) the following mailing lists: | 87 | - Post an announcement on (at least) the following mailing lists: |
@@ -93,6 +93,6 @@ Announce new release | |||
93 | 93 | ||
94 | If you want to mention the number of contributors in the announcement: | 94 | If you want to mention the number of contributors in the announcement: |
95 | 95 | ||
96 | git shortlog -s v2.2.1..v2.3 | wc -l | 96 | git shortlog -s v2.3.1..v2.4 | wc -l |
97 | 97 | ||
98 | <!-- vim:set filetype=markdown textwidth=72: --> | 98 | <!-- vim:set filetype=markdown textwidth=72: --> |
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index e45fdf60..31eb4c65 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c | |||
@@ -1134,7 +1134,7 @@ finish(int sig) | |||
1134 | while(host) { | 1134 | while(host) { |
1135 | if(!host->icmp_recv) { | 1135 | if(!host->icmp_recv) { |
1136 | /* rta 0 is ofcourse not entirely correct, but will still show up | 1136 | /* rta 0 is ofcourse not entirely correct, but will still show up |
1137 | * conspicuosly as missing entries in perfparse and cacti */ | 1137 | * conspicuously as missing entries in perfparse and cacti */ |
1138 | pl = 100; | 1138 | pl = 100; |
1139 | rta = 0; | 1139 | rta = 0; |
1140 | status = STATE_CRITICAL; | 1140 | status = STATE_CRITICAL; |
diff --git a/plugins-scripts/check_mailq.pl b/plugins-scripts/check_mailq.pl index 32f498d3..aac1310e 100755 --- a/plugins-scripts/check_mailq.pl +++ b/plugins-scripts/check_mailq.pl | |||
@@ -568,7 +568,9 @@ sub process_arguments(){ | |||
568 | "w=i" => \$opt_w, "warning=i" => \$opt_w, # warning if above this number | 568 | "w=i" => \$opt_w, "warning=i" => \$opt_w, # warning if above this number |
569 | "c=i" => \$opt_c, "critical=i" => \$opt_c, # critical if above this number | 569 | "c=i" => \$opt_c, "critical=i" => \$opt_c, # critical if above this number |
570 | "t=i" => \$opt_t, "timeout=i" => \$opt_t, | 570 | "t=i" => \$opt_t, "timeout=i" => \$opt_t, |
571 | "s" => \$opt_s, "sudo" => \$opt_s | 571 | "s" => \$opt_s, "sudo" => \$opt_s, |
572 | "W=i" => \$opt_W, # warning if above this number | ||
573 | "C=i" => \$opt_C, # critical if above this number | ||
572 | ); | 574 | ); |
573 | 575 | ||
574 | if ($opt_V) { | 576 | if ($opt_V) { |
@@ -662,8 +664,8 @@ sub print_help () { | |||
662 | print " Feedback/patches to support non-sendmail mailqueue welcome\n\n"; | 664 | print " Feedback/patches to support non-sendmail mailqueue welcome\n\n"; |
663 | print "-w (--warning) = Min. number of messages in queue to generate warning\n"; | 665 | print "-w (--warning) = Min. number of messages in queue to generate warning\n"; |
664 | print "-c (--critical) = Min. number of messages in queue to generate critical alert ( w < c )\n"; | 666 | print "-c (--critical) = Min. number of messages in queue to generate critical alert ( w < c )\n"; |
665 | print "-W (--Warning) = Min. number of messages for same domain in queue to generate warning\n"; | 667 | print "-W = Min. number of messages for same domain in queue to generate warning\n"; |
666 | print "-C (--Critical) = Min. number of messages for same domain in queue to generate critical alert ( W < C )\n"; | 668 | print "-C = Min. number of messages for same domain in queue to generate critical alert ( W < C )\n"; |
667 | print "-t (--timeout) = Plugin timeout in seconds (default = $utils::TIMEOUT)\n"; | 669 | print "-t (--timeout) = Plugin timeout in seconds (default = $utils::TIMEOUT)\n"; |
668 | print "-M (--mailserver) = [ sendmail | qmail | postfix | exim | nullmailer ] (default = autodetect)\n"; | 670 | print "-M (--mailserver) = [ sendmail | qmail | postfix | exim | nullmailer ] (default = autodetect)\n"; |
669 | print "-s (--sudo) = Use sudo to call the mailq command\n"; | 671 | print "-s (--sudo) = Use sudo to call the mailq command\n"; |
diff --git a/plugins/check_curl.c b/plugins/check_curl.c index 2d69b310..8f274c26 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c | |||
@@ -296,6 +296,28 @@ CURLcode sslctxfun(CURL *curl, SSL_CTX *sslctx, void *parm) | |||
296 | #endif /* USE_OPENSSL */ | 296 | #endif /* USE_OPENSSL */ |
297 | #endif /* HAVE_SSL */ | 297 | #endif /* HAVE_SSL */ |
298 | 298 | ||
299 | /* returns a string "HTTP/1.x" or "HTTP/2" */ | ||
300 | static char *string_statuscode (int major, int minor) | ||
301 | { | ||
302 | static char buf[10]; | ||
303 | |||
304 | switch (major) { | ||
305 | case 1: | ||
306 | snprintf (buf, sizeof (buf), "HTTP/%d.%d", major, minor); | ||
307 | break; | ||
308 | case 2: | ||
309 | case 3: | ||
310 | snprintf (buf, sizeof (buf), "HTTP/%d", major); | ||
311 | break; | ||
312 | default: | ||
313 | /* assuming here HTTP/N with N>=4 */ | ||
314 | snprintf (buf, sizeof (buf), "HTTP/%d", major); | ||
315 | break; | ||
316 | } | ||
317 | |||
318 | return buf; | ||
319 | } | ||
320 | |||
299 | /* Checks if the server 'reply' is one of the expected 'statuscodes' */ | 321 | /* Checks if the server 'reply' is one of the expected 'statuscodes' */ |
300 | static int | 322 | static int |
301 | expected_statuscode (const char *reply, const char *statuscodes) | 323 | expected_statuscode (const char *reply, const char *statuscodes) |
@@ -746,7 +768,8 @@ GOT_FIRST_CERT: | |||
746 | if (curlhelp_parse_statusline (header_buf.buf, &status_line) < 0) { | 768 | if (curlhelp_parse_statusline (header_buf.buf, &status_line) < 0) { |
747 | snprintf (msg, DEFAULT_BUFFER_SIZE, "Unparsable status line in %.3g seconds response time|%s\n", | 769 | snprintf (msg, DEFAULT_BUFFER_SIZE, "Unparsable status line in %.3g seconds response time|%s\n", |
748 | total_time, perfstring); | 770 | total_time, perfstring); |
749 | die (STATE_CRITICAL, "HTTP CRITICAL HTTP/1.x %ld unknown - %s", code, msg); | 771 | /* we cannot know the major/minor version here for sure as we cannot parse the first line */ |
772 | die (STATE_CRITICAL, "HTTP CRITICAL HTTP/x.x %ld unknown - %s", code, msg); | ||
750 | } | 773 | } |
751 | 774 | ||
752 | /* get result code from cURL */ | 775 | /* get result code from cURL */ |
@@ -823,8 +846,8 @@ GOT_FIRST_CERT: | |||
823 | 846 | ||
824 | /* check status codes, set exit status accordingly */ | 847 | /* check status codes, set exit status accordingly */ |
825 | if( status_line.http_code != code ) { | 848 | if( status_line.http_code != code ) { |
826 | die (STATE_CRITICAL, _("HTTP CRITICAL HTTP/%d.%d %d %s - different HTTP codes (cUrl has %ld)\n"), | 849 | die (STATE_CRITICAL, _("HTTP CRITICAL %s %d %s - different HTTP codes (cUrl has %ld)\n"), |
827 | status_line.http_major, status_line.http_minor, | 850 | string_statuscode (status_line.http_major, status_line.http_minor), |
828 | status_line.http_code, status_line.msg, code); | 851 | status_line.http_code, status_line.msg, code); |
829 | } | 852 | } |
830 | 853 | ||
@@ -895,8 +918,8 @@ GOT_FIRST_CERT: | |||
895 | msg[strlen(msg)-3] = '\0'; | 918 | msg[strlen(msg)-3] = '\0'; |
896 | 919 | ||
897 | /* TODO: separate _() msg and status code: die (result, "HTTP %s: %s\n", state_text(result), msg); */ | 920 | /* TODO: separate _() msg and status code: die (result, "HTTP %s: %s\n", state_text(result), msg); */ |
898 | die (result, "HTTP %s: HTTP/%d.%d %d %s%s%s - %d bytes in %.3f second response time %s|%s\n", | 921 | die (result, "HTTP %s: %s %d %s%s%s - %d bytes in %.3f second response time %s|%s\n", |
899 | state_text(result), status_line.http_major, status_line.http_minor, | 922 | state_text(result), string_statuscode (status_line.http_major, status_line.http_minor), |
900 | status_line.http_code, status_line.msg, | 923 | status_line.http_code, status_line.msg, |
901 | strlen(msg) > 0 ? " - " : "", | 924 | strlen(msg) > 0 ? " - " : "", |
902 | msg, page_len, total_time, | 925 | msg, page_len, total_time, |
@@ -1041,7 +1064,7 @@ redir (curlhelp_write_curlbuf* header_buf) | |||
1041 | const UriPathSegmentA* p = uri.pathHead; | 1064 | const UriPathSegmentA* p = uri.pathHead; |
1042 | for (; p; p = p->next) { | 1065 | for (; p; p = p->next) { |
1043 | strncat (new_url, "/", DEFAULT_BUFFER_SIZE); | 1066 | strncat (new_url, "/", DEFAULT_BUFFER_SIZE); |
1044 | strncat (new_url, uri_string (p->text, buf, DEFAULT_BUFFER_SIZE), DEFAULT_BUFFER_SIZE); | 1067 | strncat (new_url, uri_string (p->text, buf, DEFAULT_BUFFER_SIZE), DEFAULT_BUFFER_SIZE-1); |
1045 | } | 1068 | } |
1046 | } | 1069 | } |
1047 | 1070 | ||
@@ -1354,7 +1377,7 @@ process_arguments (int argc, char **argv) | |||
1354 | ssl_version = CURL_SSLVERSION_DEFAULT; | 1377 | ssl_version = CURL_SSLVERSION_DEFAULT; |
1355 | #endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 52, 0) */ | 1378 | #endif /* LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 52, 0) */ |
1356 | else | 1379 | else |
1357 | usage4 (_("Invalid option - Valid SSL/TLS versions: 2, 3, 1, 1.1, 1.2 (with optional '+' suffix)")); | 1380 | usage4 (_("Invalid option - Valid SSL/TLS versions: 2, 3, 1, 1.1, 1.2, 1.3 (with optional '+' suffix)")); |
1358 | } | 1381 | } |
1359 | #if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 54, 0) | 1382 | #if LIBCURL_VERSION_NUM >= MAKE_LIBCURL_VERSION(7, 54, 0) |
1360 | if (got_plus) { | 1383 | if (got_plus) { |
@@ -1659,7 +1682,7 @@ print_help (void) | |||
1659 | printf (" %s\n", "-S, --ssl=VERSION[+]"); | 1682 | printf (" %s\n", "-S, --ssl=VERSION[+]"); |
1660 | printf (" %s\n", _("Connect via SSL. Port defaults to 443. VERSION is optional, and prevents")); | 1683 | printf (" %s\n", _("Connect via SSL. Port defaults to 443. VERSION is optional, and prevents")); |
1661 | printf (" %s\n", _("auto-negotiation (2 = SSLv2, 3 = SSLv3, 1 = TLSv1, 1.1 = TLSv1.1,")); | 1684 | printf (" %s\n", _("auto-negotiation (2 = SSLv2, 3 = SSLv3, 1 = TLSv1, 1.1 = TLSv1.1,")); |
1662 | printf (" %s\n", _("1.2 = TLSv1.2). With a '+' suffix, newer versions are also accepted.")); | 1685 | printf (" %s\n", _("1.2 = TLSv1.2, 1.3 = TLSv1.3). With a '+' suffix, newer versions are also accepted.")); |
1663 | printf (" %s\n", _("Note: SSLv2 and SSLv3 are deprecated and are usually disabled in libcurl")); | 1686 | printf (" %s\n", _("Note: SSLv2 and SSLv3 are deprecated and are usually disabled in libcurl")); |
1664 | printf (" %s\n", "--sni"); | 1687 | printf (" %s\n", "--sni"); |
1665 | printf (" %s\n", _("Enable SSL/TLS hostname extension support (SNI)")); | 1688 | printf (" %s\n", _("Enable SSL/TLS hostname extension support (SNI)")); |
diff --git a/plugins/check_dns.c b/plugins/check_dns.c index b90f50e6..0f2e6541 100644 --- a/plugins/check_dns.c +++ b/plugins/check_dns.c | |||
@@ -473,9 +473,23 @@ process_arguments (int argc, char **argv) | |||
473 | case 'a': /* expected address */ | 473 | case 'a': /* expected address */ |
474 | if (strlen (optarg) >= ADDRESS_LENGTH) | 474 | if (strlen (optarg) >= ADDRESS_LENGTH) |
475 | die (STATE_UNKNOWN, _("Input buffer overflow\n")); | 475 | die (STATE_UNKNOWN, _("Input buffer overflow\n")); |
476 | expected_address = (char **)realloc(expected_address, (expected_address_cnt+1) * sizeof(char**)); | 476 | if (strchr(optarg, ',') != NULL) { |
477 | expected_address[expected_address_cnt] = strdup(optarg); | 477 | char *comma = strchr(optarg, ','); |
478 | expected_address_cnt++; | 478 | while (comma != NULL) { |
479 | expected_address = (char **)realloc(expected_address, (expected_address_cnt+1) * sizeof(char**)); | ||
480 | expected_address[expected_address_cnt] = strndup(optarg, comma - optarg); | ||
481 | expected_address_cnt++; | ||
482 | optarg = comma + 1; | ||
483 | comma = strchr(optarg, ','); | ||
484 | } | ||
485 | expected_address = (char **)realloc(expected_address, (expected_address_cnt+1) * sizeof(char**)); | ||
486 | expected_address[expected_address_cnt] = strdup(optarg); | ||
487 | expected_address_cnt++; | ||
488 | } else { | ||
489 | expected_address = (char **)realloc(expected_address, (expected_address_cnt+1) * sizeof(char**)); | ||
490 | expected_address[expected_address_cnt] = strdup(optarg); | ||
491 | expected_address_cnt++; | ||
492 | } | ||
479 | break; | 493 | break; |
480 | case 'A': /* expect authority */ | 494 | case 'A': /* expect authority */ |
481 | expect_authority = TRUE; | 495 | expect_authority = TRUE; |
diff --git a/plugins/check_http.c b/plugins/check_http.c index de59a068..e2298b17 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c | |||
@@ -931,6 +931,21 @@ check_http (void) | |||
931 | 931 | ||
932 | if (verbose) printf ("Entering CONNECT tunnel mode with proxy %s:%d to dst %s:%d\n", server_address, server_port, host_name, HTTPS_PORT); | 932 | if (verbose) printf ("Entering CONNECT tunnel mode with proxy %s:%d to dst %s:%d\n", server_address, server_port, host_name, HTTPS_PORT); |
933 | asprintf (&buf, "%s %s:%d HTTP/1.1\r\n%s\r\n", http_method, host_name, HTTPS_PORT, user_agent); | 933 | asprintf (&buf, "%s %s:%d HTTP/1.1\r\n%s\r\n", http_method, host_name, HTTPS_PORT, user_agent); |
934 | if (strlen(proxy_auth)) { | ||
935 | base64_encode_alloc (proxy_auth, strlen (proxy_auth), &auth); | ||
936 | xasprintf (&buf, "%sProxy-Authorization: Basic %s\r\n", buf, auth); | ||
937 | } | ||
938 | /* optionally send any other header tag */ | ||
939 | if (http_opt_headers_count) { | ||
940 | for (i = 0; i < http_opt_headers_count ; i++) { | ||
941 | if (force_host_header != http_opt_headers[i]) { | ||
942 | xasprintf (&buf, "%s%s\r\n", buf, http_opt_headers[i]); | ||
943 | } | ||
944 | } | ||
945 | /* This cannot be free'd here because a redirection will then try to access this and segfault */ | ||
946 | /* Covered in a testcase in tests/check_http.t */ | ||
947 | /* free(http_opt_headers); */ | ||
948 | } | ||
934 | asprintf (&buf, "%sProxy-Connection: keep-alive\r\n", buf); | 949 | asprintf (&buf, "%sProxy-Connection: keep-alive\r\n", buf); |
935 | asprintf (&buf, "%sHost: %s\r\n", buf, host_name); | 950 | asprintf (&buf, "%sHost: %s\r\n", buf, host_name); |
936 | /* we finished our request, send empty line with CRLF */ | 951 | /* we finished our request, send empty line with CRLF */ |