summaryrefslogtreecommitdiffstats
path: root/plugins/check_curl.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_curl.c')
-rw-r--r--plugins/check_curl.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index fc704171..ba856a11 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -672,6 +672,11 @@ redir_wrapper redir(curlhelp_write_curlbuf *header_buf, const check_curl_config
672 672
673 char *location = get_header_value(headers, nof_headers, "location"); 673 char *location = get_header_value(headers, nof_headers, "location");
674 674
675 if (location == NULL) {
676 // location header not found
677 die(STATE_UNKNOWN, "HTTP UNKNOWN - could not find \"location\" header\n");
678 }
679
675 if (verbose >= 2) { 680 if (verbose >= 2) {
676 printf(_("* Seen redirect location %s\n"), location); 681 printf(_("* Seen redirect location %s\n"), location);
677 } 682 }
@@ -1480,7 +1485,9 @@ void print_help(void) {
1480 printf(" %s\n", _("Append a port to include it in the header (eg: example.com:5000)")); 1485 printf(" %s\n", _("Append a port to include it in the header (eg: example.com:5000)"));
1481 printf(" %s\n", "-I, --IP-address=ADDRESS"); 1486 printf(" %s\n", "-I, --IP-address=ADDRESS");
1482 printf(" %s\n", 1487 printf(" %s\n",
1483 _("IP address or name (use numeric address if possible to bypass DNS lookup).")); 1488 "IP address or name (use numeric address if possible to bypass DNS lookup).");
1489 printf(" %s\n",
1490 "This overwrites the network address of the target while leaving everything else (HTTP headers) as they are");
1484 printf(" %s\n", "-p, --port=INTEGER"); 1491 printf(" %s\n", "-p, --port=INTEGER");
1485 printf(" %s", _("Port number (default: ")); 1492 printf(" %s", _("Port number (default: "));
1486 printf("%d)\n", HTTP_PORT); 1493 printf("%d)\n", HTTP_PORT);
@@ -1544,6 +1551,7 @@ void print_help(void) {
1544 printf(" %s\n", _("String to expect in the content")); 1551 printf(" %s\n", _("String to expect in the content"));
1545 printf(" %s\n", "-u, --url=PATH"); 1552 printf(" %s\n", "-u, --url=PATH");
1546 printf(" %s\n", _("URL to GET or POST (default: /)")); 1553 printf(" %s\n", _("URL to GET or POST (default: /)"));
1554 printf(" %s\n", _("This is the part after the address in a URL, so for \"https://example.com/index.html\" it would be '-u /index.html'"));
1547 printf(" %s\n", "-P, --post=STRING"); 1555 printf(" %s\n", "-P, --post=STRING");
1548 printf(" %s\n", _("URL decoded http POST data")); 1556 printf(" %s\n", _("URL decoded http POST data"));
1549 printf(" %s\n", 1557 printf(" %s\n",
@@ -1556,7 +1564,7 @@ void print_help(void) {
1556 printf(" %s\n", _("Warn if document is more than SECONDS old. the number can also be of")); 1564 printf(" %s\n", _("Warn if document is more than SECONDS old. the number can also be of"));
1557 printf(" %s\n", _("the form \"10m\" for minutes, \"10h\" for hours, or \"10d\" for days.")); 1565 printf(" %s\n", _("the form \"10m\" for minutes, \"10h\" for hours, or \"10d\" for days."));
1558 printf(" %s\n", "-T, --content-type=STRING"); 1566 printf(" %s\n", "-T, --content-type=STRING");
1559 printf(" %s\n", _("specify Content-Type header media type when POSTing\n")); 1567 printf(" %s\n", _("specify Content-Type header media type when POSTing"));
1560 printf(" %s\n", "-l, --linespan"); 1568 printf(" %s\n", "-l, --linespan");
1561 printf(" %s\n", _("Allow regex to span newlines (must precede -r or -R)")); 1569 printf(" %s\n", _("Allow regex to span newlines (must precede -r or -R)"));
1562 printf(" %s\n", "-r, --regex, --ereg=STRING"); 1570 printf(" %s\n", "-r, --regex, --ereg=STRING");
@@ -1685,7 +1693,7 @@ void print_help(void) {
1685 printf(" %s\n", _("It is recommended to use an environment proxy like:")); 1693 printf(" %s\n", _("It is recommended to use an environment proxy like:"));
1686 printf(" %s\n", 1694 printf(" %s\n",
1687 _("https_proxy=http://192.168.100.35:3128 ./check_curl -H www.verisign.com -S")); 1695 _("https_proxy=http://192.168.100.35:3128 ./check_curl -H www.verisign.com -S"));
1688 printf(" %s\n", _("legacy proxy requests in check_http style still work:")); 1696 printf(" %s\n", _("legacy proxy requests in check_http style might still work, but are frowned upon, so DONT:"));
1689 printf(" %s\n", _("check_curl -I 192.168.100.35 -p 3128 -u https://www.verisign.com/ -S -j " 1697 printf(" %s\n", _("check_curl -I 192.168.100.35 -p 3128 -u https://www.verisign.com/ -S -j "
1690 "CONNECT -H www.verisign.com ")); 1698 "CONNECT -H www.verisign.com "));
1691 printf(" %s\n", _("all these options are needed: -I <proxy> -p <proxy-port> -u <check-url> " 1699 printf(" %s\n", _("all these options are needed: -I <proxy> -p <proxy-port> -u <check-url> "