diff options
| -rw-r--r-- | lib/output.c | 2 | ||||
| -rw-r--r-- | plugins/check_curl.c | 35 | ||||
| -rw-r--r-- | plugins/check_curl.d/check_curl_helpers.c | 1 | ||||
| -rw-r--r-- | plugins/check_curl.d/config.h | 3 | ||||
| -rw-r--r-- | plugins/check_http.c | 25 | ||||
| -rw-r--r-- | plugins/check_load.c | 16 | ||||
| -rw-r--r-- | plugins/check_snmp.c | 6 | ||||
| -rw-r--r-- | plugins/t/check_curl.t | 29 |
8 files changed, 96 insertions, 21 deletions
diff --git a/lib/output.c b/lib/output.c index 54d505d9..3c04d63d 100644 --- a/lib/output.c +++ b/lib/output.c | |||
| @@ -420,7 +420,7 @@ static inline char *fmt_subcheck_output(mp_output_format output_format, mp_subch | |||
| 420 | // add the rest (if any) | 420 | // add the rest (if any) |
| 421 | if (have_residual_chars) { | 421 | if (have_residual_chars) { |
| 422 | char *tmp = check.output; | 422 | char *tmp = check.output; |
| 423 | xasprintf(&check.output, "%s\n%s%s", intermediate_string, | 423 | xasprintf(&check.output, "%s%s%s", intermediate_string, |
| 424 | generate_indentation_string(indentation + 1), tmp); | 424 | generate_indentation_string(indentation + 1), tmp); |
| 425 | } else { | 425 | } else { |
| 426 | check.output = intermediate_string; | 426 | check.output = intermediate_string; |
diff --git a/plugins/check_curl.c b/plugins/check_curl.c index 67d89129..3f44c86b 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c | |||
| @@ -273,9 +273,17 @@ mp_subcheck check_http(const check_curl_config config, check_curl_working_state | |||
| 273 | 273 | ||
| 274 | /* Curl errors, result in critical Nagios state */ | 274 | /* Curl errors, result in critical Nagios state */ |
| 275 | if (res != CURLE_OK) { | 275 | if (res != CURLE_OK) { |
| 276 | xasprintf(&sc_curl.output, _("Error while performing connection: cURL returned %d - %s"), | 276 | /* Custom handling for timeouts, state might be set to non CRITICAL */ |
| 277 | res, errbuf[0] ? errbuf : curl_easy_strerror(res)); | 277 | if (res == CURLE_OPERATION_TIMEDOUT) { |
| 278 | sc_curl = mp_set_subcheck_state(sc_curl, STATE_CRITICAL); | 278 | xasprintf(&sc_curl.output, _("cURL returned %d - %s"), res, |
| 279 | errbuf[0] ? errbuf : curl_easy_strerror(res)); | ||
| 280 | sc_curl = mp_set_subcheck_state(sc_curl, config.on_timeout_result_state); | ||
| 281 | } else { | ||
| 282 | xasprintf(&sc_curl.output, | ||
| 283 | _("Error while performing connection: cURL returned %d - %s"), res, | ||
| 284 | errbuf[0] ? errbuf : curl_easy_strerror(res)); | ||
| 285 | sc_curl = mp_set_subcheck_state(sc_curl, STATE_CRITICAL); | ||
| 286 | } | ||
| 279 | mp_add_subcheck_to_subcheck(&sc_result, sc_curl); | 287 | mp_add_subcheck_to_subcheck(&sc_result, sc_curl); |
| 280 | return sc_result; | 288 | return sc_result; |
| 281 | } | 289 | } |
| @@ -890,6 +898,7 @@ check_curl_config_wrapper process_arguments(int argc, char **argv) { | |||
| 890 | STATE_REGEX, | 898 | STATE_REGEX, |
| 891 | OUTPUT_FORMAT, | 899 | OUTPUT_FORMAT, |
| 892 | NO_PROXY, | 900 | NO_PROXY, |
| 901 | TIMEOUT_RESULT, | ||
| 893 | }; | 902 | }; |
| 894 | 903 | ||
| 895 | static struct option longopts[] = { | 904 | static struct option longopts[] = { |
| @@ -939,6 +948,7 @@ check_curl_config_wrapper process_arguments(int argc, char **argv) { | |||
| 939 | {"cookie-jar", required_argument, 0, COOKIE_JAR}, | 948 | {"cookie-jar", required_argument, 0, COOKIE_JAR}, |
| 940 | {"haproxy-protocol", no_argument, 0, HAPROXY_PROTOCOL}, | 949 | {"haproxy-protocol", no_argument, 0, HAPROXY_PROTOCOL}, |
| 941 | {"output-format", required_argument, 0, OUTPUT_FORMAT}, | 950 | {"output-format", required_argument, 0, OUTPUT_FORMAT}, |
| 951 | {"timeout-result", required_argument, 0, TIMEOUT_RESULT}, | ||
| 942 | {0, 0, 0, 0}}; | 952 | {0, 0, 0, 0}}; |
| 943 | 953 | ||
| 944 | check_curl_config_wrapper result = { | 954 | check_curl_config_wrapper result = { |
| @@ -1004,6 +1014,21 @@ check_curl_config_wrapper process_arguments(int argc, char **argv) { | |||
| 1004 | result.config.curl_config.socket_timeout = (int)strtol(optarg, NULL, 10); | 1014 | result.config.curl_config.socket_timeout = (int)strtol(optarg, NULL, 10); |
| 1005 | } | 1015 | } |
| 1006 | break; | 1016 | break; |
| 1017 | case TIMEOUT_RESULT: | ||
| 1018 | if (!strcmp(optarg, "0") || !strcasecmp(optarg, "ok")) { | ||
| 1019 | result.config.on_timeout_result_state = STATE_OK; | ||
| 1020 | } else if (!strcmp(optarg, "1") || !strcasecmp(optarg, "warning")) { | ||
| 1021 | result.config.on_timeout_result_state = STATE_WARNING; | ||
| 1022 | } else if (!strcmp(optarg, "2") || !strcasecmp(optarg, "critical")) { | ||
| 1023 | result.config.on_timeout_result_state = STATE_CRITICAL; | ||
| 1024 | } else if (!strcmp(optarg, "3") || !strcasecmp(optarg, "unknown")) { | ||
| 1025 | result.config.on_timeout_result_state = STATE_UNKNOWN; | ||
| 1026 | } else { | ||
| 1027 | usage2(_("Invalid timeout-result state option, give either a return code or state " | ||
| 1028 | "name in lowercase"), | ||
| 1029 | optarg); | ||
| 1030 | } | ||
| 1031 | break; | ||
| 1007 | case 'c': /* critical time threshold */ | 1032 | case 'c': /* critical time threshold */ |
| 1008 | { | 1033 | { |
| 1009 | mp_range_parsed critical_range = mp_parse_range_string(optarg); | 1034 | mp_range_parsed critical_range = mp_parse_range_string(optarg); |
| @@ -1701,6 +1726,10 @@ void print_help(void) { | |||
| 1701 | 1726 | ||
| 1702 | printf(UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); | 1727 | printf(UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); |
| 1703 | 1728 | ||
| 1729 | printf(" %s\n", "--timeout-result=ok|warning|critical|unknown|0|1|2|3"); | ||
| 1730 | printf(" %s\n", _("Timeouts default to returning STATE_CRITICAL.")); | ||
| 1731 | printf(" %s\n", _("This argument changes the return state on timeouts.")); | ||
| 1732 | |||
| 1704 | printf(UT_VERBOSE); | 1733 | printf(UT_VERBOSE); |
| 1705 | 1734 | ||
| 1706 | printf(UT_OUTPUT_FORMAT); | 1735 | printf(UT_OUTPUT_FORMAT); |
diff --git a/plugins/check_curl.d/check_curl_helpers.c b/plugins/check_curl.d/check_curl_helpers.c index 80d6f4f6..5b13a138 100644 --- a/plugins/check_curl.d/check_curl_helpers.c +++ b/plugins/check_curl.d/check_curl_helpers.c | |||
| @@ -755,6 +755,7 @@ check_curl_config check_curl_config_init(void) { | |||
| 755 | .header_expect = "", | 755 | .header_expect = "", |
| 756 | .on_redirect_result_state = STATE_OK, | 756 | .on_redirect_result_state = STATE_OK, |
| 757 | .on_redirect_dependent = false, | 757 | .on_redirect_dependent = false, |
| 758 | .on_timeout_result_state = STATE_CRITICAL, | ||
| 758 | 759 | ||
| 759 | .show_extended_perfdata = false, | 760 | .show_extended_perfdata = false, |
| 760 | .show_body = false, | 761 | .show_body = false, |
diff --git a/plugins/check_curl.d/config.h b/plugins/check_curl.d/config.h index bcdf3010..0a7fa01d 100644 --- a/plugins/check_curl.d/config.h +++ b/plugins/check_curl.d/config.h | |||
| @@ -113,9 +113,12 @@ typedef struct { | |||
| 113 | mp_state_enum on_redirect_result_state; | 113 | mp_state_enum on_redirect_result_state; |
| 114 | bool on_redirect_dependent; | 114 | bool on_redirect_dependent; |
| 115 | 115 | ||
| 116 | mp_state_enum on_timeout_result_state; | ||
| 117 | |||
| 116 | bool show_extended_perfdata; | 118 | bool show_extended_perfdata; |
| 117 | bool show_body; | 119 | bool show_body; |
| 118 | 120 | ||
| 121 | |||
| 119 | bool output_format_is_set; | 122 | bool output_format_is_set; |
| 120 | mp_output_format output_format; | 123 | mp_output_format output_format; |
| 121 | } check_curl_config; | 124 | } check_curl_config; |
diff --git a/plugins/check_http.c b/plugins/check_http.c index 71f94b91..73e4f3b6 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c | |||
| @@ -205,7 +205,8 @@ bool process_arguments(int argc, char **argv) { | |||
| 205 | SNI_OPTION, | 205 | SNI_OPTION, |
| 206 | MAX_REDIRS_OPTION, | 206 | MAX_REDIRS_OPTION, |
| 207 | CONTINUE_AFTER_CHECK_CERT, | 207 | CONTINUE_AFTER_CHECK_CERT, |
| 208 | STATE_REGEX | 208 | STATE_REGEX, |
| 209 | TIMEOUT_RESULT | ||
| 209 | }; | 210 | }; |
| 210 | 211 | ||
| 211 | int option = 0; | 212 | int option = 0; |
| @@ -247,6 +248,7 @@ bool process_arguments(int argc, char **argv) { | |||
| 247 | {"extended-perfdata", no_argument, 0, 'E'}, | 248 | {"extended-perfdata", no_argument, 0, 'E'}, |
| 248 | {"show-body", no_argument, 0, 'B'}, | 249 | {"show-body", no_argument, 0, 'B'}, |
| 249 | {"max-redirs", required_argument, 0, MAX_REDIRS_OPTION}, | 250 | {"max-redirs", required_argument, 0, MAX_REDIRS_OPTION}, |
| 251 | {"timeout-result", required_argument, 0, TIMEOUT_RESULT}, | ||
| 250 | {0, 0, 0, 0}}; | 252 | {0, 0, 0, 0}}; |
| 251 | 253 | ||
| 252 | if (argc < 2) { | 254 | if (argc < 2) { |
| @@ -298,6 +300,21 @@ bool process_arguments(int argc, char **argv) { | |||
| 298 | socket_timeout = atoi(optarg); | 300 | socket_timeout = atoi(optarg); |
| 299 | } | 301 | } |
| 300 | break; | 302 | break; |
| 303 | case TIMEOUT_RESULT: | ||
| 304 | if (!strcmp(optarg, "0") || !strcasecmp(optarg, "ok")) { | ||
| 305 | socket_timeout_state = STATE_OK; | ||
| 306 | } else if (!strcmp(optarg, "1") || !strcasecmp(optarg, "warning")) { | ||
| 307 | socket_timeout_state = STATE_WARNING; | ||
| 308 | } else if (!strcmp(optarg, "2") || !strcasecmp(optarg, "critical")) { | ||
| 309 | socket_timeout_state = STATE_CRITICAL; | ||
| 310 | } else if (!strcmp(optarg, "3") || !strcasecmp(optarg, "unknown")) { | ||
| 311 | socket_timeout_state = STATE_UNKNOWN; | ||
| 312 | } else { | ||
| 313 | usage2(_("Invalid timeout-result state option, give either a return code or state " | ||
| 314 | "name in lowercase"), | ||
| 315 | optarg); | ||
| 316 | } | ||
| 317 | break; | ||
| 301 | case 'c': /* critical time threshold */ | 318 | case 'c': /* critical time threshold */ |
| 302 | critical_thresholds = optarg; | 319 | critical_thresholds = optarg; |
| 303 | break; | 320 | break; |
| @@ -1032,7 +1049,7 @@ int check_http(void) { | |||
| 1032 | printf("SSL initialized\n"); | 1049 | printf("SSL initialized\n"); |
| 1033 | } | 1050 | } |
| 1034 | if (result != STATE_OK) { | 1051 | if (result != STATE_OK) { |
| 1035 | die(STATE_CRITICAL, _("HTTP CRITICAL - SSL error\n")); | 1052 | die(STATE_CRITICAL, _("HTTP CRITICAL - SSL error\n")); |
| 1036 | } | 1053 | } |
| 1037 | microsec_ssl = deltime(tv_temp); | 1054 | microsec_ssl = deltime(tv_temp); |
| 1038 | elapsed_time_ssl = (double)microsec_ssl / 1.0e6; | 1055 | elapsed_time_ssl = (double)microsec_ssl / 1.0e6; |
| @@ -1883,6 +1900,10 @@ void print_help(void) { | |||
| 1883 | 1900 | ||
| 1884 | printf(UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); | 1901 | printf(UT_CONN_TIMEOUT, DEFAULT_SOCKET_TIMEOUT); |
| 1885 | 1902 | ||
| 1903 | printf(" %s\n", "--timeout-result=ok|warning|critical|unknown|0|1|2|3"); | ||
| 1904 | printf(" %s\n", _("Timeouts default to returning STATE_CRITICAL.")); | ||
| 1905 | printf(" %s\n", _("This argument changes the return state on timeouts.")); | ||
| 1906 | |||
| 1886 | printf(UT_VERBOSE); | 1907 | printf(UT_VERBOSE); |
| 1887 | 1908 | ||
| 1888 | printf("\n"); | 1909 | printf("\n"); |
diff --git a/plugins/check_load.c b/plugins/check_load.c index 60fa646f..7995408e 100644 --- a/plugins/check_load.c +++ b/plugins/check_load.c | |||
| @@ -65,7 +65,7 @@ typedef struct { | |||
| 65 | int errorcode; | 65 | int errorcode; |
| 66 | char **top_processes; | 66 | char **top_processes; |
| 67 | } top_processes_result; | 67 | } top_processes_result; |
| 68 | static top_processes_result print_top_consuming_processes(unsigned long n_procs_to_show); | 68 | static top_processes_result get_top_consuming_processes(unsigned long n_procs_to_show); |
| 69 | 69 | ||
| 70 | typedef struct { | 70 | typedef struct { |
| 71 | mp_range load[3]; | 71 | mp_range load[3]; |
| @@ -158,7 +158,7 @@ int main(int argc, char **argv) { | |||
| 158 | 158 | ||
| 159 | mp_subcheck scaled_load_sc = mp_subcheck_init(); | 159 | mp_subcheck scaled_load_sc = mp_subcheck_init(); |
| 160 | scaled_load_sc = mp_set_subcheck_default_state(scaled_load_sc, STATE_OK); | 160 | scaled_load_sc = mp_set_subcheck_default_state(scaled_load_sc, STATE_OK); |
| 161 | scaled_load_sc.output = "Scaled Load (divided by number of CPUs"; | 161 | scaled_load_sc.output = "Scaled Load (divided by number of CPUs)"; |
| 162 | 162 | ||
| 163 | mp_perfdata pd_scaled_load1 = perfdata_init(); | 163 | mp_perfdata pd_scaled_load1 = perfdata_init(); |
| 164 | pd_scaled_load1.label = "scaled_load1"; | 164 | pd_scaled_load1.label = "scaled_load1"; |
| @@ -248,12 +248,13 @@ int main(int argc, char **argv) { | |||
| 248 | if (config.n_procs_to_show > 0) { | 248 | if (config.n_procs_to_show > 0) { |
| 249 | mp_subcheck top_proc_sc = mp_subcheck_init(); | 249 | mp_subcheck top_proc_sc = mp_subcheck_init(); |
| 250 | top_proc_sc = mp_set_subcheck_state(top_proc_sc, STATE_OK); | 250 | top_proc_sc = mp_set_subcheck_state(top_proc_sc, STATE_OK); |
| 251 | top_processes_result top_proc = print_top_consuming_processes(config.n_procs_to_show); | 251 | top_processes_result top_proc = get_top_consuming_processes(config.n_procs_to_show); |
| 252 | xasprintf(&top_proc_sc.output, "Top %lu CPU time consuming processes", | 252 | xasprintf(&top_proc_sc.output, "Top %lu CPU time consuming processes", |
| 253 | config.n_procs_to_show); | 253 | config.n_procs_to_show); |
| 254 | 254 | ||
| 255 | if (top_proc.errorcode == OK) { | 255 | if (top_proc.errorcode == OK) { |
| 256 | for (unsigned long i = 0; i < config.n_procs_to_show; i++) { | 256 | // +1 here since the string list contains the header line |
| 257 | for (unsigned long i = 0; i < config.n_procs_to_show +1; i++) { | ||
| 257 | xasprintf(&top_proc_sc.output, "%s\n%s", top_proc_sc.output, | 258 | xasprintf(&top_proc_sc.output, "%s\n%s", top_proc_sc.output, |
| 258 | top_proc.top_processes[i]); | 259 | top_proc.top_processes[i]); |
| 259 | } | 260 | } |
| @@ -286,11 +287,6 @@ static check_load_config_wrapper process_arguments(int argc, char **argv) { | |||
| 286 | .config = check_load_config_init(), | 287 | .config = check_load_config_init(), |
| 287 | }; | 288 | }; |
| 288 | 289 | ||
| 289 | if (argc < 2) { | ||
| 290 | result.errorcode = ERROR; | ||
| 291 | return result; | ||
| 292 | } | ||
| 293 | |||
| 294 | while (true) { | 290 | while (true) { |
| 295 | int option = 0; | 291 | int option = 0; |
| 296 | int option_index = getopt_long(argc, argv, "Vhrc:w:n:", longopts, &option); | 292 | int option_index = getopt_long(argc, argv, "Vhrc:w:n:", longopts, &option); |
| @@ -448,7 +444,7 @@ int cmpstringp(const void *p1, const void *p2) { | |||
| 448 | } | 444 | } |
| 449 | #endif /* PS_USES_PROCPCPU */ | 445 | #endif /* PS_USES_PROCPCPU */ |
| 450 | 446 | ||
| 451 | static top_processes_result print_top_consuming_processes(unsigned long n_procs_to_show) { | 447 | static top_processes_result get_top_consuming_processes(unsigned long n_procs_to_show) { |
| 452 | top_processes_result result = { | 448 | top_processes_result result = { |
| 453 | .errorcode = OK, | 449 | .errorcode = OK, |
| 454 | }; | 450 | }; |
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 0f62ce8b..09196dc4 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c | |||
| @@ -1034,13 +1034,13 @@ void print_help(void) { | |||
| 1034 | printf(" %s\n", _("SNMPv3 context")); | 1034 | printf(" %s\n", _("SNMPv3 context")); |
| 1035 | printf(" %s\n", "-L, --seclevel=[noAuthNoPriv|authNoPriv|authPriv]"); | 1035 | printf(" %s\n", "-L, --seclevel=[noAuthNoPriv|authNoPriv|authPriv]"); |
| 1036 | printf(" %s\n", _("SNMPv3 securityLevel")); | 1036 | printf(" %s\n", _("SNMPv3 securityLevel")); |
| 1037 | printf(" %s\n", "-a, --authproto=[MD5|SHA]"); | 1037 | printf(" %s\n", "-a, --authproto=[MD5|SHA|SHA224|SHA256|SHA384|SHA512]"); |
| 1038 | printf(" %s\n", _("SNMPv3 auth proto")); | 1038 | printf(" %s\n", _("SNMPv3 auth proto")); |
| 1039 | #ifdef HAVE_USM_DES_PRIV_PROTOCOL | 1039 | #ifdef HAVE_USM_DES_PRIV_PROTOCOL |
| 1040 | printf(" %s\n", "-x, --privproto=[DES|AES]"); | 1040 | printf(" %s\n", "-x, --privproto=[DES|AES|AES192|AES256]"); |
| 1041 | printf(" %s\n", _("SNMPv3 priv proto (default DES)")); | 1041 | printf(" %s\n", _("SNMPv3 priv proto (default DES)")); |
| 1042 | #else | 1042 | #else |
| 1043 | printf(" %s\n", "-x, --privproto=[AES]"); | 1043 | printf(" %s\n", "-x, --privproto=[AES|AES192|AES256]"); |
| 1044 | printf(" %s\n", _("SNMPv3 priv proto (default AES)")); | 1044 | printf(" %s\n", _("SNMPv3 priv proto (default AES)")); |
| 1045 | #endif | 1045 | #endif |
| 1046 | 1046 | ||
diff --git a/plugins/t/check_curl.t b/plugins/t/check_curl.t index 0f4d0de7..7ec8ca06 100644 --- a/plugins/t/check_curl.t +++ b/plugins/t/check_curl.t | |||
| @@ -13,7 +13,7 @@ use vars qw($tests $has_ipv6); | |||
| 13 | BEGIN { | 13 | BEGIN { |
| 14 | use NPTest; | 14 | use NPTest; |
| 15 | $has_ipv6 = NPTest::has_ipv6(); | 15 | $has_ipv6 = NPTest::has_ipv6(); |
| 16 | $tests = $has_ipv6 ? 57 : 92; | 16 | $tests = $has_ipv6 ? 65 : 100; |
| 17 | plan tests => $tests; | 17 | plan tests => $tests; |
| 18 | } | 18 | } |
| 19 | 19 | ||
| @@ -69,7 +69,32 @@ $res = NPTest->testCmd( | |||
| 69 | ); | 69 | ); |
| 70 | cmp_ok( $res->return_code, '==', 2, "Webserver $host_nonresponsive not responding" ); | 70 | cmp_ok( $res->return_code, '==', 2, "Webserver $host_nonresponsive not responding" ); |
| 71 | # was CRITICAL only, but both check_curl and check_http print HTTP CRITICAL (puzzle?!) | 71 | # was CRITICAL only, but both check_curl and check_http print HTTP CRITICAL (puzzle?!) |
| 72 | like( $res->output, "/cURL returned 28 - Connection timed out after/", "Output OK"); | 72 | like( $res->output, "/cURL returned 28 - (Connection|Operation) timed out after/", "Output OK"); |
| 73 | |||
| 74 | # timeout return results can be changed using --timeout-result option | ||
| 75 | $res = NPTest->testCmd( | ||
| 76 | "./$plugin $host_nonresponsive -wt 1 -ct 2 -t 3 --timeout-result ok" | ||
| 77 | ); | ||
| 78 | like( $res->output, "/cURL returned 28 - (Connection|Operation) timed out after/", "Output OK"); | ||
| 79 | cmp_ok( $res->return_code, "==", 0, "Return code is correct due argument: --timeout-result ok"); | ||
| 80 | |||
| 81 | $res = NPTest->testCmd( | ||
| 82 | "./$plugin $host_nonresponsive -wt 1 -ct 2 -t 3 --timeout-result warning" | ||
| 83 | ); | ||
| 84 | like( $res->output, "/cURL returned 28 - (Connection|Operation) timed out after/", "Output OK"); | ||
| 85 | cmp_ok( $res->return_code, "==", 1, "Return code is correct due argument: --timeout-result warning"); | ||
| 86 | |||
| 87 | $res = NPTest->testCmd( | ||
| 88 | "./$plugin $host_nonresponsive -wt 1 -ct 2 -t 3 --timeout-result 2" | ||
| 89 | ); | ||
| 90 | like( $res->output, "/cURL returned 28 - (Connection|Operation) timed out after/", "Output OK"); | ||
| 91 | cmp_ok( $res->return_code, "==", 2, "Return code is correct due argument: --timeout-result 2"); | ||
| 92 | |||
| 93 | $res = NPTest->testCmd( | ||
| 94 | "./$plugin $host_nonresponsive -wt 1 -ct 2 -t 3 --timeout-result 3" | ||
| 95 | ); | ||
| 96 | like( $res->output, "/cURL returned 28 - (Connection|Operation) timed out after/", "Output OK"); | ||
| 97 | cmp_ok( $res->return_code, "==", 3, "Return code is correct due argument: --timeout-result 3"); | ||
| 73 | 98 | ||
| 74 | $res = NPTest->testCmd( | 99 | $res = NPTest->testCmd( |
| 75 | "./$plugin $hostname_invalid -wt 1 -ct 2" | 100 | "./$plugin $hostname_invalid -wt 1 -ct 2" |
