Commit graph

292 commits

Author SHA1 Message Date
Lorenz Kästle
c57381d789
Revert check_disk performance data back to used space (#2243)
* Implement simple output shortcut for ranges

If ranges start with zero (e.g. 0:10), the zero and the colon
can be left out.

This patch implements this by default, since some systems (icinga2)
do not fully implement the whole range format and this reduces errors
in the common case of just an upper border.

* switch check_disk perfdata back to used space
2026-04-06 11:55:27 +02:00
inqrphl
b9cd60ec3a
add proxy argument and improve dns cache usage (#2209)
* add proxy argument and improve dns cache usage

add proxy argument that useing the -x and --proxy argument. add it to
the static curl config struct, command usage and help outputs of the
cli.

parse these argument together with the environment variables like
http_proxy before setting the CURLOPT_PROXY in the curl configuration
option. this is required, as there is no easy way to ascertain/get what
the CURLOPT_PROXY that libcurl will use. by the point it is set by
libcurl, we have no control over it anymore, and need it for the other
steps in the configuration.

if the CURLOPT_PROXY is set, skip the DNS cache population which would
set the CURLOPT_RESOLVE. this is currently not perfect however. if a
proxy is set with socks4 or socks5 scheme, the host should be resolving
the hostname.

* codespell, clang-format and hints fixes

* add curl version and ssl enabelement macro checks

might fix rocky linux 8 compilation issues.

* add proxy_resolves_hostname, determined by proxy scheme

leave the functions that print out an curl_easyoption, but dont use it. organize the code slightly, print out the final CURLOPT_PROXY and proxy_resolves_hostname flag on verbose mode, add comments

* remove unused handle_curl_easyoption and format_curl_easyoption functions

* fix typo in the proxy argument

* fix typo with proxy scheme socks5a->socks5h

* improve proxy environment parsing

add another argument: --no-proxy , which is used when setting
CURL_NOPROXY

additionally parse all_proxy, ALL_PROXY, no_proxy and NO_PROXY
environment variables in the correct order.

set the curlopt_proxy and curlopt_noproxy of libcurl, and additionally
save them in check_curl_working_state.

add function determine_hostname_resolver, uses the working state and
static config. it can tokenize the no_proxy variable and check for exact
matches, but cannot determine subnet matches for ip addresses yet.

* document proxy cli arguments

clarify and add more examples of proxy environment variables and their
behavior when multiple are specified, overriden etc.

add single wildcard '*' checking for no_proxy to
determine_hostname_resolver, special case per curlopt_noproxy
documentation

* check curlopt_noproxy before accessing it

* switch argument from --no-proxy to --noproxy like curl cli

* check if host name is a subdomain of an noproxy item

* use strdup where destination working_state.curlopt_proxy may be NULL

* add disclaimer about uppercase HTTP_PROXY

* add subdomain checks for each item in the no_proxy, if the target host is a subdomain proxy wont resolve it

add function ip_addr_inside_cidr, use it for checking possible cidr ranges  given in the no_proxy

* wip tests that work on local perl http/https server

* wip tests that work on the live debian image

* fix subnet definition

* make apache2 listen on [::1] for ipv6 tests

* remove squid certificate

* rewrite ip_addr_inside_cidr, split ipv4 and ipv6 parsing path and copy them to a shared buffer later on for prefix check

* Adapt tests for the squid sever, disable checking return code for socks 4/5 proxies. Squid does not support it, and we do not install a capable proxy for these schemes.

* specify localhost acl and allow it through the proxy. used in check_curl tests

* typo in comment

* move function comments to header

* fix failing tests

* handle case where proxy is set as empty string

* removed duplicate tests, corrected wrong comments

* corrected some annotations

* move docker apache subdomain setup files to /tools/subdomain1

* add a newline before dying in handle_curl_option_return_code

* fix the -ssl better, now does not segfault on empty --ssl argument as well.


---------

Co-authored-by: Ahmet Oeztuerk <Ahmet.Oeztuerk@consol.de>
2026-03-13 15:54:23 +01:00
Lorenz Kästle
f5f60f5717
check_disk: compare inode thresholds against the correct value (#2223)
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Spellcheck / codespell (push) Has been cancelled
Tests / Running unit and integrationt tests (push) Has been cancelled
Tests / Running rpm build test on almalinux:9 (push) Has been cancelled
Tests / Running rpm build test on fedora:latest (push) Has been cancelled
Tests / Running rpm build test on rockylinux:8 (push) Has been cancelled
* check_disk: compare inode thresholds against the correct value

* check_disk: Detect free inode number correctly in tests

---------

Co-authored-by: Lorenz Kästle <lorenz.kaestle@netways.de>
2026-01-16 12:16:45 +01:00
Lorenz Kästle
2f96b82c9b
check_ntp_time/check_ntp_peer: unix socket handling (#2187)
Some checks are pending
CodeQL / Analyze (push) Waiting to run
Spellcheck / codespell (push) Waiting to run
Tests / Running unit and integrationt tests (push) Waiting to run
Tests / Running rpm build test on almalinux:9 (push) Waiting to run
Tests / Running rpm build test on fedora:latest (push) Waiting to run
Tests / Running rpm build test on rockylinux:8 (push) Waiting to run
* check_ntp_time/check_ntp_peer: unix socket handling

* No tests for check_ntp since it is deprecated
2025-11-28 10:52:39 +01:00
Lorenz Kästle
07d3eb9e2c check_ldap: modern output implementation 2025-11-25 12:31:00 +01:00
Lorenz Kästle
584272e97d check_by_ssh: fix some tests 2025-11-16 15:33:11 +01:00
Lorenz Kästle
4442ea917b small test correction 2025-11-08 02:10:45 +01:00
Lorenz Kästle
e0b1273127 check_smtp: adapt tests 2025-11-08 00:46:37 +01:00
Lorenz Kästle
9d827acbe1 check_mysql_query: implement modern output 2025-11-07 15:01:36 +01:00
Lorenz Kästle
b5e7f4e6cc
Merge pull request #2174 from RincewindsHat/modern_output/check_mysql
Modern output/check mysql
2025-11-07 14:15:26 +01:00
Lorenz Kästle
ca3acbe274
Merge pull request #2168 from RincewindsHat/refactor/check_dbi
check_dbi: new output functionality
2025-11-07 14:14:55 +01:00
Lorenz Kästle
0fb65a3a90 check_mysql: implement modern output 2025-11-07 13:31:42 +01:00
Lorenz Kästle
ec5fd11c1d check_dbi: new output functionality 2025-10-29 13:05:55 +01:00
Lorenz Kästle
c4716ad8d8 Fix check_apt tests 2025-09-16 14:11:13 +02:00
Lorenz Kästle
eca9eaf9f5 fix number of tests 2025-09-15 02:17:44 +02:00
Lorenz Kästle
c07dd02bee Adapt test to new error message 2025-09-15 02:09:04 +02:00
Lorenz Kästle
c892db9ae1 Fix typos 2025-09-15 02:02:04 +02:00
Lorenz Kästle
404d52efb9 Fix/adapt tests 2025-09-15 01:58:26 +02:00
Lorenz Kästle
6ae8ba9110 check_curl: test adaption and output adaption 2025-09-13 12:49:06 +02:00
Lorenz Kästle
c43f845c22 Adjust number of tests 2025-09-09 01:43:27 +02:00
Lorenz Kästle
015e4c0986 check_snmp: fix/adapt tests 2025-08-27 16:42:06 +02:00
Lorenz Kästle
7382fa90f8 Merge branch 'master' into refactor/check_users 2025-08-11 21:54:05 +02:00
Lorenz Kästle
b191a8a055 check_load: fix tests 2025-07-06 23:16:34 +02:00
Lorenz Kästle
92c7b91002 Merge branch 'master' into refactor/check_load 2025-07-06 22:49:04 +02:00
Lorenz Kästle
13c9de8c77 Try fixing some tests 2025-03-31 23:40:22 +02:00
Lorenz Kästle
24a50b9421 check_disk: decrease precision to avoid false negatives with small measurement changes 2025-03-31 22:18:19 +02:00
Lorenz Kästle
d1d6ba6706 Add debugging to tests for CI 2025-03-30 23:42:50 +02:00
Lorenz Kästle
c4fd34ed79 Codespell fixes 2025-03-30 22:46:09 +02:00
Lorenz Kästle
76971dea75 Address check_disk changes in tests 2025-03-30 22:38:12 +02:00
Lorenz Kästle
205b97b3e2 check_load: Remove output formatting test and adapt others 2025-03-13 23:48:33 +01:00
Lorenz Kästle
c61b5ef06a Update more tests to current output 2025-03-13 13:21:10 +01:00
Lorenz Kästle
44211a6729 Adapt tests more 2025-03-13 12:59:40 +01:00
Lorenz Kästle
54a099ed6d Merge branch 'master' into refactor/check_tcp 2025-03-13 00:48:00 +01:00
Lorenz Kästle
89df16e750 Adapt tests 2025-03-13 00:44:35 +01:00
Lorenz Kästle
270d643d11 Adapt tests 2025-03-12 22:16:57 +01:00
Lorenz Kästle
9d5774aede Adapt number of tests 2025-03-09 10:25:01 +01:00
Lorenz Kästle
69819d8c95 Adapt test regex to new output 2025-03-09 10:24:28 +01:00
Lorenz Kästle
809e79c745 Remove failing test 2025-03-09 00:30:33 +01:00
Lorenz Kästle
fea6a662bd fix accidently remove parentheses in test 2025-03-09 00:12:37 +01:00
Lorenz Kästle
f63d249984 Adapt further test to changed output 2025-03-09 00:03:18 +01:00
Lorenz Kästle
1ba8110da7 check_ssh: adapt tests 2025-03-07 23:38:50 +01:00
Lorenz Kästle
03b09f7ce0
Merge pull request #2076 from RincewindsHat/feature/json_parsing_in_tests
Implement JSON output parsing for tests
2025-03-07 18:18:29 +01:00
Lorenz Kästle
5ad1c0e821 Implement JSON output parsing for tests 2025-03-07 17:05:02 +01:00
Lorenz Kästle
9e1c72ac15
Merge pull request #2068 from RincewindsHat/check_mysql_replica_check
Check mysql replica check
2025-03-07 17:02:55 +01:00
Lorenz Kästle
3ed6b7cd3e check_mysql tests: Also exchange slave for replica 2025-02-24 20:55:18 +01:00
Lorenz Kästle
7c8c9d9b3e Remove check_swap tests with one-line format 2025-02-21 13:57:17 +01:00
Lorenz Kästle
ec18b80cdb Add tests for check_swap with JSON output 2025-02-19 12:07:01 +01:00
Lorenz Kästle
d27e0862a9 Fix previous check_swap tests 2025-02-19 11:57:25 +01:00
Lorenz Kästle
4b7977b25b check_swap: Fix text in old school tests 2024-11-10 01:40:29 +01:00
Sven Nierlein
9e6361077b check_http: replace www.mozilla.com with monitoring-plugins.org
this makes tests more reliable if we test our own sites instead some 3rd party site.

Signed-off-by: Sven Nierlein <sven@consol.de>
2024-07-23 21:08:57 +02:00