Commit graph

4993 commits

Author SHA1 Message Date
Lorenz Kästle
fe4c82ea6f
Remove dep files which were checked in unintentionally (#2228)
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
Tests Debian:Testing and Fedora:Rawhide / Running unit and integrationt tests (push) Has been cancelled
Tests Debian:Testing and Fedora:Rawhide / Running rpm build test on fedora:rawhide (push) Has been cancelled
2026-01-23 11:07:06 +01:00
Alvar
bccb38dc9d
check_icmp: Populate progname before np_extra_opts call (#2226)
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
Tests Debian:Testing and Fedora:Rawhide / Running unit and integrationt tests (push) Has been cancelled
Tests Debian:Testing and Fedora:Rawhide / Running rpm build test on fedora:rawhide (push) Has been cancelled
Within np_extra_opts, the ini parser expects a valid progname as the
default section to select a configuration section in the ini file.
However, within the check_icmp codebase, the progname is being populated
directly after the np_extra_opts call, being a null pointer before.

$ ./check_icmp --extra-opts=@foo.ini
Segmentation fault (core dumped)

> #0  strlen () at /usr/src/lib/libc/arch/amd64/string/strlen.S:125
> #1  0x000003989615d032 in _libc_strdup (str=Variable "str" is not available.) at /usr/src/lib/libc/string/strdup.c:44
> #2  0x000003966f751b74 in np_get_defaults (locator=0x73ede1e538ea "@foo.ini", default_section=0x0) at parse_ini.c:91
> #3  0x000003966f7518ce in np_extra_opts (argc=0x73ede1e5369c, argv=0x73ede1e53728, plugin_name=0x0) at extra_opts.c:98
> #4  0x000003966f74165a in main (argc=1, argv=0x0) at check_icmp.c:832

The progname variable is set within the process_arguments function,
requiring the already enriched arguments from np_extra_opts. Thus, I
moved the progname detection out of this function, directly before the
np_extra_opts call. This pattern does already exists in check_tcp.

I briefly looked for similar issues in other plugins, but found none.
2026-01-19 01:00:00 +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
b58e244cc7
check_icmp: prevent segfault on OpenBSD (#2224)
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_icmp: prevent segfault on OpenBSD

This commit adds a sanity check for sockets in
check_icmp.
Previously FD_ISSET segfaulted when a socket value was
-1 (on OpenBSD). The changes here add an explicit
check whether the socket is -1 (and therefore not
set).

---------

Co-authored-by: Lorenz Kästle <lorenz.kaestle@netways.de>
2026-01-16 02:42:01 +01:00
Lorenz Kästle
6716001002
Merge pull request #2222 from RincewindsHat/fix/summary_counts
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
Compute numbers in output summary correctly
2026-01-15 09:54:27 +01:00
Lorenz Kästle
3e8cef3721 Compute numbers in output summary correctly 2026-01-14 17:28:51 +01:00
Lorenz Kästle
46563cea2b
Merge pull request #2200 from RincewindsHat/modern_output/check_radius
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
Tests Debian:Testing and Fedora:Rawhide / Running unit and integrationt tests (push) Has been cancelled
Tests Debian:Testing and Fedora:Rawhide / Running rpm build test on fedora:rawhide (push) Has been cancelled
check_radius: Implement modern output
2026-01-09 15:13:36 +01:00
Lorenz Kästle
6d1edb3df2
Merge pull request #2111 from RincewindsHat/refactor/check_ide_smart
Refactor check_ide_smart
2026-01-09 15:07:48 +01:00
Lorenz Kästle
da4fb28fca
Merge branch 'master' into refactor/check_ide_smart 2026-01-09 14:57:57 +01:00
Lorenz Kästle
f694f4cd4d
Merge pull request #2218 from RincewindsHat/fix/compiler_warnings
Fix some minor compiler warnings
2026-01-09 14:18:31 +01:00
Lorenz Kästle
d13413916e
Merge pull request #2199 from RincewindsHat/modern_output/check_real
check_real: implement modern output
2026-01-09 14:12:22 +01:00
Lorenz Kästle
7484fcc260 Fix PS_FORMAT 2026-01-09 14:08:41 +01:00
Lorenz Kästle
db0349ae13 parse_ini: correct string length 2026-01-09 14:03:32 +01:00
Lorenz Kästle
f15029d856 check_icmp: fix some compiler warnings (and maybe bugs) 2026-01-09 13:41:28 +01:00
Lorenz Kästle
35a1344995 check_curl: fix pointer type 2026-01-09 13:12:31 +01:00
Lorenz Kästle
bbc0c8b29f check_curl: clang-format 2026-01-09 13:10:23 +01:00
Lorenz Kästle
544ea5bf95 Fix error message formatting 2026-01-09 13:09:46 +01:00
Lorenz Kästle
c1384375bc Fix some minor compiler warnings 2026-01-09 13:05:25 +01:00
Lorenz Kästle
bfc6492562
Merge pull request #2215 from RincewindsHat/fix/check_snmp_compiler_flags
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
Tests Debian:Testing and Fedora:Rawhide / Running unit and integrationt tests (push) Has been cancelled
Tests Debian:Testing and Fedora:Rawhide / Running rpm build test on fedora:rawhide (push) Has been cancelled
Add lib math to check_snmp dependencies
2026-01-02 13:50:05 +01:00
Lorenz Kästle
ae6fcfde85 Add lib math to check_snmp dependencies 2026-01-02 13:42:00 +01:00
Lorenz Kästle
5c5809f424
Merge pull request #2214 from RincewindsHat/fix/fake-changelog-in-spec-file
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
Fake changelog in spec file since the rpm build seems to fail
2025-12-29 12:30:58 +01:00
Lorenz Kästle
3f62439e75 Fake changelog in spec file since the rpm build seems to fail 2025-12-29 11:58:18 +01:00
Lorenz Kästle
f861729abd
Merge pull request #2210 from sthen/curl_types
Some checks failed
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
Tests Debian:Testing and Fedora:Rawhide / Running unit and integrationt tests (push) Has been cancelled
Tests Debian:Testing and Fedora:Rawhide / Running rpm build test on fedora:rawhide (push) Has been cancelled
fix types for most curl_easy_setopt parameters
2025-12-28 13:07:34 +01:00
Lorenz Kästle
9bf9761d87
Merge pull request #2198 from inqrphl/fix/check-curl-append-query-string-on-redirect
check_curl: append the query string from parsed uri
2025-12-28 12:56:28 +01:00
Lorenz Kästle
e7dd07c802
Merge pull request #2213 from RincewindsHat/update/gnulib
Sync with Gnulib stable-202507 code (a8ac9f9ce5)
2025-12-28 12:50:39 +01:00
Lorenz Kästle
9c26154698
Merge branch 'master' into fix/check-curl-append-query-string-on-redirect 2025-12-28 12:30:23 +01:00
Lorenz Kästle
b0afb8fe0f Sync with Gnulib stable-202507 code (a8ac9f9ce5) 2025-12-28 12:13:40 +01:00
Stuart Henderson
d36bf51baf fix types for most curl_easy_setopt parameters
according to https://curl.se/libcurl/c/curl_easy_setopt.html, parameters
are either a long, a function pointer, an object pointer or a curl_off_t,
depending on what the option expects; curl 8.16 checks and warns about
these.
2025-12-23 15:54:27 +00:00
Lorenz Kästle
828a9720b1
Merge pull request #2202 from oxzi/fringe-unix-build-fixes-for-v3.0.0-rc1
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
Tests Debian:Testing and Fedora:Rawhide / Running unit and integrationt tests (push) Has been cancelled
Tests Debian:Testing and Fedora:Rawhide / Running rpm build test on fedora:rawhide (push) Has been cancelled
Fix v3.0.0-rc1 Build on OpenBSD
2025-12-17 17:19:21 +01:00
Lorenz Kästle
68fc05381e
Merge pull request #2206 from oxzi/check_http_die_not_null
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
Tests Debian:Testing and Fedora:Rawhide / Running unit and integrationt tests (push) Has been cancelled
Tests Debian:Testing and Fedora:Rawhide / Running rpm build test on fedora:rawhide (push) Has been cancelled
check_http: Abort invalid SSL w/ error
2025-12-14 22:54:42 +01:00
Alvar
eed2dd00bb
check_curl: --verify-cert / -D in examples (#2204)
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
Include the -D flag for certificate verification in the "CHECK
CERTIFICATE" examples. Otherwise, only the certificate dates are
checked, but not if the certificate matches to the hostname or is signed
by a trusted CA.

Fixes #2146.
2025-12-14 12:53:51 +01:00
Ahmet Oeztuerk
f8db90c206 check_curl redirection test improvements
previously, the fragment was sent in the request from client, and the
server would parse and increment its value. the incremented value would
be set in the redirected URI.

this does not work as fragments are meaningless to servers and clients
like check_curl strip them in their GET request.

rewrite the fragment handling . if client sends a URI parameter with
'fragment' as its key, the server will set its value for its redirected
URI. it will come up both as a parameter and the fragment at the end.

use this new logic to rewrite the fragment redirection test. remove -p
$http_port argument on tests for this endpoint, which was making https
tests fail. correct the common test count from 75 to 95, as there are 20
total test assertions in the 8 times it uses the new endpoint. remove
unused code on that endpoint as well
2025-12-12 11:29:35 +01:00
Alvar Penning
8bc1d57a73
check_http: Abort invalid SSL w/ error
If a SSL connection cannot be established, check_http bailed out with a
die function call with a NULL fmt string. This adds a more meaningful
message.

The motivation for this patch was to get everything from the OpenBSD
ports upstream. It seems like in the old days, this would have resulted
in a segfault.

b8a6b3cae5

However, even if "die" now checks for NULL, a human readable error is
nice to have.
2025-12-11 22:27:12 +01:00
Alvar Penning
6ce11bc44f
lib/utils_cmd: Rename stdout, stderr in cmd_run_result
On OpenBSD's "stdio.h", stdin, stdout, and stderr are not directly
FILE*, but #defines. Thus, naming the output struct fields stdout and
stderr resulted in compiler errors, after replacing the #define.

a762189c5e/include/stdio.h (L75-L77)
2025-12-11 21:05:49 +01:00
Alvar Penning
b27bf07ebf
plugins-root/check_icmp: Fix build for SIOCGIFADDR
The refactoring in eafee9c3f9 missed the
part within "#if defined(SIOCGIFADDR)" in get_ip_address.
2025-12-11 21:05:49 +01:00
Alvar Penning
cbddc7dbb4
plugins-root/check_icmp: Import sys/ioctl.h
The ioctl(2) call within "#if defined(SIOCGIFADDR)" requires the include.
2025-12-11 21:05:49 +01:00
Alvar Penning
ca5c2b3a5f
plugins/check_smtp: Remove unnecessary glibc-only include
This library is glibc-only and not necessary at this point. The
getopt_long function is provided by "getopt.h", included via "common.h".

Similar to #2159.
2025-12-11 21:05:49 +01:00
Alvar Penning
59d7d1c2f1
configure.ac: Fix PostgreSQL Check for OpenBSD
On OpenBSD, crypt is named crypto. This diff is a portable version of a
patch residing in the OpenBSD ports since ages.

1f15238782/net/monitoring-plugins/patches/patch-configure_ac
2025-12-11 21:05:49 +01:00
Ahmet Oeztuerk
737af667a2 clairfy new check_curl tests
use the parameters in the last redirected URI that that server returns
HTTP OK to. matches the incrementation count of redirection_count from 0
to 3, as they also get incremented three times alongside it. add
comments about what is happening in the test cases, no need to
understand the endpoint completely
2025-12-11 10:37:05 +01:00
Ahmet Oeztuerk
feeade0817 fix typos 2025-12-10 17:09:46 +01:00
Ahmet Oeztuerk
f7df5579ab check_curl add tests for uri field parsing
plugins/tests/check_curl.t forks and runs a http(s) server that responds
to specific uri endpoints. Added another endpoint under
/redirect_with_increment with dynamic redirection points.

This endpoint will parse different parts of the uri that come after the
path: parameters, query and the fragment. If applicable, seperate
elements within each field are parsed into key/value pairs. value is
incremented in redirected URI.

Tests if check_url redirection logic retains different parts of the url
when parsing the uri and building the new redirected URL. Current tests
show that it ignores the fragment part.
2025-12-09 00:13:15 +01:00
Lorenz Kästle
fccadd7ced Fix typo 2025-12-05 13:19:24 +01:00
Lorenz Kästle
2f67402385 check_radius: Implement modern output 2025-12-05 13:15:55 +01:00
Lorenz Kästle
74d61bbf8a check_real: implement modern output 2025-12-05 12:28:26 +01:00
Ahmet Oeztuerk
e0b30cc6e8 append the query string from parsed uri
Check the UriUriA object, and if query string exists append it to the
new_url. Only appends the query part, fragments are still not appended

Function redir parses the new location header value using the
uriParseUriA function already, which populates the query field. This
field was already being printed, but it was not being appended to the
new_url during its construction.

Redirection chain of check_curl --onredirect=follow now mimics the chain
of check_http --onredirect=follow. Tested on the url:
mail.google.com/chat
2025-12-04 17:03:57 +01:00
Lorenz Kästle
7ab5b3ba34
lib: properly separate perfdata from different sub subchecks (#2197)
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
Tests Debian:Testing and Fedora:Rawhide / Running unit and integrationt tests (push) Has been cancelled
Tests Debian:Testing and Fedora:Rawhide / Running rpm build test on fedora:rawhide (push) Has been cancelled
Previously there was a space missing between perfdata from differen sub subchecks which irritated my monitoring system and caused it to interpet two data points as one.
This puts the space back in there.
2025-12-04 15:31:22 +01:00
Lorenz Kästle
3ae751ed67
Fix check_ntp_time without a socket (#2196)
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
In the previous commit I unintentionally introduced an error
through symbol shadowing.
This should fix check_ntp_time when the target address
is a network address.
2025-12-04 13:24:14 +01:00
Lorenz Kästle
c735cf4234
Remove check_ntp (#2194)
check_ntp was marked as deprecated for forever (SVN times).
In the spirit of cleaning up and removing the dead bodies, this
commit removes check_ntp and all its connections.
2025-12-04 13:23:50 +01:00
Lorenz Kästle
30a9908d8d
Remove check_nt (#2195)
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_nt was used to connect NSclient++ on windows, both the method
and the target are pretty much dead.
Therefor check_nt gets removed.
2025-12-03 22:39:19 +01:00
Lorenz Kästle
25329a9097
check_snmp: fix offset computation for INTEGER (#2190)
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
2025-12-02 11:32:17 +01:00