Commit graph

3371 commits

Author SHA1 Message Date
Barak Shohat
63cb7ecfcf check_curl.c: bugfix: verify certificates option should not force SSL to be used 2021-05-24 14:53:58 +03:00
Sven Nierlein
6946b546fe
Merge pull request #1686 from monitoring-plugins/feature_github_actions
Migrate to GitHub actions
2021-05-21 13:06:37 +02:00
Sven Nierlein
b428cc17f7 tests: ignore sigpipes in https test daemon
check_http closes the connection after checking the certificate with -C. This leads to sigpipe
errors when the ssl daemon wants to send a response and the daemon quits which makes the
subsequent tests fail.
2021-05-20 20:57:59 +02:00
Sven Nierlein
eb75d847ae tests: increase startup sleep
github action might fail from to time otherwise
2021-05-20 18:04:49 +02:00
Sven Nierlein
6344d29143 remove useless comments
Signed-off-by: Sven Nierlein <sven@nierlein.de>
2021-05-20 17:49:46 +02:00
Jacob Hansen
226469f970
Prune container and volumes
Rather than manully removing the tmpfs volume.

Signed-off-by: Jacob Hansen <jhansen@op5.com>
2021-05-19 14:25:30 +02:00
Jacob Hansen
0bbcb60f02
Refactor check_fping
* Set correct amount of tests based on conditionals.
* When running the test as non-root, we would previously check is the
setuid bit is set. This doesn't seem to be needed, so just check if the
binary is executable for the user running the test.
* Use cmp_ok to check if tests succeeds rather than couting.

Signed-off-by: Jacob Hansen <jhansen@op5.com>
2021-05-19 13:36:04 +02:00
Jacob Hansen
227369bb3b
Disable IPv6 in tests
Docker doesn't seem to have a working IPv6 stack by default. For now
disable IPv6 tests.

Signed-off-by: Jacob Hansen <jhansen@op5.com>
2021-05-19 13:12:29 +02:00
Jacob Hansen
ae2fe683e3
check_curl.t: Adjust test to use -f curl
It appears that `-f follow` doesn't work correctly in `check_curl` at
the moment. Test adjusted to use `-f curl` instead.

Issue for the above created: https://github.com/monitoring-plugins/monitoring-plugins/issues/1685

Signed-off-by: Jacob Hansen <jhansen@op5.com>
2021-05-18 15:19:43 +02:00
Jacob Hansen
de9f85c916
Use openssl generated cert
The SSL certificate generate using make-ssl-cert seems to not work well
with a our plugins. Causing a "CN could not be found" error to be shown.

Using an OpenSSL generated certifiticate, seems to work better.

Signed-off-by: Jacob Hansen <jhansen@op5.com>
2021-05-18 14:42:58 +02:00
Aksel Sjögren
39c162e594
Fix check_dhcp tests
* try to use "/usr/sbin/ip" before "ifconfig" since the latter is
  obsolete on Linux to figure out interface to listen for DHCP messages.
  But keeping ifconfig method just in case.
  Without this, tests fail on boxes without ifconfig AND the correct
  interface named ethX.

* amend possible failure responses, as check_dhcp might get a DHCPOFFER,
  but from an unexpected address - which happens if the box running
  tests are on a network with a DHCP server.
2021-04-30 11:14:10 +02:00
Aksel Sjögren
e712d5a6ef
Add test-debug for plugins-root
Fixes "No rule to make target 'test-debug'" when running "make
test-debug" in root dir.
2021-04-30 11:14:04 +02:00
Aksel Sjögren
5ab03a7095
Fix conditional tests for check_http, check_curl
Set correct number of tests in skip- blocks to avoid the error "Bad
plan.  You planned 50 tests but ran 55" when run with/without
/usr/bin/faketime and NP_INTERNET_ACCESS=yes/no.
2021-04-30 11:13:59 +02:00
Jacob Hansen
40e171b7cd Attempt to fix check_users
Signed-off-by: Jacob Hansen <jhansen@op5.com>
2021-04-30 09:57:02 +02:00
Sven Nierlein
fc71e3f930 migrate travis ci to github actions 2021-04-30 09:56:52 +02:00
Sven Nierlein
444a3579b2 fix fping test
in case of dns errors, fping returns an unknown and thats ok.
2021-04-30 09:56:52 +02:00
Barak Shohat
f0ac7fcc7c check_curl: Fix bug where headers beginning with HTTP_ cause the status line parsing to fail. 2021-04-13 12:06:18 +02:00
Sven Nierlein
5c1d2efd68
Merge pull request #1671 from monitoring-plugins/feature_check_curl
Feature check curl
2021-04-09 08:54:15 +02:00
Andreas Baumann
cd358cd08a check_curl: backported --show-body/-B to print body (from check_http) 2021-04-08 20:39:48 +02:00
Andreas Baumann
1debd29b57 check_curl: make -C obvious (from check_http, part 2) 2021-04-08 15:14:53 +02:00
Andreas Baumann
a6acea7941 check_curl: make -C obvious (from check_http) 2021-04-08 14:15:54 +02:00
Andreas Baumann
f90aec83cb check_curl: Increase regexp limit (to 1024 as in check_http) 2021-04-08 14:07:20 +02:00
Sven Nierlein
f6fd14e886
Merge pull request #1669 from bazzisoft/verify-cert
Add an option to check_curl to verify the peer certificate & host using the system CA's
2021-04-07 17:51:38 +02:00
Sven Nierlein
b145ea1998
Merge pull request #1554 from stblassitude/master
Docs check_http: make -C obvious
2021-04-07 17:16:12 +02:00
Sven Nierlein
4ad33d9f27
Merge pull request #1566 from hydrapolic/master
plugins: check_http: Increase regexp limit
2021-04-07 17:15:20 +02:00
Sven Nierlein
de7effdf06
Merge pull request #1465 from lausser/master
check_snmp: put the "c" (to mark a counter) after the perfdata value
2021-04-07 17:12:38 +02:00
waja
7ac706e894
Merge pull request #1663 from waja/debian_982847_2
Using snprintf which honors the buffers size and guarantees null temination. (Closes: #1601)
2021-04-07 16:45:59 +02:00
Barak Shohat
6993c21695 Add an option to check_curl to verify the peer certificate & host using the system CA's 2021-04-07 15:38:47 +03:00
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
57b4dc0f23
Merge pull request #1667 from monitoring-plugins/feature_check_curl
check curl bugfixes
2021-03-22 10:05:45 +01: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
Sven Nierlein
05d7f70d45
Merge pull request #1649 from DerDakon/split-addr
check_dns: split multiple IP addresses passed in one -a argument
2021-02-04 11:21:26 +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
Sven Nierlein
180e069169
Merge pull request #1652 from timgates42/bugfix_typo_conspicuously
docs: fix simple typo, conspicuosly -> conspicuously
2020-12-19 19:25:36 +01:00
Tim Gates
dbdd0f972a
docs: fix simple typo, conspicuosly -> conspicuously
There is a small typo in plugins-root/check_icmp.c.

Should read `conspicuously` rather than `conspicuosly`.
2020-12-19 17:14:23 +11:00
Jan Wagner
7fdbea06c7 Prepare the release docu for 2024 when we release 2.4 2020-12-09 22:54:38 +01:00
Jan Wagner
b42294b1eb New version in NEWS 2020-12-09 22:52:08 +01:00
Jan Wagner
bcedcee206 New version number for git 2020-12-09 22:48:44 +01:00
Jan Wagner
d9c87f84b4 Draft NEWS 2020-12-09 22:38:01 +01:00
Jan Wagner
5789a76bbc Updating contributors 2020-12-09 22:09:38 +01:00
Jan Wagner
233251f43b Updating version number 2020-12-09 14:10:53 +01:00
waja
81b99ded7f
Merge pull request #1650 from sni/fix_check_mailq_options
check_mailq: restore accidentially removed options
2020-12-08 16:55:04 +01:00
Sven Nierlein
aa79ab278f check_mailq: restore accidentially removed options
with https://github.com/monitoring-plugins/monitoring-plugins/issues/381 -W and -C have been removed. It
would have been sufficient to only remove the long options. Restoring short options..

 - fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=954961
2020-12-08 16:24:10 +01:00