summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Nierlein <sven@nierlein.de>2018-10-22 16:49:53 +0200
committerSven Nierlein <sven@nierlein.de>2018-10-22 16:49:53 +0200
commit61571ce854d777cda9d00c9b7424caf400573240 (patch)
tree8451294d5b4094b1757efc98a4f79c0a3322193a
parent7e9d9a56298ad27e7d68f19d46c6b60ce12a2759 (diff)
downloadmonitoring-plugins-61571ce854d777cda9d00c9b7424caf400573240.tar.gz
check_curl: use same page length in performance data and text output
-rw-r--r--plugins/check_curl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/check_curl.c b/plugins/check_curl.c
index 4b17b256..26be33c1 100644
--- a/plugins/check_curl.c
+++ b/plugins/check_curl.c
@@ -704,6 +704,7 @@ GOT_FIRST_CERT:
704 * performance data to the answer always 704 * performance data to the answer always
705 */ 705 */
706 handle_curl_option_return_code (curl_easy_getinfo (curl, CURLINFO_TOTAL_TIME, &total_time), "CURLINFO_TOTAL_TIME"); 706 handle_curl_option_return_code (curl_easy_getinfo (curl, CURLINFO_TOTAL_TIME, &total_time), "CURLINFO_TOTAL_TIME");
707 page_len = get_content_length(&header_buf, &body_buf);
707 if(show_extended_perfdata) { 708 if(show_extended_perfdata) {
708 handle_curl_option_return_code (curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME, &time_connect), "CURLINFO_CONNECT_TIME"); 709 handle_curl_option_return_code (curl_easy_getinfo(curl, CURLINFO_CONNECT_TIME, &time_connect), "CURLINFO_CONNECT_TIME");
709 handle_curl_option_return_code (curl_easy_getinfo(curl, CURLINFO_APPCONNECT_TIME, &time_appconnect), "CURLINFO_APPCONNECT_TIME"); 710 handle_curl_option_return_code (curl_easy_getinfo(curl, CURLINFO_APPCONNECT_TIME, &time_appconnect), "CURLINFO_APPCONNECT_TIME");
@@ -713,7 +714,7 @@ GOT_FIRST_CERT:
713 total_time, 714 total_time,
714 warning_thresholds != NULL ? (double)thlds->warning->end : 0.0, 715 warning_thresholds != NULL ? (double)thlds->warning->end : 0.0,
715 critical_thresholds != NULL ? (double)thlds->critical->end : 0.0, 716 critical_thresholds != NULL ? (double)thlds->critical->end : 0.0,
716 (int)body_buf.buflen, 717 page_len,
717 time_connect, 718 time_connect,
718 use_ssl == TRUE ? perfd_time_ssl(time_appconnect-time_connect) : "", 719 use_ssl == TRUE ? perfd_time_ssl(time_appconnect-time_connect) : "",
719 (time_headers - time_appconnect), 720 (time_headers - time_appconnect),
@@ -725,7 +726,7 @@ GOT_FIRST_CERT:
725 total_time, 726 total_time,
726 warning_thresholds != NULL ? (double)thlds->warning->end : 0.0, 727 warning_thresholds != NULL ? (double)thlds->warning->end : 0.0,
727 critical_thresholds != NULL ? (double)thlds->critical->end : 0.0, 728 critical_thresholds != NULL ? (double)thlds->critical->end : 0.0,
728 (int)body_buf.buflen); 729 page_len);
729 } 730 }
730 731
731 /* return a CRITICAL status if we couldn't read any data */ 732 /* return a CRITICAL status if we couldn't read any data */
@@ -867,7 +868,6 @@ GOT_FIRST_CERT:
867 } 868 }
868 869
869 /* make sure the page is of an appropriate size */ 870 /* make sure the page is of an appropriate size */
870 page_len = get_content_length(&header_buf, &body_buf);
871 if ((max_page_len > 0) && (page_len > max_page_len)) { 871 if ((max_page_len > 0) && (page_len > max_page_len)) {
872 snprintf (msg, DEFAULT_BUFFER_SIZE, _("%spage size %d too large, "), msg, page_len); 872 snprintf (msg, DEFAULT_BUFFER_SIZE, _("%spage size %d too large, "), msg, page_len);
873 result = max_state_alt(STATE_WARNING, result); 873 result = max_state_alt(STATE_WARNING, result);
@@ -1866,7 +1866,7 @@ curlhelp_parse_statusline (const char *buf, curlhelp_statusline *status_line)
1866 char *pp; 1866 char *pp;
1867 const char *start; 1867 const char *start;
1868 char *first_line_buf; 1868 char *first_line_buf;
1869 1869
1870 /* find last start of a new header */ 1870 /* find last start of a new header */
1871 start = strrstr2 (buf, "\r\nHTTP"); 1871 start = strrstr2 (buf, "\r\nHTTP");
1872 if (start != NULL) { 1872 if (start != NULL) {
@@ -1925,7 +1925,7 @@ curlhelp_parse_statusline (const char *buf, curlhelp_statusline *status_line)
1925 if( p == NULL ) { status_line->msg = ""; return 0; } 1925 if( p == NULL ) { status_line->msg = ""; return 0; }
1926 status_line->msg = status_line->first_line + ( p - first_line_buf ); 1926 status_line->msg = status_line->first_line + ( p - first_line_buf );
1927 free( first_line_buf ); 1927 free( first_line_buf );
1928 1928
1929 return 0; 1929 return 0;
1930} 1930}
1931 1931