Commit graph

5002 commits

Author SHA1 Message Date
Andreas Baumann
3e656e6408 utils.h: undefine USE_OPENSSL to avoid clash with net-snmp redefitition
Some checks failed
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
2026-01-23 10:15:47 +01:00
Andreas Baumann
d28be4a00c check_snmp_helpers.c: various possible fixes around const char */char * casts 2026-01-23 10:10:30 +01:00
Andreas Baumann
38f601be58 removed -Wundef statement from net-snmp-config --cflags causing wanings in clang macros in GNUlib 2026-01-23 10:04:33 +01:00
Andreas Baumann
52267354e7 check_real: fixed for non-constness of default_expect 2026-01-23 09:42:09 +01:00
Andreas Baumann
bfd123989b strange auto-updates in GNUlib 2026-01-23 09:40:09 +01:00
Andreas Baumann
53c465cba6 removed -Werror=declaration-after-statement from net-snmp-config --cflags causing trouble in check_snmp.c 2026-01-23 09:38:54 +01:00
Andreas Baumann
c594a60da0 .Po dep files depend on the platform, do they have to be checked in? 2026-01-23 09:19:45 +01:00
Andreas Baumann
9d14a90f35 check_snmp: fixed falltrhough case in ASN_FLOAT/ASN_DOUBLE 2026-01-23 08:59:52 +01:00
Andreas Baumann
8d44bd8e69 added CHECK_EOF to work around warnings about EOF and -1 being the same 2026-01-23 08:57:19 +01:00
Andreas Baumann
5ede691890 common.h: added guard to avoid warning when ENABLE_NLS is not defined 2026-01-22 12:59:19 +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