Commit graph

1957 commits

Author SHA1 Message Date
Sven Nierlein
1033724797
Merge pull request #1668 from bazzisoft/master
Update check_curl.c to display a specific human-readable error message where possible
2021-04-07 11:49:10 +02:00
Barak Shohat
2482950e26 Updated check_curl.c to display a specific human-readable error message where possible 2021-04-07 12:36:55 +03:00
Sven Nierlein
2e5b38cc83
Merge pull request #1666 from sni/check_curl_fix_header_parser
fix check_curl crash if http header contains leading spaces
2021-04-07 10:30:31 +02:00
Sven Nierlein
b820725ee1
Merge pull request #1644 from ghciv6/check_mysql_query_1562
- fix for issue #1562
2021-04-07 09:25:15 +02:00
Sven Nierlein
5cfc93d995 fix check_curl crash if http header contains leading spaces
check_curl crashes when a (broken) http server returns invalid http header with
leading spaces or double colons. This PR adds a fix and a test case for this.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2021-03-11 13:33:16 +01:00
Andreas Baumann
0f926a3566 check_curl: added string_statuscode function for printing HTTP/1.1 and HTTP/2 correctly 2021-03-08 19:46:43 +01:00
Florian Lohoff
dae075e65a Using snprintf which honors the buffers size and guarantees null termination. (Closes: #1601)
As strcpy may overflow the resulting buffer:

flo@p5:~$ /tmp/f/usr/lib/nagios/plugins/check_pgsql -d "$(seq 1 10000)"
*** buffer overflow detected ***: terminated
Aborted

I would propose to change the code rather like this, using snprintf
which honors the buffers size and guarantees null termination.
2021-02-15 15:34:07 +01:00
Andreas Baumann
a260c798de Merge branch 'master' into feature_check_curl 2021-02-08 20:13:47 +01:00
Andreas Baumann
d9a5d1faf0 check_curl: fixed a potential buffer overflow in url buffer 2021-01-19 18:35:41 +01:00
Andreas Baumann
ede8defad4 check_curl: fixed help, usage and errors for TLS 1.3 2021-01-19 18:32:27 +01:00
Wolfgang Karall-Ahlborn
9076ea36f7 check_procs -- update test data too 2021-01-03 12:18:31 +01:00
Wolfgang Karall-Ahlborn
8eaccee190 check_procs -- exchange needle and haystack in strstr() for proper state match 2021-01-03 11:27:44 +01:00
Rolf Eike Beer
ad99755033
check_dns: split multiple IP addresses passed in one -a argument 2020-11-02 20:05:56 +01:00
Sven Nierlein
739a7bbe7c
Merge pull request #1514 from Rasp8e/master
Proxy authorization is now kept when using PROXY + CONNECT to HTTPS
2020-09-23 17:19:23 +02:00
ghciv6
b8b87b55d6 - fix for issue #1562
1st compare then free up resources
2020-09-15 21:36:27 +02:00
mdavranche
11af74de38 check_swap: Handle cached swap 2020-08-18 15:37:38 -04:00
ghciv6
905b09c38b detect unreachable dns service in nslookup output (from bind-utils-9.8.2)
prevent core if error_scan detects an error in a line without ':'
2020-05-20 23:02:42 +02:00
Sven Nierlein
772fb233b9 check_curl: host_name may be null
for example when using like: ./check_curl localhost
2020-05-18 14:08:45 +02:00
Sven Nierlein
7d2582deb3 update test parameter according to check_http 2020-05-18 14:08:27 +02:00
Sven Nierlein
84fd9ae893 check_curl: use CURLOPT_RESOLVE to fix connecting to the right ip
when using ssl, the composed url contains the hostname instead of the specified
ip. So use CURLOPT_RESOLVE to make curl still connect to the ip.
2020-05-18 13:43:17 +02:00
Sven Nierlein
8a64e47083 check_curl: clean trailing whitespace 2020-05-18 11:30:34 +02:00
Sven Nierlein
d54f14a092 merge test changes from check_http
the example certificate has changed since.
2020-05-15 14:24:18 +02:00
Sven Nierlein
072e97d5de tests: update expired test certificate
the certificate used to test expired http checks is to old to be used
with recent ssl libraries and results in:

> SSL routines:SSL_CTX_use_certificate:ee key too small

unfortunatly the error is only visible when setting $IO::Socket::SSL::DEBUG in
the check_http.t file.
2020-05-15 14:24:18 +02:00
Andreas Baumann
adb9588494 Merge branch 'master' into feature_check_curl 2020-01-09 14:54:12 +01:00
Alexander A. Klimov
f53ea7afd8 check_tcp: add --sni 2020-01-07 21:32:15 +01:00
Christian Tacke
9da7cd7681 Fix timeout_interval declarations
There are different declarations for timeout_interval:

lib/utils_base.c has the definition:
	unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT;
lib/utils_base.h has the appropiate declaration:
	extern unsigned int timeout_interval;

plugins/popen.h has an extra declaration:
	extern unsigned int timeout_interval;
This doesn't hurt, but it's a dupe. The one in utils_base.h
should be enough, so remove this one.

plugins/popen.c has a WRONG one:
	extern int timeout_interval;
Remove it!
Use #include "utils.h" to get the right one.
This makes the local defines for max/min unnecassary, so
remove them also.
2020-01-07 10:22:39 +01:00
Andreas Baumann
5e0c236d6a increased copyright 2019-12-29 10:23:02 +00:00
Andreas Baumann
1b689dab5e check_curl: NSS, parse more date formats from certificate (in -C cert check) 2019-11-07 15:31:52 +00:00
Andreas Baumann
f7efee5f9c check_curl: more tolerant CN= parsing when checking certificates (hit on Centos 8) 2019-11-07 08:20:17 +00:00
Andreas Baumann
ede43c848d setting no_body to TRUE when we have a HEAD request 2019-10-11 17:22:34 +02:00
Andreas Baumann
04c58e0210 some LIBCURL_VERSION checks around HTTP/2 feature 2019-09-07 16:06:17 +02:00
Andreas Baumann
f546041722 added --http-version option to check_curl to choose HTTP version 2019-09-07 15:58:09 +02:00
Andreas Baumann
95ee6ace09 improved curlhelp_parse_statusline to handle both HTTP/1.x and HTTP/2 2019-09-07 15:31:15 +02:00
Andreas Baumann
fe91deb40c check_curl: updates embedded picohttpparser to newest git version 2019-09-07 14:22:00 +02:00
Andreas Baumann
4d666514f2 setting progname of check_curl plugin to check_curl (at least for now) 2019-09-07 11:20:13 +02:00
Andreas Baumann
34cc70c3c6 Merge branch 'master' into feature_check_curl 2019-07-18 08:40:35 +02:00
Sven Nierlein
e8325b39c4 fix maxfd being zero
If _SC_OPEN_MAX is available then maxfd was zero initialized and never set to the value from sysconf.
This leads to segfaults with free(): invalid size introduced by commit 7cafb0e845.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2019-05-24 14:51:10 +02:00
Christopher Odenbach
a15d425598 include -P switch in help 2019-04-09 09:49:57 +02:00
Andreas Baumann
2f4d6764d7 Merge branch 'master' into feature_check_curl 2019-04-04 13:09:15 +02:00
Sven Nierlein
5f16ba81c4
Merge pull request #1491 from odenbach/no_swap
check_swap: repaired "-n" behaviour
2019-03-28 16:55:22 +01:00
Sven Nierlein
71582d8bf9
Merge pull request #1586 from computersalat/master
improve command examples for 'at least' processes
2019-03-21 17:43:55 +01:00
ChrisWi
a58ea5ec5d improve command examples for 'at least' processes 2019-03-21 14:18:37 +01:00
Robin Sonefors
2bc4cc99d2 check_mysql: Allow sockets to be specified to -H
The help text says that -H accepts a "unix socket (must be an absolute
path)". Now that actually corresponds to reality.

Signed-off-by: Robin Sonefors <robin.sonefors@op5.com>
2019-03-21 13:54:19 +01:00
Sven Nierlein
97bb142b14
Merge pull request #1506 from sanchezfauste/check_apt_parameters
Adding packages-warning option to check_apt plugin
2019-02-19 22:10:07 +01:00
Sven Nierlein
af8e68d140
Merge pull request #1507 from sanchezfauste/check_load_print_top_procs
Adding print top consuming processes option to check_load
2019-02-19 22:08:04 +01:00
Sven Nierlein
e5823c7ae4
Merge pull request #1527 from m-kraus/master
check_snmp: make calcualtion of timeout value in help output more clear
2019-02-19 21:58:03 +01:00
Sven Nierlein
555559fd30
Merge pull request #1567 from vdanjean/master
[check_disk] add support to display inodes usage in perfdata
2019-02-19 21:49:13 +01:00
Sven Nierlein
931ed78b5d
Merge pull request #1583 from sni/fix_check_by_ssh_timeout_child_leak
check_by_ssh: fix child process leak on timeouts
2019-02-19 21:42:02 +01:00
Sven Nierlein
8442ed5b41 renew test certificates
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2019-02-19 16:35:28 +01:00
Rolf Eike Beer
763eb740b3 check_dns: fix typo in parameter description 2019-02-15 17:31:29 +01:00
Sven Nierlein
7cafb0e845 check_by_ssh: fix child process leak on timeouts
When check_by_ssh runs into a timeout it simply exits keeping all child processes running.
Simply adopting the kill loop from runcmd_timeout_alarm_handler() fixes this.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2019-02-15 10:36:28 +01:00
Sven Nierlein
2962148d8b
Merge pull request #1582 from towolf/show_body_for_http_expect_case
Also support the --show-body/-B flag when --expect is used
2019-02-15 09:02:43 +01:00
Sven Nierlein
8f1d3de0b7
Merge pull request #1545 from DerDakon/dns_order
check_dns: improve support for checking multiple addresses
2019-02-15 09:00:45 +01:00
Tobias Wolf
f7f0f7d467 Also support the --show-body/-B flag when --expect is used 2019-02-12 13:01:23 +01:00
Jan Wagner
2dcfbbcad0 travis-ci: Use RSA keys for SSH tests 2019-02-04 14:24:29 +01:00
Sven Nierlein
22f47fc0c5 tests: make check_snmp test more reliable
The check_snmp rate tests depend on the exact amount of time spend between the
plugin runs and will fail on busy machines, ex. the ci servers. Using faketime
mitigates this issue and also removes all the sleeps.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2019-01-21 17:41:02 +01:00
Iustin Pop
8520c643dd Simply initializes n before it is used
When SSL is enabled, n is assigned the size of the server's second EHLO
response (I think in bytes), which will usually be significantly higher
than the command passed. As such, no commands are executed and no responses
are checked, which - silently - defeats the desired checks and results in a
success value.
2019-01-18 22:52:54 +01:00
Kostyantyn Hushchyn
f79f016238 check_hpjd: Added -D option to disable warning on 'out of paper'
Signed-off-by: Kostyantyn Hushchyn <kgushtin@op5.com>
2019-01-04 15:01:28 +01:00
Vincent Danjean
270e7cba38 [check_disk] add support to display inodes usage in perfdata
This is not enabled by default
It can be enabled with the -P (--iperfdata) option
2018-12-08 22:44:42 +01:00
Sven Nierlein
ac6f101f05
Merge pull request #1564 from jacobbaungard/check_cluster_arg_validation
check_cluster.c: Added data argument validation.
2018-12-07 17:35:58 +01:00
Tomas Mozes
0a58acc705
plugins: check_http: Increase regexp limit 2018-12-05 12:50:53 +01:00
Sven Nierlein
d7dcca22ae tests: rework test parameters
there were 2 variants of calling getTestParameter:

    - parameter, description, default value
    - parameter, env value, default value, description, scope

While scope was never actually used and having 2 names for the same value led
to having 2 different entries in the cache file for the same configuration.

This commit removes the variants and simplifies tests parameters by only using
the first 3 parameter variant.
2018-12-04 15:20:19 +01:00
Kostyantyn Hushchyn
910894a4e2 check_cluster.c: Added data argument validation.
Signed-off-by: Kostyantyn Hushchyn <kgushtin@op5.com>
2018-11-29 16:37:59 +01:00
Andreas Baumann
faea5899ba set hostname in for CURLOPT_CURL to virtual hostname in case of SSL (for SNI to work) 2018-11-12 10:25:08 -05:00
Tobias Wolf
9966ebcd84 Add new flag --show-body/-B to print body
This should help with figuring out ia problem at a glance when enabled for
healthz endpoints on web APIs, for example.

The content of the body can point to what the problem is and help with
diagnostics.

Fixes #1559
2018-11-09 23:48:56 +01:00
Markus Frosch
198611a3c2 test: Add proxy tests via proxy
On Travis with a local squid
2018-11-06 12:33:24 +01:00
Markus Frosch
d659f8d99f Allow user to specify HTTP method after proxy CONNECT
Simple format, avoids refactoring the CONNECT feature.
2018-11-06 11:32:27 +01:00
Sven Nierlein
36fd675fbe check_curl: code cleanup
CURLOPT_RESOLVE is not required, since we do not verify certificates in any way.
2018-10-29 15:09:57 +01:00
Sven Nierlein
70d36a729e check_curl: rewrite connect_to / host headers
since CURLOPT_CONNECT_TO is only available in later curl versions, we do it the other way round now and
set the url from the address we want to connect to and then set the host header accordingly.
2018-10-25 10:35:06 +02:00
Sven Nierlein
ec590af49f check_curl: code cleanup 2018-10-24 13:36:47 +02:00
Sven Nierlein
87065ac448 check_curl: handle supplied port correctly
if a port was given by -p, it should not be overruled by the port extracted from -H.
2018-10-24 12:13:26 +02:00
Sven Nierlein
7061a76f89 builds: alway put picohttpparser into the dist tarball
substituting PICOHTTPPARSER_DIR only when curl gets build, leads
to different dist tarballs depending on wether libcurl was available
or not. This then breaks later builds from this tarball because of
the missing files.
2018-10-24 09:54:20 +02:00
Sven Nierlein
fd588dd2fa picohttpparser: add header to final tarball 2018-10-23 11:35:14 +02:00
Sven Nierlein
0958ce4b82 check_curl: unify performance data
and align them with check_http
2018-10-22 17:53:31 +02:00
Sven Nierlein
61571ce854 check_curl: use same page length in performance data and text output 2018-10-22 16:49:53 +02:00
Christopher Odenbach
7e9d9a5629 added some advanced tests for check_curl 2018-10-22 16:30:31 +02:00
Christopher Odenbach
347e749a0a Modified virtual host and port behaviour to match check_http. 2018-10-22 16:30:31 +02:00
Andreas Baumann
36ea82ff12 check_curl: changed name of plugin in user-agent and added curl_version() to it 2018-10-22 16:30:31 +02:00
Andreas Baumann
577edf4725 check_curl: removed some dead code 2018-10-22 16:30:31 +02:00
Andreas Baumann
5811729632 check_curl: removed die in redirect with relative paths, simple cases (same protocol, same host) actually work 2018-10-22 16:30:31 +02:00
Andreas Baumann
aa3b63215c ..I should really not test in test code :-) 2018-10-22 16:30:31 +02:00
Andreas Baumann
bd7fe411d5 check_curl: made HTTP message optional 2018-10-22 16:30:31 +02:00
Jean-François Rameau
30bb78e681 Avoid working with free'ed memory 2018-10-22 16:30:31 +02:00
Andreas Baumann
92bab06a45 fixed typo in check_curl error message (unparsable) 2018-10-22 16:30:31 +02:00
Andreas Baumann
d6491ba403 removed embedded uriparser library, added --with-uriparser configure option
to use uriparser library from the system
2018-10-22 16:30:31 +02:00
Andreas Baumann
46c5b54254 bumped coyright to 2018 in check_curl.c 2018-10-22 16:30:31 +02:00
Andreas Baumann
c5cd0e4912 updated bundled version of uriparser to 0.8.5 2018-10-22 16:30:31 +02:00
Andreas Baumann
7dd0a31b28 fixed initialization of server_url (freeing non-pointer in case of redirects) 2018-10-22 16:30:31 +02:00
Sven Nierlein
5368e24616 check_curl: cleanup
- remove obsolete todos
 - change exit code to unknown if regex exectute fails

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2018-10-22 16:30:31 +02:00
Andreas Baumann
8120c53f90 set ssl_version to CURL_SSLVERSION_DEFAULT and not CURL_SSLVERSION_TLSv1_0
(since curl 7.56.1 we get an illegal argument error otherwise)
2018-10-22 16:30:31 +02:00
Andreas Baumann
8a5b49ec36 added -b <proxy_auth> to print_usage 2018-10-22 16:30:31 +02:00
Sven Nierlein
7ad8bcba5b check_curl: add proxy auth option 2018-10-22 16:30:31 +02:00
Sven Nierlein
8172fe7f30 check_curl: update docs 2018-10-22 16:30:31 +02:00
Sven Nierlein
603dd23d11 check_curl: add legacy http request support 2018-10-22 16:30:31 +02:00
Sven Nierlein
e09629ef65 check_curl: add docs about https proxy 2018-10-22 16:30:31 +02:00
Sven Nierlein
7344524655 check_curl: clean whitespace 2018-10-22 16:30:31 +02:00
Sven Nierlein
787e6986ee check_curl: handle proxied https requests 2018-10-22 16:30:31 +02:00
Andreas Baumann
7eb43858db fixed some printf bugs and switched to libcurl4-openssl for Travis tests 2018-10-22 16:30:31 +02:00
Andreas Baumann
2f3eb33b86 fixed include flags for liburiparser 2018-10-22 16:30:31 +02:00
Andreas Baumann
00cb1408ad fixed redirect sticky port handling in redir 2018-10-22 16:30:31 +02:00
Andreas Baumann
a739a56148 some rework:
- added old style 'redir' function and options along to a new
  libcurl internal 'follow' parameter 'curl'
- moved picohttpparser to it's own subdirectory
- added uriparser to be used instead of the home-grown parser in
  'redir'
2018-10-22 16:30:31 +02:00
Andreas Baumann
28a4c7076a synched tests/check_http.t test changes (virtualhost) into tests/check_curl.t 2018-10-22 16:30:31 +02:00
Andreas Baumann
f0cebd5153 fixed failing tests due to wrong content_length calculation 2018-10-22 16:30:31 +02:00
Andreas Baumann
94d017c5ab fixed getopt (-l missing, wrong order, hard to compare with check_http.c) 2018-10-22 16:30:31 +02:00
Andreas Baumann
6bc2646409 more tolerant CERTINFO parsing 2018-10-22 16:30:31 +02:00
Andreas Baumann
4b66d3d90a using CURLOPT_RESOLVE to make sure -I is the IP we connect to 2018-10-22 16:30:31 +02:00
Andreas Baumann
efa7e2c1e7 changed URL construction again, IP should preceed hostname, hostname set as Host: (makes sure we get the corrent DNS entry and server) 2018-10-22 16:30:31 +02:00
Andreas Baumann
5d9104f07f page length is computed from header, fallback to actual body size (get_content_length) 2018-10-22 16:30:31 +02:00
Andreas Baumann
cfb7dace54 fixed setting host_name or server_address in curl URL option 2018-10-22 16:30:31 +02:00
Andreas Baumann
ac08e9b275 reverted hostname in URL, must use CURL_RESOLVE mayabe 2018-10-22 16:30:31 +02:00
Andreas Baumann
7c74b772ed must use host_name and not server_address in URL, CN subject mismatch 2018-10-22 16:30:31 +02:00
Andreas Baumann
f91be546bf disable non-OpenSSL code compilation in -C check if we have USE_OPENSSL set 2018-10-22 16:30:31 +02:00
Andreas Baumann
82744e9705 made non-OpenSSL version of certificate -C check work 2018-10-22 16:30:31 +02:00
Andreas Baumann
229b9e53e1 handling the -C check now when compiled with OpenSSL but libcurl is not compiled with OpenSSL 2018-10-22 16:30:31 +02:00
Andreas Baumann
2da7575196 preparing for certificate checks (non-OpenSSL version) 2018-10-22 16:30:31 +02:00
Andreas Baumann
f4a7a3b3e7 small cleanup 2018-10-22 16:30:31 +02:00
Andreas Baumann
c0be97f154 probing for SSL library used by libcurl and started improving the certificate check -C 2018-10-22 16:30:31 +02:00
Andreas Baumann
995ab6572f using curl_getdate instead of local parse_time_string, added verbose debug code for -M<d> 2018-10-22 16:30:31 +02:00
Andreas Baumann
e65cf6a32f small fixes and cleanups around SSL, be more tolerant to -S<x> options 2018-10-22 16:30:31 +02:00
Andreas Baumann
f99b9352d4 for now we set LIBCURL_USES_OPENSSL always 2018-10-22 16:30:31 +02:00
Andreas Baumann
260291c08b made check_curl compile also if we have openssl disabled 2018-10-22 16:30:31 +02:00
Andreas Baumann
88f566adf5 fixed some libcurl checks and minimal versions 2018-10-22 16:30:31 +02:00
Andreas Baumann
55e8d89b0a some work on certificate checking for non-OpenSSL libraries 2018-10-22 16:30:31 +02:00
Andreas Baumann
cee5f2777d small fix and we see CURLOPT_SSL_CTX_FUNCTION does not work on Centos 6? 2018-10-22 16:30:31 +02:00
Andreas Baumann
304e04a384 some cleanup and added error handling around curl_easy_getinfo/curl_easy_setopt 2018-10-22 16:30:31 +02:00
Andreas Baumann
54c8f76c72 fixed test outputs for status line checks
handling empty data in POST and PUT
handling data upload (from -P <postdata>) also in PUT
2018-10-22 16:30:31 +02:00
Andreas Baumann
3c681a2ec5 added -n and more display_html stuff 2018-10-22 16:30:31 +02:00
Andreas Baumann
f4a49a8b34 added -L option 2018-10-22 16:30:31 +02:00
Andreas Baumann
d5d71dde61 fixed non-C99-ism in get_header_value 2018-10-22 16:30:31 +02:00
Andreas Baumann
9960c56e5e added -M<m> age option for document age, using picohttpparser from h2o (maybe handy
later to make a more robust header condition checker?)
2018-10-22 16:30:31 +02:00
Andreas Baumann
bbec77c7ec made check_curl tests copies of check_http tests because they will differ slightly 2018-10-22 16:30:31 +02:00
Andreas Baumann
f890d271fd added POST support (-P/-T options) 2018-10-22 16:30:31 +02:00
Andreas Baumann
3299fbe3c1 fixed handling of SSL/TLS protocol versions 2018-10-22 16:30:31 +02:00
Andreas Baumann
6575340888 added -l option, fixed some usage/help 2018-10-22 16:30:31 +02:00
Andreas Baumann
f67f05c450 added -d/--header-string option 2018-10-22 16:30:31 +02:00
Sven Nierlein
c6c90a5bfa check_curl: implement -e/--expect 2018-10-22 16:30:31 +02:00
Sven Nierlein
a793540bbb check_curl: support check_http arguments for backwards compatibility 2018-10-22 16:30:31 +02:00
Sven Nierlein
5f9e8fa1e7 check_curl: adopt output format from check_http 2018-10-22 16:30:31 +02:00
Sven Nierlein
e9239b556a check_curl: make check_curl use the same tests as check_http 2018-10-22 16:30:31 +02:00
Andreas Baumann
dee8f760d3 added -4/-6 option 2018-10-22 16:28:51 +02:00
Andreas Baumann
a478dfe512 added -m/--pagesize option 2018-10-22 16:28:51 +02:00
Andreas Baumann
6e52b870f6 added help for --invert-regex 2018-10-22 16:28:51 +02:00
Andreas Baumann
2678d7fabc added -R/-ereg/-eregi 2018-10-22 16:28:51 +02:00
Andreas Baumann
50577bf9b1 added -N/--no-body option 2018-10-22 16:28:51 +02:00
Andreas Baumann
ec8de89a44 added usage and help for -E/--extended-perfdata 2018-10-22 16:28:51 +02:00
Andreas Baumann
4dc982097e reverted double header in longopts 2018-10-22 16:28:51 +02:00
Andreas Baumann
5d2fa85f1e added help/usage and getopt long struct member for -k/--header option 2018-10-22 16:28:51 +02:00
Andreas Baumann
20fd1ade91 fixed a missing else before curl_easy_setopt CURLOPT_CUSTOMREQUEST 2018-10-22 16:28:51 +02:00
Sven Nierlein
afa52eb834 add check_curl test
just a copy of check_http for now...

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2018-10-22 16:28:51 +02:00
Sven Nierlein
e57c8a9d96 check_curl: set correct host header
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2018-10-22 16:28:51 +02:00
Sven Nierlein
b5fd0d1a17 check_curl: implement extended performance data
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2018-10-22 16:28:51 +02:00
Sven Nierlein
16121a9b55 check_curl: implement certificate checks
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2018-10-22 16:28:51 +02:00
Sven Nierlein
c6c4890702 check_curl: implement optional http headers
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2018-10-22 16:28:51 +02:00
Andreas Baumann
d74e9569b9 added HTTP method handling 2018-10-22 16:28:51 +02:00
Andreas Baumann
83ae37dc7e forgot declaration of INVERT_REGEX in getopt otions 2018-10-22 16:28:51 +02:00
Andreas Baumann
c9a94ffd44 added some casts for curl write functions 2018-10-22 16:28:51 +02:00
Andreas Baumann
ad9233ce1c added -r and --invert-regex 2018-10-22 16:28:51 +02:00
Andreas Baumann
556924316a added -ca-file option 2018-10-22 16:28:51 +02:00
Andreas Baumann
035fe1eb79 handling last HTTP header correctly in HTTP line parser (added a strrstr replacement) 2018-10-22 16:28:51 +02:00
Andreas Baumann
cefe325e94 some comment cleanup 2018-10-22 16:28:51 +02:00
Andreas Baumann
2b8f17e577 adapted to style, using header file shims instead of HAVE_XXX by hand 2018-10-22 16:28:51 +02:00
Andreas Baumann
c3bf9bd675 fixed curl error message 2018-10-22 16:28:51 +02:00
Andreas Baumann
67967df159 added -s option 2018-10-22 16:28:51 +02:00
Andreas Baumann
2a9812ee43 added most options from nagios-curl-plugin 2018-10-22 16:28:51 +02:00
Andreas Baumann
0b85260bd2 added autoconf stuff for curl plugin, created empty plugin 2018-10-22 16:28:51 +02:00
Stefan Bethke
22c00bbe47 Docs check_http: make -C obvious
You need to read the docs carefully to realize that check_http has two 
modes of operation: the regular HTTP checks, and a TLS certificate 
check. Only one of these can be run in a single invocation.

Fixes #1553
2018-10-10 00:40:07 +02:00
Rolf Eike Beer
fd9a7d2e00 check_dns: allow forcing complete match of all addresses 2018-07-25 21:14:47 +02:00
Rolf Eike Beer
a03068743f check_dns: allow returned addresses to be in any order 2018-07-25 20:18:47 +02:00
Rolf Eike Beer
e60c6c04f0 check_dns: simplify loop 2018-07-25 19:05:16 +02:00
Sven Nierlein
b7de6ec8bd
Update check_snmp.c
remove unnecessary brackets in help text
2018-01-19 17:05:46 +01:00
Michael Kraus
9fa449119c check_snmp: make calcualtion of timeout value in help output more clear 2018-01-19 15:13:12 +01:00
Bernard Spil
399cc14152
Fix build issue with MariaDB 10.2
As of 10.2 MariaDB no longer defines MYSQL_PORT.
2017-11-06 17:31:44 +01:00
Rasp8e
09a2210c47 Adding Proxy-Authorization and extra headers in the case of connection through PROXY to HTTPS 2017-10-17 15:19:43 +02:00
Marc Sánchez
c03e1ad081 Only turn on ordering procs by CPU usage if PS_USES_PROCPCPU
Disable sorting of procs by CPU usage on check_load if procpcpu is not present on PS_VARLIST
2017-09-07 22:25:09 +02:00
Marc Sánchez
015a40e1b5 Using PS_COMMAND constant and ordering output by procpcpu 2017-09-07 20:55:34 +02:00
Marc Sánchez
0625fbb53d Making show top consuming processes option less complicated 2017-09-07 13:55:19 +02:00
Marc Sánchez
1410ffff28 Adding print top consuming processes option to check_load
-W, --print-top-warning
    Print top consuming processes on WARNING status
 -C, --print-top-critical
    Print top consuming processes on CRITICAL status
 -n, --procs-to-show=NUMBER_OF_PROCS
    Number of processes to show when printing top consuming
    processes. Not useful without -W or -C. Default value is 5
2017-09-07 13:31:01 +02:00
Marc Sánchez
9671399c00 Adding packages-warning option
This option specifies the minumum number of packages available for upgrade to return WARNING status. Default is 1 package.
2017-09-06 16:54:03 +02:00
Michael Kraus
6e67b638f8 Output plugin's stderr to stderr
Output plugin's stderr to stderr and do  not exit with WARNING in that case
2017-09-04 16:36:19 +02:00
Christopher Odenbach
6995b51075 repaired "-n" behaviour. If run with "-n ok" a host which ran
completely out of swap space would return "ok" which is
not desired. It should only return "ok" if there is no
swap space configured at all.
2017-05-31 14:15:47 +02:00
Sven Nierlein
b3d39e605e Merge pull request #1474 from odenbach/vport
Added tests for virtual port behaviour. Separated from all other test…
2017-05-04 23:19:51 +02:00
Karol Babioch
e0b8ebaa77 plugins: check_dig: Fix spelling 2017-04-21 01:38:39 +02:00
Christopher Odenbach
9326543c2e Added tests for virtual port behaviour. Separated from all other tests this time. 2017-03-26 22:36:58 +02:00
Sven Nierlein
77aa6d4ebf udp test: prefer nc over netcat syntax
sles 12 systems have netcat symlinked to nc and so expect nc syntax for netcat.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2017-03-12 22:55:52 +01:00
Sven Nierlein
e90c63712e check_disk test: increase assumed thresholds
The check_disk fails if the build system has more than 100GB of free disk
space. Lets make this 100TB and we are safe for a couple more years.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2017-03-12 22:55:52 +01:00
Sven Nierlein
0cff5f2d93 remove hardcoded verisign.com tests
and make it configurable

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2017-03-12 22:55:52 +01:00
Sven Nierlein
b3dee5c4bf make snmp tests more reliable
snmp tests fail if the snmp daemon runs systemd, then the process with 1 has arguments. Convert
the test into a regex which works for sysv and systemd.

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2017-03-12 22:55:52 +01:00
Sven Nierlein
9daeceaed3 check_dns: fix error detection on sles nslookup
on sles (ex. 11sp1) systems the nslookup output for not found was not parsed correctly
and interpreted as ok when it should be critical:

./check_dns -H nosuchhost.nodomain -t 1 -vvv
/usr/bin/nslookup -sil nosuchhost.nodomain Server:         10.0.2.3
Address:        10.0.2.3#53
Non-authoritative answer:
*** Can't find nosuchhost.nodomain: No answer
DNS OK: 0.011 seconds response time. nosuchhost.nodomain returns |time=0.010892s;;;0.000000

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2017-03-12 21:02:58 +01:00
Gerhard Lausser
c85281d25b check_snmp: put the "c" (to mark a counter) after the perfdata value 2017-02-07 14:15:47 +01:00
Valentin Vidic
43ce70bcdb check_apt: Add -l/--list option to print packages 2017-01-16 17:54:00 +01:00
Jan Wagner
10fa79a97a Merge branch 'spell_fix' 2017-01-10 20:33:16 +01:00
Elan Ruusamäe
05ac8a98a8 understang ping6 output from iputils package 2017-01-04 22:25:38 +02:00
Jan Wagner
3fc149f499 Merge remote-tracking branch 'upstream/pr/1457' 2017-01-04 14:53:16 +01:00
Christian Schmidt
bf18dc42dd Add --only-critical switch to check_apt 2016-12-31 12:00:46 +01:00
Nicolai
6a0f4fe275 check_dns: Small test cleanup 2016-12-23 22:59:42 +01:00
Nicolai
b9f00386a1 check_dns: Fix travis tests
(or try to fix it...)
2016-12-23 21:04:36 +01:00
Nicolai
ea756ac4ad check_dns: Tests and info 2016-12-23 20:44:45 +01:00
Nicolai Søborg
22e78763ea check_dns: Accept CIDR 2016-12-21 17:24:29 +01:00
Patrick Rauscher
f524b15e57 check_dns: allow for IPv6 RDNS 2016-12-20 21:59:58 +01:00
Jan Wagner
dbb92c347e Spelling fixes suggested by lintian 2016-12-01 12:49:40 +01:00