diff options
author | Barak Shohat <barak@bazzisoft.com> | 2021-04-06 16:35:20 +0300 |
---|---|---|
committer | Jan Wagner <waja@cyconet.org> | 2021-04-10 13:43:12 +0200 |
commit | e7598ae6377659430f38a5360aeb09d8a26b8e1a (patch) | |
tree | 499240e424e56dfe3073d7290f42d0d44cb1a6b7 /plugins/t/check_curl.t | |
parent | 2bb6abb501cdcace5808fad89f1941f36c69fbf5 (diff) | |
download | monitoring-plugins-e7598ae6377659430f38a5360aeb09d8a26b8e1a.tar.gz |
Updated check_curl.c to display a specific human-readable error message where possible
Diffstat (limited to 'plugins/t/check_curl.t')
-rw-r--r-- | plugins/t/check_curl.t | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/t/check_curl.t b/plugins/t/check_curl.t index 4bff538a..cc65f037 100644 --- a/plugins/t/check_curl.t +++ b/plugins/t/check_curl.t | |||
@@ -46,7 +46,7 @@ $res = NPTest->testCmd( | |||
46 | ); | 46 | ); |
47 | cmp_ok( $res->return_code, '==', 2, "Webserver $host_nonresponsive not responding" ); | 47 | cmp_ok( $res->return_code, '==', 2, "Webserver $host_nonresponsive not responding" ); |
48 | # was CRITICAL only, but both check_curl and check_http print HTTP CRITICAL (puzzle?!) | 48 | # was CRITICAL only, but both check_curl and check_http print HTTP CRITICAL (puzzle?!) |
49 | cmp_ok( $res->output, 'eq', "HTTP CRITICAL - Invalid HTTP response received from host on port 80: cURL returned 28 - Timeout was reached", "Output OK"); | 49 | like( $res->output, "/HTTP CRITICAL - Invalid HTTP response received from host on port 80: cURL returned 28 - Connection timed out after/", "Output OK"); |
50 | 50 | ||
51 | $res = NPTest->testCmd( | 51 | $res = NPTest->testCmd( |
52 | "./$plugin $hostname_invalid -wt 1 -ct 2" | 52 | "./$plugin $hostname_invalid -wt 1 -ct 2" |
@@ -56,7 +56,7 @@ cmp_ok( $res->return_code, '==', 2, "Webserver $hostname_invalid not valid" ); | |||
56 | # On Debian, it is Name or service not known, on Darwin, it is No address associated with nodename | 56 | # On Debian, it is Name or service not known, on Darwin, it is No address associated with nodename |
57 | # Is also possible to get a socket timeout if DNS is not responding fast enough | 57 | # Is also possible to get a socket timeout if DNS is not responding fast enough |
58 | # cURL gives us consistent strings from it's own 'lib/strerror.c' | 58 | # cURL gives us consistent strings from it's own 'lib/strerror.c' |
59 | like( $res->output, "/cURL returned 6 - Couldn't resolve host name/", "Output OK"); | 59 | like( $res->output, "/cURL returned 6 - Could not resolve host:/", "Output OK"); |
60 | 60 | ||
61 | # host header checks | 61 | # host header checks |
62 | $res = NPTest->testCmd("./$plugin -v -H $host_tcp_http"); | 62 | $res = NPTest->testCmd("./$plugin -v -H $host_tcp_http"); |