Commit graph

5056 commits

Author SHA1 Message Date
Lorenz Kästle
2be3a67a29
Merge ba7ba8b1a5 into 0800b462ab 2026-07-01 04:12:58 -07:00
Holger Weiss
0800b462ab Update NEWS 2026-06-30 17:02:57 +02:00
Holger Weiss
f732906649 check_icmp: Reject negative ICMP data length
The -b/--size handler checks the lower bound after casting the value to
unsigned long while checking the upper bound as a signed comparison.  A
negative argument such as "-b -65536" therefore satisfies both checks.
The value is then truncated to an undersized icmp_data_size, which later
serves as the size of the ICMP send buffer, so building the packet
overflows that buffer.

Compare the size as a signed long against both bounds so negative values
are rejected.

Reported-by: Christopher Kreft <Email@ChristopherKreft.de>
2026-06-30 16:20:12 +02:00
Holger Weiss
a675995b19 check_icmp: Fix parsing of single-char threshold
The threshold parser starts a pointer at the last character of the
string and walks it backwards until it reaches the second character.
This assumes the string is at least two characters long.  For a
single-character threshold such as "-w 1" or "-c 1", the pointer
underflows past the start of the string and keeps dereferencing memory
out of bounds.

Beyond the out-of-bounds reads, an out-of-bounds write can occur if a
stray '%' or ',' byte happens to turn up while scanning backwards.  In
that case, the parser writes a NUL byte at that out-of-bounds address
(the ',' case additionally re-reads forward from there via strtoul(3)).

Only run the descending scan when the string has at least two
characters, leaving the behaviour for all valid thresholds unchanged.

Reported-by: Christopher Kreft <Email@ChristopherKreft.de>
2026-06-30 15:58:09 +02:00
Holger Weiss
c35c12e58d check_icmp: Reject more than 65535 target hosts
The number of -H hosts is counted into an unsigned short, so supplying
more than 65535 hosts wraps the counter.  The subsequent calloc(3) then
allocates an undersized hosts array while the later parsing loop still
writes one entry per host, overflowing the heap buffer.  As
process_arguments() runs before we drop privileges via setuid(getuid()),
this happens while still running as root on setuid-root installs.

Guard both places where the counter is incremented and bail out with a
usage error once 65535 hosts are reached, rather than wrapping silently.

Reported-by: Christopher Kreft <Email@ChristopherKreft.de>
2026-06-30 15:32:40 +02:00
Sven Nierlein
1c84da06be
check for net-snmp-config when buildin check_snmp (fixes #2281) (#2286)
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
this will fix the build error on check_snmp when net-snmp-config is not available.

```
  CC       check_snmp-check_snmp.o
/bin/bash: line 1: net-snmp-config: command not found
In file included from check_snmp.d/check_snmp_helpers.h:3,
                 from check_snmp.c:42:
check_snmp.d/./config.h:16:10: fatal error: net-snmp/net-snmp-config.h: No such file or directory
   16 | #include <net-snmp/net-snmp-config.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [Makefile:3353: check_snmp-check_snmp.o] Error 1
make[3]: Leaving directory '/opt/projects/git/monitoring-plugins/plugins'
```

Signed-off-by: Sven Nierlein <sven@consol.de>
2026-06-19 11:12:08 +02:00
dependabot[bot]
167be08c4b
build(deps): bump actions/checkout from 6 to 7 (#2285)
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-19 09:33:51 +02:00
Martin
2b91a9e297
check_mysql: Fix MariaDB casing (#2283)
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
2026-06-18 23:46:29 +02:00
Lorenz Kästle
c48c426a8e
check_mysql_query: add option to hide query in output (#2279)
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
Co-authored-by: Lorenz Kästle <lorenz.kaestle@netways.de>
2026-06-18 16:47:56 +02:00
Lorenz Kästle
9bf8c49b07
Remove hints to the fascist bird site (#2278)
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
2026-06-18 00:18:46 +02:00
inqrphl
605d59f957
check_curl fix: populate the dns cache when hostname gets resolved locally (#2280)
* check_curl fix: populate the dns cache when hostname gets resolved locally

due to a previous refactor, it would populate it when hostname wasnt getting resolved locally

hostname_gets_resolved locally now assumes that resolving is local if proxy was unknown. previously was returning 0 instead of true, contradicting what it says

fix a memory leak. server_address_clean was being assigned to another strndup result before being freed

fix another memory leak, one path to return in hostname_gets_resolved_locally was not freeing up two variables

improve logs and comments around hostname_gets_resolved_locally

clang-format is applied

* check_curl: fix typo in comment

---------

Co-authored-by: Ahmet Oeztuerk <Ahmet.Oeztuerk@consol.de>
2026-06-17 23:26:04 +02:00
Lorenz Kästle
d10e7324ab Release 3.0.0
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
2026-06-16 22:42:27 +02:00
Lorenz Kästle
1372654e8a
Check ntp time delay (#2277)
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_ntp_time: add polling delay

NTP server can have rate limiting which might be triggered by
check_ntp_time due to many requests in a short time span.

This patch adds a default delay (of 0.5s) between requests to each server
and a command line option (--poll-delay) to make this delay
configurable.

Co-authored-by: Lorenz Kästle <lorenz@vulgrim.de>

* check_ntp_time: verify whether socket path fits into address struct

check_ntp_time could be give a too long (>108 bytes) socket path
to work with, which would potentially crash the program.
This patch validates to length beforehand and stops execution
in that case.

Co-authored-by: Lorenz Kästle <lorenz@vulgrim.de>

---------

Co-authored-by: Paul Crawford <paul@crawford-space.co.uk>
Co-authored-by: Lorenz Kästle <lorenz@vulgrim.de>
2026-06-11 02:40:07 +02:00
Lorenz Kästle
cc8d5b55de
Add a hint about libfreeradius version in REQUIREMENTS (#2276)
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
Co-authored-by: Lorenz Kästle <lorenz.kaestle@netways.de>
2026-06-10 16:05:31 +02:00
Lorenz Kästle
f8aad020f7
Run clang-format on everything once again (#2275)
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
Co-authored-by: Lorenz Kästle <lorenz.kaestle@netways.de>
2026-06-10 14:49:33 +02:00
Lorenz Kästle
47b1b2d754
Remove a few unnecessary trailing newlines from error messages (#2274)
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
Co-authored-by: Lorenz Kästle <lorenz.kaestle@netways.de>
2026-06-08 13:19:31 +02:00
Lorenz Kästle
9bbc764838
Ok summary (#2270)
* lib: implement functionality to set ok summary

* check_load: implement setting ok summary

* OK summary for ntp_peer, ntp_time and users

* check_apt: implement ok summary

* check_curl: implement ok summary

* check_disk: implement ok summary

* check_dbi: implement ok summary

* check_ldap: auto formatting

* check_ldap: implement ok summary

* check_ssh: implement ok summary

* check_tcp: implement ok summary

* fixup! check_curl: implement ok summary

* fixup! check_dbi: implement ok summary

* fixup! check_ldap: implement ok summary

* fixup! check_ssh: implement ok summary

* fixup! check_tcp: implement ok summary

* check_apt: remove illegal free

* check_mrtg: fix link

* check_mrtg: implement ok summary

* check_mrtgtraf: fix link

* check_mrtgtraf: implement ok summary

* check_mysql: implement ok summary

* check_mysql_query: implement ok summary

* check_pgsql: implement ok summary

* check_radius: implement ok summary

* check_real: implement ok summary

* check_smtp: implement ok summary

* check_snmp: implement ok summary

* check_swap: implement ok summary

* check_ups: add OK summary

---------

Co-authored-by: Lorenz Kästle <lorenz.kaestle@netways.de>
2026-06-08 08:23:44 +02:00
Lorenz Kästle
992a4555ac
check_ups: implement modern output (#2272)
Co-authored-by: Lorenz Kästle <lorenz.kaestle@netways.de>
2026-06-08 07:35:45 +02:00
Lorenz Kästle
44e1913da4
Error summary (#2259)
Some checks failed
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
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
* lib: properly name function to set summary

* lib: set first non-ok subcheck as the summary for the overall check

* Fetch summarily recursively from failed subchecks

---------

Co-authored-by: Lorenz Kästle <lorenz.kaestle@netways.de>
2026-05-30 12:30:39 +02:00
Lorenz Kästle
e1cde41866
Fix/check load inconsistencies (#2269)
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
* Remove redundant new line in multi-line outputs

* check_load: Fix missing brace in output

* check_load: rename function to properly indicate purpose

* check_load: show the correct amount of procs

* check_load: allow execution without parameters

---------

Co-authored-by: Lorenz Kästle <lorenz.kaestle@netways.de>
2026-05-27 11:25:31 +02:00
inqrphl
178e9a02e3
check_http and check_curl: custom timeout return state (#2266)
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_curl + check_http:
 hdd cli argument to return custom states on timeout

---------

Co-authored-by: Ahmet Oeztuerk <Ahmet.Oeztuerk@consol.de>
2026-05-19 16:01:43 +02:00
Lorenz Kästle
5ccce85495
Fix/check load inconsistencies (#2267)
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
* Remove redundant new line in multi-line outputs

* check_load: Fix missing brace in output

* check_load: rename function to properly indicate purpose

* check_load: show the correct amount of procs

* check_load: allow execution without parameters

---------

Co-authored-by: Lorenz Kästle <lorenz.kaestle@netways.de>
2026-05-19 09:18:20 +02:00
Lorenz Kästle
1211edf2ea
check_snmp: Put all privproto/authproto options into help (#2261)
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
2026-04-24 15:08:23 +02:00
Lorenz Kästle
1eace3a997
Fix/compiler warnings (#2255)
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 compiler warning about comparing different signedness

* Fix compiler warning about constant strings
2026-04-09 14:54:08 +02:00
Lorenz Kästle
ba7ba8b1a5 Try tests with perls system instead of exec 2026-04-09 13:26:31 +02:00
Lorenz Kästle
58bbf9f5af
Merge branch 'master' into fix/additional_tests 2026-04-09 11:05:03 +02:00
Lorenz Kästle
1db493092c
added CHECK_EOF to work around warnings about EOF and -1 being the same (#2254)
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
Co-authored-by: Andreas Baumann <mail@andreasbaumann.cc>
2026-04-08 18:26:03 +02:00
Lorenz Kästle
3a6f9292f1
Rename USE_OPENSSL to MOPL_USE_OPENSSL (#2253)
net-snmp uses the same pre processor name "USE_OPENSSL" as we do.
To avoid the conflict, this commit renames it on our side to
"MOPL_USE_OPENSSL".
"MOPL" (better "MoPl"?) stands for Monitoring Plugins.
2026-04-08 18:06:29 +02:00
Lorenz Kästle
613cb60c96
check_curl: Clean up (#2252)
* check_curl: remove unused variables

* check_curl: run formatter on related files

* check_curl_helpers: make code a bit more understandable

* check_curl helpers: general api cleanup and code style
2026-04-08 17:21:44 +02:00
Lorenz Kästle
ddd1bd9fbd
removed -Werror=declaration-after-statement from net-snmp-config --cflags causing trouble in check_snmp.c (#2250)
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
Co-authored-by: Andreas Baumann <mail@andreasbaumann.cc>
2026-04-07 14:13:38 +02:00
Lorenz Kästle
330d5eecac Pipe github test build output into nirvana 2026-04-07 13:27:13 +02:00
Lorenz Kästle
7c20cb9729
check_snmp: fixed falltrhough case in ASN_FLOAT/ASN_DOUBLE (#2249)
Co-authored-by: Andreas Baumann <mail@andreasbaumann.cc>
2026-04-07 13:16:59 +02:00
Lorenz Kästle
81345e3487
common.h: added guard to avoid warning when ENABLE_NLS is not defined (#2248)
Co-authored-by: Andreas Baumann <mail@andreasbaumann.cc>
2026-04-07 13:16:44 +02:00
Lorenz Kästle
ac6863dc27
Merge branch 'master' into fix/additional_tests 2026-04-07 13:09:44 +02:00
Lorenz Kästle
9980e78850
Add option to override output for check in lib for check_by_ssh (#2230)
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
The new output functionality was discussed in the context of
check_by_ssh, where it mostly adds more stuff which was seen as
not inherently usefull as a succesful check_by_ssh check
might as well be transparent.
2026-04-06 12:17:43 +02:00
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
Lorenz Kästle
a71ce15308
Handle rc_send_server in libfreeradius (#2246)
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-03-27 01:25:18 +01:00
Lorenz Kästle
0a8dfb8465
Merge branch 'master' into fix/additional_tests 2026-03-26 12:55:29 +01:00
Lorenz Kästle
13e14a6bfd
Update/gnulib 2026 03 (#2247)
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
* Sync with the 202601-stable Gnulib code (4a3650d887)

* Ignore more deps stuff in gnulib

* Remove autogenerated gnulib files

* Ignore more gnulib generated headers
2026-03-26 12:53:53 +01:00
Lorenz Kästle
1442054715 Merge branch 'master' into fix/additional_tests 2026-03-26 01:08:48 +01:00
Lorenz Kästle
9d8503f90e
make check_curl test a little less specific (#2245)
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
2026-03-26 01:07:00 +01:00
Lorenz Kästle
be5cafc787 check_snmp: renaming and diverse cleanups 2026-03-26 00:19:31 +01:00
Lorenz Kästle
b3b613f71c Ignore more gnulib deps files 2026-03-25 23:53:54 +01:00
Lorenz Kästle
49f6990359 Fix check_snmp state related tests 2026-03-25 23:53:36 +01:00
Lorenz Kästle
935f0ad2db Remove superflous make file variable 2026-03-25 11:32:45 +01:00
Lorenz Kästle
163eeeb043 utils.h: specify include more strictly 2026-03-25 11:32:06 +01:00
Lorenz Kästle
aefad3b7ff Improve some function declarations 2026-03-25 11:31:34 +01:00
Lorenz Kästle
2d15bc8c11 Ignore compiled test file 2026-03-24 15:05:12 +01:00
Lorenz Kästle
1a42bd8fe2 Fix path in plugin tests 2026-03-19 12:35:29 +01:00
Lorenz Kästle
e96c48bbba Re add check_ntp_peer tests 2026-03-19 12:09:48 +01:00