Commit graph

4866 commits

Author SHA1 Message Date
Lorenz Kästle
cadcfaecbe check_ntp_time: fix time-offset argument and description 2025-11-05 10:42:12 +01:00
Lorenz Kästle
16daa06e43 check_ntp_time: actually accept offset if known 2025-11-05 10:41:34 +01:00
Lorenz Kästle
b35853ee4e check_ntp_time: implement modern output 2025-11-04 12:08:59 +01:00
waja
bb9fcf5bfa
Merge pull request #2166 from monitoring-plugins/dependabot-github_actions-github-codeql-action-4
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
2025-10-08 06:33:34 +02:00
dependabot[bot]
33bd81b2b8
build(deps): bump github/codeql-action from 3 to 4
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-10-08 04:05:59 +00:00
Lorenz Kästle
ce10a6ff37
Merge pull request #2159 from RincewindsHat/check_snmp_remove_useless_headers
check_snmp: remove useless headers
2025-10-06 22:46:59 +02:00
Lorenz Kästle
ea8e421f4c
Merge pull request #2163 from RincewindsHat/check_mysql_more_renaming
More renaming due to MySQL name chances
2025-10-06 09:53:02 +02:00
Lorenz Kästle
392c945966 More renaming due to MySQL name chances
Due to MySQL changing several term in Version 8.0.22 the way to
determine the status of replicas has changed.
To adapt to these changes in a517dc614e
check_mysql was modified to adapt to different versions.
Some parts were missed though which results in failures to detect
the replica status properly.

This parts should be contained in this commit.
2025-09-30 14:51:45 +02:00
Lorenz Kästle
5cd31ffa6b check_snmp: remove useless headers 2025-09-26 18:14:44 +02:00
Lorenz Kästle
a516b5e96e
Merge pull request #2157 from sthen/fix_without_utmpx
fixes check_users build on OpenBSD (without utmpx)
2025-09-26 18:11:47 +02:00
Stuart Henderson
5fb0c08cec fixes check_users build on OpenBSD (without utmpx) 2025-09-26 12:51:42 +01:00
Lorenz Kästle
92f37f90c3
Merge pull request #2156 from RincewindsHat/check_mysql_server_info
check_mysql: Assume MySQL server by default (in replica check)
2025-09-26 09:23:48 +02:00
Lorenz Kästle
dbe417bdf9 check_mysql: Assume MySQL server by default (in replica check)
In the Debian Bug tracker (and then Github) a person pointed out,
that a MySQL server does not respond with a hint that is indeed the
MySQL software but only with the version string.
Which makes sense if one assumes to be the only implementation.

This commit changes the behaviour of the Replica check to assume
that the counterpart is a MySQL server if there are not hints that
it is a MariaDB server.
2025-09-26 09:07:18 +02:00
Lorenz Kästle
a51ff78f83
Merge pull request #2154 from RincewindsHat/new-output/check_cluster
check_cluster: new output functionality
2025-09-17 13:51:22 +02:00
Lorenz Kästle
88f316bb27 check_cluster: new output functionality 2025-09-17 11:25:13 +02:00
Lorenz Kästle
5ce7b57c74
Merge pull request #2151 from oxzi/check_by_ssh-ignore-stderr
check_by_ssh: Ignore output on stderr by default
2025-09-17 11:00:01 +02:00
Lorenz Kästle
1f20998d0c
Merge pull request #2148 from RincewindsHat/refactor/check_apt
Refactor/check apt: implement new output functionality
2025-09-16 14:31:19 +02:00
Lorenz Kästle
dab009654c fix default check state 2025-09-16 14:11:29 +02:00
Lorenz Kästle
c4716ad8d8 Fix check_apt tests 2025-09-16 14:11:13 +02:00
Lorenz Kästle
c1f0f113c9
Merge pull request #2153 from oxzi/check_swap-fix-bsd-svr4
check_swap: Fix Build At Least For OpenBSD
2025-09-16 12:22:18 +02:00
Alvar Penning
88036425d5
check_swap: Fix Build At Least For OpenBSD
Fix build of check_swap for both CHECK_SWAP_SWAPCTL_SVR4 and
CHECK_SWAP_SWAPCTL_BSD build guards.

> $ make check_swap
>   CC       check_swap.d/swap.o
> check_swap.d/swap.c:58:32: error: too few arguments to function call, single argument 'config' was not specified
>    58 |         return getSwapFromSwapctl_BSD();
>       |                ~~~~~~~~~~~~~~~~~~~~~~ ^
> ././check_swap.d/check_swap.h:48:13: note: 'getSwapFromSwapctl_BSD' declared here
>    48 | swap_result getSwapFromSwapctl_BSD(swap_config config);
>       |             ^                      ~~~~~~~~~~~~~~~~~~
> 1 error generated.
> *** Error 1 in [...]/monitoring-plugins/plugins (Makefile:2869 'check_swap.d/swap.o': @echo "  CC   ...)
2025-09-16 00:19:04 +02:00
Alvar Penning
4b3f684d33
check_by_ssh: Ignore output on stderr by default
check_by_ssh no longer returns UNKNOWN if ssh(1) returns data on stderr.
But it can be enforced again by the new "--unknown-on-stderr" option.

---

The default logic of check_by_ssh results in an UNKNOWN state if the
ssh(1) process produces output on stderr. Using the "--skip-stderr=[n]"
option allows ignoring a certain amount of lines or disabling this check
altogether. Furthermore, passing the "--warn-on-stderr" option reduces
the exit code to WARNING.

The "--help" output does not document this behavior, only states that
"--warn-on-stderr" will result in the WARNING, but does not mention the
UNKNOWN by default.

The man page of ssh(1) mentions that debug information is logged to
stderr. This conflicts with the described logic, resulting in
check_by_ssh to go UNKNOWN, unless additional options are set.

Starting with OpenSSH version 10.1, ssh(1) will report warnings to
stderr if the opposite server does not support post-quantum
cryptography, <https://www.openssh.com/pq.html>.

This change, slowly being rolled out throughout the next months/years,
might result in mass-breakages of check_by_ssh.

By introducing a new "--unknown-on-stderr" option, enforcing the prior
default logic of an UNKNOWN state for data on stderr, and ignoring
output on stderr by default, check_by_ssh will continue to work. One
might even argue that this change converges actual implementation and
the documented behavior, as argued above.

---

$ ssh example '/usr/lib/nagios/plugins/check_dummy 0 demo'
** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html
OK: demo

$ echo $?
0

$ ./check_by_ssh -H example -C '/usr/lib/nagios/plugins/check_dummy 0 demo'
OK: demo

$ echo $?
0

$ ./check_by_ssh -H example -C '/usr/lib/nagios/plugins/check_dummy 0 demo' --warn-on-stderr
Remote command execution failed: ** WARNING: connection is not using a post-quantum key exchange algorithm.

$ echo $?
1

$ ./check_by_ssh -H example -C '/usr/lib/nagios/plugins/check_dummy 0 demo' --unknown-on-stderr
Remote command execution failed: ** WARNING: connection is not using a post-quantum key exchange algorithm.

$ echo $?
3

---

Fixes #2147.
2025-09-15 22:20:08 +02:00
Lorenz Kästle
ff7305bdfe Merge branch 'master' into refactor/check_apt 2025-09-15 16:16:14 +02:00
Lorenz Kästle
601a48a63e
Merge pull request #2150 from RincewindsHat/refactor/lib
general refactorin in lib, more local variables, real booleans
2025-09-15 16:09:40 +02:00
Lorenz Kästle
15ecdb73ce Fix types in check_apt 2025-09-15 16:00:35 +02:00
Lorenz Kästle
811da10fda More refactoring 2025-09-15 15:49:26 +02:00
Lorenz Kästle
f855c5b5bb general refactorin in lib, more local variables, real booleans 2025-09-15 14:06:55 +02:00
Lorenz Kästle
8ef825d85f
Merge pull request #2149 from RincewindsHat/clang-format
Clang format
2025-09-15 13:18:17 +02:00
Lorenz Kästle
204cf956f0 Ignore some more built time files 2025-09-15 12:59:49 +02:00
Lorenz Kästle
802e46f8ea Run clang-format again 2025-09-15 12:59:37 +02:00
Lorenz Kästle
f07f96c3cf check_apt: implement new output 2025-09-15 12:40:24 +02:00
Lorenz Kästle
67c1aae749 check_apt: improve some variable types to make the linter happy 2025-09-15 10:46:22 +02:00
Lorenz Kästle
a3cf9041af
Merge pull request #2085 from RincewindsHat/refactor/check_curl
Refactor/check curl and introduce new output formatting
2025-09-15 10:13:33 +02:00
Lorenz Kästle
5a2c1b2c3a Add output formatting option 2025-09-15 02:30:42 +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
43c6332322 Fix typo in error message 2025-09-15 02:08:46 +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
afa81204dc check_curl: use new cert check function 2025-09-15 01:58:07 +02:00
Lorenz Kästle
f5f4a021a2 Add new cert check function 2025-09-15 01:57:40 +02:00
Lorenz Kästle
c15d12cbd5 check_curl: fix perfdata label 2025-09-15 01:57:08 +02:00
Lorenz Kästle
0bf5fdf41e check_curl: finish after cert without continue param 2025-09-15 01:56:46 +02:00
Lorenz Kästle
166ce184c6 Fix regex matching 2025-09-15 00:22:35 +02:00
Lorenz Kästle
def42dc686 Improve error message 2025-09-15 00:22:08 +02:00
Lorenz Kästle
6ae8ba9110 check_curl: test adaption and output adaption 2025-09-13 12:49:06 +02:00
Lorenz Kästle
9afb5e2a69 check_curl: remove display-html option 2025-09-13 12:28:49 +02:00
Lorenz Kästle
44b2a25a6b check_curl: implement new output mechanism 2025-09-12 16:37:24 +02:00
Lorenz Kästle
aaff3aa9da lib: some formatting + remove some unnecessary stuff 2025-09-12 16:36:48 +02:00
Lorenz Kästle
9c2ae47d44 check_curl: fix default redirect setting 2025-09-12 12:36:00 +02:00