From 00cb1408adf1725ee05c1fe928c9207b7acc235b Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 6 May 2017 19:39:59 +0200 Subject: fixed redirect sticky port handling in redir --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 617c4154..b8249aa7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ matrix: name: "monitoring-plugins/monitoring-plugins" description: "Monitoring Plugins" notification_email: team@monitoring-plugins.org - build_command_prepend: tools/setup && ./configure + build_command_prepend: tools/setup && ./configure --enable-check-curl build_command: make branch_pattern: coverity.* - compiler: "clang" @@ -55,6 +55,7 @@ install: - sudo apt-get install -qq --no-install-recommends autoconf automake - sudo apt-get install -qq --no-install-recommends faketime - sudo apt-get install -qq --no-install-recommends libmonitoring-plugin-perl + - sudo apt-get install -qq --no-install-recommends libcurl3-gnutls-dev # Trusty related dependencies (not yet provided) - test "$(dpkg -l | grep -E "mysql-(client|server)-[0-9].[0-9]" | grep -c ^ii)" -gt 0 || sudo apt-get install -qq --no-install-recommends mariadb-client mariadb-server # enable ssl apache -- cgit v1.2.3-74-g34f1 From e003353fe9b01299b45e50104403f48b47c2c752 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 6 May 2017 20:17:03 +0200 Subject: added check|_curl enabler in right position in configure in Travis script --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index b8249aa7..ef53b2d8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ matrix: name: "monitoring-plugins/monitoring-plugins" description: "Monitoring Plugins" notification_email: team@monitoring-plugins.org - build_command_prepend: tools/setup && ./configure --enable-check-curl + build_command_prepend: tools/setup && ./configure build_command: make branch_pattern: coverity.* - compiler: "clang" @@ -70,7 +70,7 @@ before_script: # Detect LDAP configuration (seems volatile on trusty env) - sed -e 's/cn=admin,dc=nodomain/'$(sudo /usr/sbin/slapcat|grep ^dn:|grep cn=|awk '{print $2}')'/' -i plugins/t/NPTest.cache.travis - tools/setup - - ./configure --enable-libtap + - ./configure --enable-libtap --enable-check-curl - make - export NPTEST_CACHE="$(pwd)/plugins/t/NPTest.cache.travis" - ssh-keygen -t dsa -N "" -f ~/.ssh/id_dsa -- cgit v1.2.3-74-g34f1 From 7eb43858db118b89d13eb71bf07b2c110edb258b Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 7 May 2017 07:55:44 +0000 Subject: fixed some printf bugs and switched to libcurl4-openssl for Travis tests --- .travis.yml | 2 +- plugins/check_curl.c | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index ef53b2d8..e725004f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,7 +55,7 @@ install: - sudo apt-get install -qq --no-install-recommends autoconf automake - sudo apt-get install -qq --no-install-recommends faketime - sudo apt-get install -qq --no-install-recommends libmonitoring-plugin-perl - - sudo apt-get install -qq --no-install-recommends libcurl3-gnutls-dev + - sudo apt-get install -qq --no-install-recommends libcurl4-openssl-dev # Trusty related dependencies (not yet provided) - test "$(dpkg -l | grep -E "mysql-(client|server)-[0-9].[0-9]" | grep -c ^ii)" -gt 0 || sudo apt-get install -qq --no-install-recommends mariadb-client mariadb-server # enable ssl apache diff --git a/plugins/check_curl.c b/plugins/check_curl.c index 3ae1c4d0..6856e781 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c @@ -711,14 +711,14 @@ GOT_FIRST_CERT: /* get status line of answer, check sanity of HTTP code */ if (curlhelp_parse_statusline (header_buf.buf, &status_line) < 0) { snprintf (msg, DEFAULT_BUFFER_SIZE, "Unparseable status line in %.3g seconds response time|%s\n", - code, total_time, perfstring); - die (STATE_CRITICAL, "HTTP CRITICAL HTTP/1.x %d unknown - %s", code, msg); + total_time, perfstring); + die (STATE_CRITICAL, "HTTP CRITICAL HTTP/1.x %ld unknown - %s", code, msg); } /* get result code from cURL */ handle_curl_option_return_code (curl_easy_getinfo (curl, CURLINFO_RESPONSE_CODE, &code), "CURLINFO_RESPONSE_CODE"); if (verbose>=2) - printf ("* curl CURLINFO_RESPONSE_CODE is %d\n", code); + printf ("* curl CURLINFO_RESPONSE_CODE is %ld\n", code); /* print status line, header, body if verbose */ if (verbose >= 2) { @@ -942,7 +942,7 @@ redir (curlhelp_write_curlbuf* header_buf) if (++redir_depth > max_depth) die (STATE_WARNING, - _("HTTP WARNING - maximum redirection depth %d exceeded - %s\n"), + _("HTTP WARNING - maximum redirection depth %d exceeded - %s%s\n"), max_depth, location, (display_html ? "" : "")); UriParserStateA state; @@ -1005,7 +1005,7 @@ redir (curlhelp_write_curlbuf* header_buf) } if (new_port > MAX_PORT) die (STATE_UNKNOWN, - _("HTTP UNKNOWN - Redirection to port above %d - %s\n"), + _("HTTP UNKNOWN - Redirection to port above %d - %s%s\n"), MAX_PORT, location, display_html ? "" : ""); /* by RFC 7231 relative URLs in Location should be taken relative to @@ -1239,7 +1239,8 @@ process_arguments (int argc, char **argv) http_method = strdup (optarg); break; case 'A': /* useragent */ - snprintf (user_agent, DEFAULT_BUFFER_SIZE, optarg); + strncpy (user_agent, optarg, DEFAULT_BUFFER_SIZE); + user_agent[DEFAULT_BUFFER_SIZE-1] = '\0'; break; case 'k': /* Additional headers */ if (http_opt_headers_count == 0) @@ -1524,7 +1525,7 @@ process_arguments (int argc, char **argv) if (critical_thresholds && thlds->critical->end>(double)socket_timeout) socket_timeout = (int)thlds->critical->end + 1; if (verbose >= 2) - printf ("* Socket timeout set to %d seconds\n", socket_timeout); + printf ("* Socket timeout set to %ld seconds\n", socket_timeout); if (http_method == NULL) http_method = strdup ("GET"); @@ -1722,7 +1723,7 @@ print_usage (void) printf (" [-e ] [-d string] [-s string] [-l] [-r | -R ]\n"); printf (" [-P string] [-m :] [-4|-6] [-N] [-M ]\n"); printf (" [-A string] [-k string] [-S ] [--sni] [-C [,]]\n"); - printf (" [-T ] [-j method]\n", progname); + printf (" [-T ] [-j method]\n"); printf ("\n"); printf ("%s\n", _("WARNING: check_curl is experimental. Please use")); printf ("%s\n\n", _("check_http if you need a stable version.")); @@ -1969,7 +1970,7 @@ check_document_dates (const curlhelp_write_curlbuf *header_buf, char (*msg)[DEFA time_t srv_data = curl_getdate (server_date, NULL); time_t doc_data = curl_getdate (document_date, NULL); if (verbose >= 2) - printf ("* server date: '%s' (%d), doc_date: '%s' (%d)\n", server_date, srv_data, document_date, doc_data); + printf ("* server date: '%s' (%d), doc_date: '%s' (%d)\n", server_date, (int)srv_data, document_date, (int)doc_data); if (srv_data <= 0) { snprintf (*msg, DEFAULT_BUFFER_SIZE, _("%sServer date \"%100s\" unparsable, "), *msg, server_date); date_result = max_state_alt(STATE_CRITICAL, date_result); -- cgit v1.2.3-74-g34f1 From 4ec057d89a406a3e40b9baf72d3df4c81637b7c8 Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Wed, 24 Oct 2018 10:00:39 +0200 Subject: travis: --enable-check-curl is no longer required --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index e725004f..e80b34e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,7 +70,7 @@ before_script: # Detect LDAP configuration (seems volatile on trusty env) - sed -e 's/cn=admin,dc=nodomain/'$(sudo /usr/sbin/slapcat|grep ^dn:|grep cn=|awk '{print $2}')'/' -i plugins/t/NPTest.cache.travis - tools/setup - - ./configure --enable-libtap --enable-check-curl + - ./configure --enable-libtap - make - export NPTEST_CACHE="$(pwd)/plugins/t/NPTest.cache.travis" - ssh-keygen -t dsa -N "" -f ~/.ssh/id_dsa -- cgit v1.2.3-74-g34f1 From b2f7eca374577b3982e6242376b812c0088ba7ef Mon Sep 17 00:00:00 2001 From: Sven Nierlein Date: Wed, 24 Oct 2018 10:09:02 +0200 Subject: check_curl: fix builds if curl is not enabled --- .travis.yml | 1 + configure.ac | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index e80b34e7..dc563560 100644 --- a/.travis.yml +++ b/.travis.yml @@ -56,6 +56,7 @@ install: - sudo apt-get install -qq --no-install-recommends faketime - sudo apt-get install -qq --no-install-recommends libmonitoring-plugin-perl - sudo apt-get install -qq --no-install-recommends libcurl4-openssl-dev + - sudo apt-get install -qq --no-install-recommends liburiparser-dev # Trusty related dependencies (not yet provided) - test "$(dpkg -l | grep -E "mysql-(client|server)-[0-9].[0-9]" | grep -c ^ii)" -gt 0 || sudo apt-get install -qq --no-install-recommends mariadb-client mariadb-server # enable ssl apache diff --git a/configure.ac b/configure.ac index 3b5ca6b9..d50e4e9a 100644 --- a/configure.ac +++ b/configure.ac @@ -420,8 +420,7 @@ if test x$_can_enable_check_curl = xyes; then EXTRAS="$EXTRAS check_curl\$(EXEEXT)" fi AM_CONDITIONAL([WITH_CHECK_CURL], [test "$_can_enable_check_curl" = "yes"]) -AM_COND_IF([WITH_CHECK_CURL], - [AC_CONFIG_FILES([plugins/picohttpparser/Makefile])]) +AC_CONFIG_FILES([plugins/picohttpparser/Makefile]) dnl Fallback to who(1) if the system doesn't provide an utmpx(5) interface if test "$ac_cv_header_utmpx_h" = "no" -a "$ac_cv_header_wtsapi32_h" = "no" -- cgit v1.2.3-74-g34f1