Commit graph

2358 commits

Author SHA1 Message Date
RincewindsHat
7334812a92 check_curl: do not export local variables and remove unused ones 2024-10-31 03:05:43 +01:00
RincewindsHat
367c4f89c1 check_curl: Update copyright 2024-10-31 02:59:49 +01:00
RincewindsHat
80f07ff92b check_curl: clang-format 2024-10-31 02:58:41 +01:00
RincewindsHat
289f07d754 check_cluster: linter fixes 2024-10-31 02:57:07 +01:00
RincewindsHat
ebb453f55e check_cluster: do not export local symbols 2024-10-31 02:54:48 +01:00
RincewindsHat
a30f0c6c08 check_cluster: Copyright update 2024-10-31 02:53:01 +01:00
RincewindsHat
80ec3f0f04 check_cluster: clang-format 2024-10-31 02:51:49 +01:00
RincewindsHat
060bd01d89 check_by_ssh: linter fixes 2024-10-31 02:50:34 +01:00
RincewindsHat
ba47cca3ef check_by_ssh: do not export local symbols 2024-10-31 02:45:58 +01:00
RincewindsHat
744568f1f8 check_by_ssh: Copyright update 2024-10-31 02:44:09 +01:00
RincewindsHat
9f1ec43ce1 check_by_ssh: clang-format 2024-10-31 02:43:12 +01:00
RincewindsHat
05ad606c09 check_ups: clang-format again 2024-10-25 11:45:58 +02:00
RincewindsHat
4541b2b357 check_ups: clang-format again 2024-10-19 01:21:22 +02:00
RincewindsHat
3f7c533ce8 check_ups: Update copyright 2024-10-15 16:26:21 +02:00
RincewindsHat
b95e3d7446 check_ups: clang-format 2024-10-15 16:25:19 +02:00
Sven Nierlein
3b96044248 fix check_curl: OpenSSL SSL_read: error:0A000126:SSL routines::unexpected eof while reading, errno 0
using check_curl on a probably embedded device responding as 'Server: GoAhead-Webs'

    %> check_curl -H ... -S -vvv

    > GET / HTTP/1.1
    Host: ...
    User-Agent: check_curl/v2.4.0 (monitoring-plugins 2.4.0, libcurl/7.76.1 OpenSSL/3.0.7 zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.1 (+libidn2/2.3.0) libssh/0.10.4/openssl/zlib nghttp2/1.43.0)
    Accept: */*
    Connection: close

    * Mark bundle as not supporting multiuse
    * HTTP 1.0, assume close after body
    < HTTP/1.0 302 Redirect
    < Server: GoAhead-Webs
    < Date: Tue Mar 26 17:57:16 2019
    < Cache-Control: no-cache, no-store, must-revalidate,private
    < Pragma: no-cache
    < Expires: 0
    < Content-Type: text/html
    < X-Frame-Options: sameorigin
    < X-XSS-Protection: 1; mode=block
    < X-Content-Type-Options: nosniff
    < Location: https://...
    <
    * OpenSSL SSL_read: error:0A000126:SSL routines::unexpected eof while reading, errno 0
    * Closing connection 0

reading the discussion on https://github.com/openssl/openssl/discussions/22690 suggest to set the option SSL_OP_IGNORE_UNEXPECTED_EOF
which makes check_curl behave like check_http at this point.
Since this is a rather new flag, fencing it in ifdefs.
And since there can only be one ssl ctx function, we need to move both tasks into one function.
2024-10-10 15:54:28 +02:00
Lorenz Kästle
bc6dda5286
Merge branch 'master' into check_curl_regex_state 2024-10-06 17:28:08 +02:00
Lorenz Kästle
91fa55f971
Merge pull request #2021 from monitoring-plugins/check_disk_static_fixes
Check disk static fixes
2024-09-27 14:19:39 +02:00
Lorenz Kästle
fb5175aed6 check_disk: remove unused variables and functions 2024-09-27 13:53:24 +02:00
Lorenz Kästle
7ca72ecace check_disk: Declare global variables static
Variables only used in that specific translation unit should be static
to actually communicate that fact.
Also allows the compiler to detect unused (global) variables.
2024-09-27 13:51:21 +02:00
RincewindsHat
b1e96a3bf3 check_snmp: Remove unused PP-macros 2024-09-27 11:58:42 +02:00
RincewindsHat
3ba660889a check_snmp: Declare most variables as static 2024-09-27 11:57:38 +02:00
RincewindsHat
0fd0421052 check_ssh: set elapsed time properly
Previous to this commit, `elapsed_time` was only set after being read,
which was quite likely wrong and a bug.
This commit actually set the value before it is being read again.
2024-09-06 01:53:47 +02:00
Lorenz Kästle
a378134ddc
Merge pull request #2015 from RincewindsHat/fix/check_mysql_variables
check_mysql:
 * remove unused variables
 * convert two practical booleans to real `bool`
2024-09-06 01:51:23 +02:00
Lorenz Kästle
75d5c51207 Remove experimental state from check_curl 2024-08-29 18:20:35 +02:00
RincewindsHat
829ec76f00 check_ssh: Remove unused variable iteration 2024-08-28 23:40:22 +02:00
RincewindsHat
04115904ad check_ssh: Always initialize elapsed_time 2024-08-28 23:39:57 +02:00
Lorenz Kästle
4f7ee05786 check_mysql: Label some booleans correctly 2024-08-28 19:20:31 +02:00
Lorenz Kästle
584cca3a96 check_mysql: remove unused global variables 2024-08-28 19:19:16 +02:00
Lorenz Kästle
2b8b66d41e
Merge pull request #2001 from RincewindsHat/check_snmp_protocoll_documentation
Add more documentation to the help page of check_snmp regarding authe…
2024-08-28 10:21:12 +02:00
RincewindsHat
af097aa364 check_curl: change help for --state-regex again to fix formatting 2024-08-19 15:33:17 +02:00
RincewindsHat
b6c72064a5 check_curl: Parse state-regex option ignoring case
Previously the --state-regex option accepted only "critical" and
"warning" as values.
This commit changes the strcmp there to strcasecmp to be more tolerant
regarding the input.
2024-08-19 15:26:52 +02:00
RincewindsHat
46efe803cf check_curl: Fix help for state regex option
The help output of `check-curl` contained a typo,
the real option is `state-regex` and not `regex-state` as
the help suggests.
Also added the two possible options to avoid confusion.
2024-08-19 15:23:41 +02:00
Alvar Penning
9cdf2aec7f check_curl: Documentation for --certificate, --cookie-jar
From the mere help output for -C / --certificate, I was confused about
what its two integer parameters do. Unfortunately, I also missed out on
the explaining examples later. Since I like to have basic documentation
for each flag, I tried to make the arguments as short as possible.

The other fix was one hyphen too many for the --cookie-jar option.
2024-08-16 10:52:14 +02:00
Yannick Martin
78ce3144e3 check_curl: raise SSL issue when --continue-after-certificate is used
This change aims to raise the worst status between the SSL check and the HTTP check.

before:
check_curl -H www.google.fr -S --continue-after-certificate --certificate 4000,4000 ; echo $?
CRITICAL - Certificate '*.google.fr' expires in 74 day(s) (Tue 22 Oct 2024 12:53:52 PM GMT +0000).
HTTP OK: HTTP/2 200  - 22807 bytes in 0.076 second response time |time=0.075516s;;;0.000000;10.000000 size=22807B;;;0;
0

after:
/usr/lib/nagios/ovh/check_curl -H www.google.fr -S --continue-after-certificate --certificate 4000,4000 ; echo $?
CRITICAL - Certificate '*.google.fr' expires in 74 day(s) (Tue 22 Oct 2024 12:53:52 PM GMT +0000).
HTTP OK: HTTP/2 200  - 22840 bytes in 0.090 second response time |time=0.090463s;;;0.000000;10.000000 size=22840B;;;0;
2
2024-08-11 22:18:28 +02:00
Sven Nierlein
acbfbf3de6 check_curl: fix relative redirects on non-standard port
Having a webserver respond with a relative redirect as for ex. in `Location: /path/to.html`
check_curl would use the wrong standard http/https port instead
of crafting the absolute url using the given scheme/hostname and port.

Adding a new test case for this for check_http and check_curl. check_http did
it correct already, so no fix necessary there.

before:

    %>./check_curl -H 127.0.0.1 -p 50493 -f follow -u /redirect_rel -s redirected -vvv
    **** HEADER ****
    HTTP/1.1 302 Found
    ...
    Location: /redirect2

    ...
    * Seen redirect location /redirect2
    ** scheme: (null)
    ** host: (null)
    ** port: (null)
    ** path: /redirect2
    Redirection to http://127.0.0.1:80/redirect2

fixed:

    %>./check_curl -H 127.0.0.1 -p 50493 -f follow -u /redirect_rel -s redirected -vvv
    **** HEADER ****
    HTTP/1.1 302 Found
    ...
    Location: /redirect2

    ...
    * Seen redirect location /redirect2
    ** scheme: (null)
    ** host: (null)
    ** port: (null)
    ** path: /redirect2
    Redirection to http://127.0.0.1:50493/redirect2

Signed-off-by: Sven Nierlein <sven@nierlein.de>
2024-07-30 17:13:03 +02:00
Sven Nierlein
562deb749a
Merge branch 'master' into check_curl_features 2024-07-23 21:09:21 +02: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
Lorenz Kästle
86053441b6
check_ups: additional alarm conditions (#1961)
* check_ups:
   * Update copyright
   * General refactoring
   * code formatting
   * Add ALARM state from ups -> Critical
  * Set some more states to be warnings
2024-07-12 16:49:28 +02:00
RincewindsHat
26a979284d Fix typos 2024-05-21 14:27:21 +02:00
RincewindsHat
c862f705f3 Add more documentation to the help page of check_snmp regarding authentication and privacy options 2024-05-21 13:59:45 +02:00
Napsty
3deea4cc63 Adjust check_swap tests 2024-04-12 16:50:15 +02:00
Napsty
60614121d1 Adjust check_swap tests 2024-04-12 16:50:15 +02:00
Napsty
675f208476 Adjust check_swap tests 2024-04-12 16:50:15 +02:00
Napsty
9b4fab0664 Allow single threshold 2024-04-12 16:50:15 +02:00
Napsty
ee0f70486f Possibility to run check_swap without thresholds 2024-04-12 16:50:15 +02:00
Andreas Baumann
f29785f503 check_http/check_curl: added a --regex-state option to change the state of a regex check
from the default CRITICAL to something else (#1213)
2024-04-07 20:01:54 +02:00
Andreas Baumann
4c4031100a check_curl/check_http: clarified format of POST data (#1978) 2024-04-07 19:30:26 +02:00
Lorenz Kästle
7da6286995
check_load: remove unused code (#1998)
adaugherity noticed in issue #1965, that HAVE_PROC_LOADAVG is never
defined since the symbol was removed from configure quite some time ago.
This commit removes the dead code which would be used when the symbol
would have been defined.
2024-04-07 02:51:58 +02:00
Lorenz Kästle
d3faf13961
check_disk: Fail on missing arguments for --warning and --critical and fix a test case (#1935)
* check_disk: Fail on missing arguments for --warning and --critical
* Add new test function for percentage expressions and use it in check_disk
* Add error abort in tests if they fail to parse output
* Fix typo in test which probably broke the test since forever :-(
2024-03-27 00:36:41 +01:00
Lorenz Kästle
66f62dd336
check_ssh: patches from op5 (#1738)
* check_ssh: properly parse a delayed version control string

This resolves an issue with SSH servers which do not respond with their
version control string as the first thing in the SSH protocol version
exchange phase after connection establishment.

This patch also makes sure that we disregard a potential comment in the
version exchange string to avoid nonsense mismatches. In the future, we
might want to add the capability to match against a user specified comment.

In addition, the patch largely improves the communication towards the
server, which adds better protocol adherence.

Of course, new test cases are added to support the trigger and guard
against regressions of the bugs solved by this patch.

This fixes op5#7945 (https://bugs.op5.com/view.php?id=7945)

Signed-off-by: Anton Lofgren <alofgren@op5.com>

* check_ssh.t: Fix a few typos

Signed-off-by: Anton Lofgren <alofgren@op5.com>

* check_ssh: Handle non-alpha software versions

This patch fixes a bug where we would reject version control strings
that do not contain letters, because the assumption is made that they
always do. This is not required by the RFC however, and there exist
implementations that do not contain letters.

I've also added a few references to the RFC to make the process of
parsing the control string more apparent.

This fixes op5#8716 (https://bugs.op5.com/view.php?id=8716)

Signed-off-by: Anton Lofgren <alofgren@op5.com>

* check_ssh: Fix a typo in "remote-protocol parameter

remote-protcol -> remote-protocol

Signed-off-by: Anton Lofgren <alofgren@op5.com>

* Remove unused variable

* Formating fixes

* Update translations

* Remove merge conflict artefact from previous merge

* Set fixed include paths

* Improve code style to be slightly more readable

* Update test cases for different netcat behaviour and reduce sleep time

---------

Signed-off-by: Anton Lofgren <alofgren@op5.com>
Co-authored-by: Anton Lofgren <alofgren@op5.com>
2024-03-27 00:35:16 +01:00
Lorenz Kästle
8698a6d976
check_swap: replace another fake boolen and small improvements (#1996)
* check_swap: Change another fake boolen to a real one

* check_swap: Rename type since *_t is reserved for C standard types

* check_swap: Update copyright
2024-03-23 11:22:06 +01:00
waja
152acfabcf
check_nwstat: adds percentage used space (#1183)
* check_nwstat: adds percentage used space

This adds the new VPU parameter to the check_nwstat plugin.
This parameter returns the percentage used space on a Netware volume.
Now you can monitor your Netware volumes easy. We use it with a warning
85% and critical 90%.
eg: check_nwstat -H your.netware.host -v VPUvol1 -c 85 -w 90 returns
324653 MB (95%) used on volume vol1 - total 340212 MB|Used space in percent
on vol1=95;90;80;0;100.

* check_nwstat: Fixing whitespaces and tabs

* Update translation files

* check_nwstat: Use C99 booleans also with the patch

* Some formatting

---------

Co-authored-by: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com>
2024-03-23 11:02:18 +01:00
Sven Nierlein
117cd8e4b8
check_disk increase alert precision (#1989)
* check_disk increase alert precision

Free disk percentage value was rounded to a full integer meaning it alerted about ~1% percent too early. This is about 10GB on a 1TB disk.
The warning and critical thresholds already support float values, so just the percentage calculation needs to be improved.

old:

    ./check_disk -w 35% -c 20% -p / -f -vvv
    Thresholds(pct) for / warn: 35.000000 crit 20.000000
    calling stat on /
    For /, used_pct=65 free_pct=35 used_units=286451 free_units=156651 total_units=443102 used_inodes_pct=11 free_inodes_pct=89 fsp.fsu_blocksize=4096 mult=1048576
    Freespace_units result=0
    Freespace% result=1
    Usedspace_units result=0
    Usedspace_percent result=0
    Usedinodes_percent result=0
    Freeinodes_percent result=0
    DISK WARNING - free space: WARNING [ / 156651MiB (35% inode=89%)];| /=300365643776B;302006979788;371700898201;0;464626122752

new:

    ./check_disk -w 35% -c 20% -p / -f -vvv
    Thresholds(pct) for / warn: 35.000000 crit 20.000000
    calling stat on /
    For /, used_pct=64.649722 free_pct=35.350278 used_units=286464 free_units=156637 total_units=443102 used_inodes_pct=10.016183 free_inodes_pct=89.983817 fsp.fsu_blocksize=4096 mult=1048576
    Freespace_units result=0
    Freespace% result=0
    Usedspace_units result=0
    Usedspace_percent result=0
    Usedinodes_percent result=0
    Freeinodes_percent result=0
    DISK OK - free space: / 156637MiB (35.4% inode=90%);| /=300379275264B;302006979788;371700898201;0;464626122752

* check_disk: adjust test case to support float precision
2024-02-23 18:24:28 +01:00
Lorenz Kästle
f6d7bf8656
Merge pull request #1987 from euniceremoquillo/Improve-negate-plugin-helptext
Improve negate plugin helptext
2024-02-12 16:26:43 +01:00
Eunice Remoquillo
2ab03d5f9c Added indentions for readability 2024-02-12 19:33:38 +08:00
Eunice Remoquillo
d2df046481 Improve negate plugin helptext
This commit updates the negate plugin's helptext as it is currently ambiguous.
2024-02-12 10:59:18 +08:00
Emmanuel Riviere
61218b2fdc check_curl: add haproxy protocol option 2024-02-01 16:08:16 +01:00
RincewindsHat
5275f81e38 check_snmp: Remove unused variable 2023-12-29 00:47:29 +01:00
RincewindsHat
ad864430b0 check_http: Remove self assignment of a variable and add some comments 2023-12-29 00:45:54 +01:00
RincewindsHat
c1c9abbfca Change iritating NULL assignment 2023-12-29 00:45:14 +01:00
Sven Hartge
c3ab362f87 check_procs: Generalise wording, remove mentioning of nrpe 2023-12-04 16:40:34 +01:00
Sven Hartge
45f633ef23 check_procs: Improve help text, mentioning excluded processes
Also reindent the code, converting stray tabs to 2 spaces.
2023-12-04 14:33:36 +01:00
Sven Hartge
897e4a8409 check_procs: ignore our own children
On systems with higher core counts check_procs will occasionally see
its own "ps" child process with a high CPU percentage and raise a
false alarm.

Ignoring the child processes of check_procs prevents this from happening.
2023-11-28 13:21:05 +01:00
Sven Nierlein
579db5a930 check_disk: fix ignore-missing in combination with includes (fixes #1963)
Using --ignore-missing together with regex matching and ignore option lead
to a wrong error message.

    ./check_disk -n -w 10% -c 5% -W 10% -r /dummy -i /dummy2
    DISK UNKNOWN: Paths need to be selected before using -i/-I. Use -A to select all paths explicitly

The use case here is a cluster with fail-over mounts. So it is a valid situation that
the regex match does not find anything in addtition with a ignore which also does not exist.

After this patch:

    ./check_disk -n -w 10% -c 5% -W 10% -r /dummy -i /dummy2
    DISK OK - No disks were found for provided parameters|
2023-11-27 13:04:10 +01:00
Sven Nierlein
f59c516011 check_disk: add -n short option for --ignore-missing
Signed-off-by: Sven Nierlein <sven@consol.de>
2023-11-27 13:04:10 +01:00
RincewindsHat
4f4fb3d9af check_dns: Remove unused variable 2023-11-23 00:12:49 +01:00
RincewindsHat
479ff15249 check_ntp_peer: Fixes for Wmaybe-unitialized and some restructuring 2023-11-23 00:11:39 +01:00
RincewindsHat
1b06060cbc Fix logic in is_uint64_t to fix type-limit warning 2023-11-23 00:07:02 +01:00
Lorenz Kästle
53a15f0c2c
Merge pull request #1951 from RincewindsHat/compiler_warnings_maybe_unused
Fix compiler warning for uninitialized variable
2023-11-22 23:34:59 +01:00
Lorenz Kästle
f1e91405c3
Merge pull request #1958 from RincewindsHat/check_users_fix_segfault
check_users: fix segfault
2023-11-12 02:31:24 +01:00
Louis Sautier
eebb280ca3
check_ups: output ups.realpower if supported 2023-11-10 00:08:49 +01:00
RincewindsHat
a9d77ac545 check_users: Update help to properly show that thresholds are ranges 2023-10-31 01:51:27 +01:00
RincewindsHat
d9a999de7b Enhance tests to check wheter the option validation works 2023-10-31 01:50:46 +01:00
RincewindsHat
cff821257b check_users: Change option for sanity checking arguments to avoid segfault 2023-10-31 01:47:26 +01:00
Lorenz Kästle
77e38ac1c0
Merge pull request #1953 from RincewindsHat/compiler_warnings-sign-compare
Fixes for -Wsign-compare
2023-10-29 11:09:00 +01:00
RincewindsHat
eead88edda check_tcp: Fixes an error with using the wrong type for a variable 2023-10-19 13:47:21 +02:00
RincewindsHat
81f3b41651 Fix fallout of the previous changes 2023-10-19 12:20:27 +02:00
RincewindsHat
07f9c438f3 Fixes for -Wsign-compare 2023-10-19 12:10:55 +02:00
RincewindsHat
7ba8463506 check_ntp: Initialize intermediate results in any case 2023-10-19 11:59:43 +02:00
RincewindsHat
0ab5e10d9b check_curl: Initialize pointer before usage 2023-10-19 11:55:11 +02:00
RincewindsHat
decca6d290 check_smtp: Restore behaviour pre ead5526efa regarding -D and TLS 2023-10-19 11:31:28 +02:00
RincewindsHat
0c92b39083 check_dbi: Fix compiler warning for uninitialized variable 2023-10-19 11:14:23 +02:00
RincewindsHat
efe79595d3 check_ntp: Use C99 booleans 2023-10-19 10:22:40 +02:00
RincewindsHat
93a4bae90d Revert "check_ntp: Use C99 booleans"
This reverts commit ca5af12f94.
2023-10-19 10:18:12 +02:00
RincewindsHat
d820929dd8 check_smtp: little fix for C99 booleans missed earlier 2023-10-19 10:17:28 +02:00
RincewindsHat
531e0f9427 check_ntp_time: Use C99 booleans 2023-10-19 10:04:24 +02:00
RincewindsHat
a3d76fed02 Revert "check_ntp_time: Use C99 booleans"
This reverts commit c849536609.
2023-10-19 09:53:37 +02:00
RincewindsHat
0722dbfb8a check_swap: Use C99 booleans 2023-10-18 20:58:18 +02:00
RincewindsHat
163ad151b9 check_smtp: Use C99 booleans 2023-10-18 20:55:22 +02:00
RincewindsHat
369d98cc36 plugins/utils: Use C99 booleans 2023-10-18 20:51:23 +02:00
RincewindsHat
a51e8f82e7 plugins/netutils: Use C99 booleans 2023-10-18 20:46:16 +02:00
RincewindsHat
c2ceefd783 check_negate: Use C99 booleans 2023-10-18 20:42:25 +02:00
RincewindsHat
fd67d1e344 check_users: Use C99 booleans 2023-10-18 20:40:24 +02:00
RincewindsHat
6d62fea757 plugins/common.h: Remove superflous TRUE/FALSE definitions 2023-10-18 20:38:34 +02:00
RincewindsHat
bbd2bd2fa7 check_ups: Use C99 booleans 2023-10-18 20:37:17 +02:00
RincewindsHat
3aff9c8d13 check_time: Use C99 booleans 2023-10-18 20:33:06 +02:00
RincewindsHat
00d58ad187 check_tcp: Use C99 booleans 2023-10-18 20:29:31 +02:00
RincewindsHat
51db32cc1d check_ssh: Use C99 booleans 2023-10-18 20:24:13 +02:00
RincewindsHat
d4539f8662 check_snmp: Use C99 booleans 2023-10-18 20:22:06 +02:00
RincewindsHat
9ccb98aeb5 check_real: Use C99 booleans 2023-10-18 20:19:35 +02:00
RincewindsHat
555902bf76 check_radius: Use C99 booleans 2023-10-18 20:15:30 +02:00
RincewindsHat
47d3e156c5 check_ping: Use C99 booleans 2023-10-18 17:29:43 +02:00
RincewindsHat
9274b6db8b check_pgsql: Use C99 booleans 2023-10-18 17:26:43 +02:00
RincewindsHat
e3cc83f6ae check_overcr: Use C99 booleans 2023-10-18 17:21:35 +02:00
RincewindsHat
03dfd8f5b6 check_nwstat: Use C99 booleans 2023-10-18 17:18:53 +02:00
RincewindsHat
c849536609 check_ntp_time: Use C99 booleans 2023-10-18 17:15:19 +02:00
RincewindsHat
a7e494192d check_ntp_peer: Use C99 booleans 2023-10-18 17:11:21 +02:00
RincewindsHat
ca5af12f94 check_ntp: Use C99 booleans 2023-10-18 17:01:59 +02:00
RincewindsHat
1ba64fb566 check_nt: Use C99 booleans 2023-10-18 16:54:48 +02:00
RincewindsHat
ee80cc2591 check_dns: Another C99 boolean 2023-10-18 16:54:33 +02:00
RincewindsHat
6fc6e86994 check_mysql_query: Use C99 booleans 2023-10-18 16:48:05 +02:00
RincewindsHat
0b389d636e check_mysql: Use C99 booleans 2023-10-18 16:40:51 +02:00
RincewindsHat
45893377bd check_mrtgtraf: Use C99 booleans 2023-10-18 16:39:13 +02:00
RincewindsHat
790374c3b1 check_mrtg: Use C99 booleans 2023-10-18 16:37:36 +02:00
RincewindsHat
82f391085d check_ldap: Use C99 booleans 2023-10-18 16:35:56 +02:00
RincewindsHat
58123356d5 check_ide_smart: Use C99 booleans 2023-10-18 16:33:39 +02:00
RincewindsHat
7ef12f5510 check_game: Use C99 booleans 2023-10-18 16:30:59 +02:00
RincewindsHat
4a6c5ecc94 check_fping: Use C99 booleans 2023-10-18 16:27:28 +02:00
RincewindsHat
a964f87d14 check_dns: Use C99 booleans 2023-10-18 16:22:45 +02:00
RincewindsHat
b6796d9172 check_disk: Use C99 booleans 2023-10-18 16:16:44 +02:00
RincewindsHat
bafe2c2ceb check_dig: Use C99 booleans 2023-10-18 16:14:01 +02:00
RincewindsHat
2f29f45e10 check_by_ssh: Use C99 booleans 2023-10-18 16:12:41 +02:00
RincewindsHat
6972242126 Fixes for compiler warning -Wparentheses 2023-10-16 00:45:33 +02:00
RincewindsHat
ceb614aad4 fix compiler warnings for unused variables 2023-10-15 19:11:40 +02:00
RincewindsHat
928e1c7496 Whitespace fixes 2023-10-15 15:11:07 +02:00
RincewindsHat
fa3b80ce7d Fix -Wcast-function-type compiler warnings 2023-10-15 15:10:27 +02:00
RincewindsHat
09923e8a0f Fix missing include in plugins/runcmd.c 2023-10-07 23:31:59 +02:00
Lorenz Kästle
be0e475339
Merge pull request #1904 from Al2Klimov/1857
check_disk: interpret -X' arg as pattern, not literal
2023-10-05 10:52:03 +02:00
RincewindsHat
e1e1291b72 Fix some more typos 2023-10-03 22:22:51 +02:00
Lorenz Kästle
819f90b726 check_disk: Change usage for --include-type to indicated regexes are now possible 2023-10-01 00:41:55 +02:00
Lorenz Kästle
6947a8cea9 check_disk: Use regex also to include fs types 2023-09-30 12:54:21 +02:00
Alexander A. Klimov
4bb444f335 check_disk: make -X a regex list 2023-09-28 13:20:24 +02:00
RincewindsHat
513929d796 Remove check for RETSIGTYPE in autoconf stuff
autoupdate tells me, that since C89 I can safely assume RETSIGTYPE
is void.

Therefore to simplify things I removed the corresponding configure.ac
line and replaced all mentions of RETSIGTYPE with void.
2023-09-23 12:31:33 +02:00
RincewindsHat
4295decfbf open_max is a library function now, it should be mp_open_max 2023-09-23 10:33:06 +02:00
RincewindsHat
7fd0e6f36d Rework maxfd/open_max to avoid unused variables 2023-09-22 15:22:57 +02:00
Lorenz Kästle
2ef36843ab Add -C to general usage hints 2023-09-21 12:09:10 +02:00
RincewindsHat
8faf7afad3 check_disk: Add some general usage hints 2023-09-21 12:09:10 +02:00
RincewindsHat
b01aa8c433 check_disk: More spacing to separate examples 2023-09-21 12:09:10 +02:00
RincewindsHat
2f916675b3 check_disk: Mention -A and long options in error message about missing thresholds 2023-09-21 12:09:10 +02:00
RincewindsHat
3e8fdf9b35 check_disk: Fix printf format string 2023-09-21 12:09:10 +02:00
Lorenz Kästle
d5d0b50e89
Merge branch 'master' into compiler_warning_part_3 2023-09-21 09:22:33 +02:00
Lorenz Kästle
220455a11e
Merge pull request #1870 from RincewindsHat/compiler_warning_part_5
Compiler warning part 5
2023-09-19 11:06:39 +02:00
RincewindsHat
0e70e81133 Merge branch 'master' into mysql_detect_mysqldump 2023-09-18 22:59:46 +02:00
RincewindsHat
ce355c80cf Initialize slaveresult to 0 and use strncat instead of bsd strlcat 2023-09-18 22:58:34 +02:00
RincewindsHat
c405dbafcc Add mysql_close to avoid spamming the server logs 2023-09-18 19:18:35 +02:00
RincewindsHat
53ea2304aa check_disk: Remove some dead variables 2023-09-12 00:50:55 +02:00
Lorenz Kästle
ab493d5515
Merge branch 'master' into compiler_warning_part_3 2023-09-07 16:10:33 +02:00
Lorenz Kästle
fe239bf1c4
Merge branch 'master' into compiler_warning_part_5 2023-09-07 16:10:20 +02:00
Lorenz Kästle
128910f79a
Merge branch 'master' into patch-chunk-nobody 2023-09-07 16:08:21 +02:00
RincewindsHat
f5acd14048 check_radius: Change help to emphasize the necessity of a config file 2023-09-05 00:00:09 +02:00
Franz Schwartau
06ebad8399 check_smtp: add tests for --ssl 2023-08-30 15:04:32 +02:00
Franz Schwartau
8fa9370a0c Rename test variables for upcoming new variables with the same name 2023-08-30 15:04:32 +02:00
Lorenz Kästle
aa76eece10
Merge branch 'master' into compiler_warning_part_5 2023-08-30 09:36:53 +02:00
Franz Schwartau
ce96ef868a check_smtp: Let port option always take precedence
Otherwise -s/--ssl would overwrite a port given with -p if it comes
after it, e. g.

check_smtp -H mailhost.example.com -p 4465 --ssl

Found-By: Lorenz Kästle
2023-08-29 09:46:50 +02:00
Franz Schwartau
079c300dcc check_smtp: add new longoption --tls
This is an alias for -s/--ssl.
2023-08-29 09:46:50 +02:00
Franz Schwartau
da81dd3cf2 check_smtp: remove restriction of --proxy with --ssl 2023-08-29 09:46:50 +02:00
Franz Schwartau
e823896d8a check_smtp: set default port to smtps (465) for TLS
The port can still be set with -p.
2023-08-29 09:46:50 +02:00
Franz Schwartau
ead5526efa Add support for SMTP over TLS
This is commonly used on smtps (465) port.

PROXY protocol is not implemented with TLS in check_smtp.c, yet.

Backported from nagios-plugins:
0a8cf08ebb
2023-08-29 09:46:50 +02:00
Lorenz Kästle
55c0e1738e Merge remote-tracking branch 'upstream/master' into fix/repair_test_pipeline 2023-08-28 15:16:30 +02:00
Thorsten Kukuk
801784ae89 check_users: prefer systemd-logind over utmp
Prefer systemd-logind over utmp to get the number of logged in users.
utmp is not reliable for this (e.g. some terminals create utmp entries,
other not) and utmp is not Y2038 safe with glibc on Linux.
2023-08-28 14:55:56 +02:00
Lorenz Kästle
9e32be80d6 Remove dead, commented code 2023-08-28 11:15:59 +02:00
Lorenz Kästle
c6abf11e02 Enhance regex in test to be more tolerant to follow up text 2023-08-28 10:31:21 +02:00
RincewindsHat
94a5eb218d Update test to ignore broken MIBs 2023-08-27 23:13:50 +02:00
RincewindsHat
90cb539595 Implement option to ignore mib file parsing errors 2023-08-27 23:13:17 +02:00
Thoralf Rickert-Wendt
a6802bd5f5
Fix issue #1872 2023-08-08 10:22:53 +02:00
Lorenz Kästle
c47f44d897
Merge branch 'master' into compiler_warning_part_5 2023-07-23 22:19:34 +02:00
Lorenz Kästle
7c3098270c
Merge branch 'master' into check_swap_scanf_expressions 2023-07-23 21:58:13 +02:00
Lorenz Kästle
e4b6e83264
Merge branch 'master' into compiler_warning_part_6 2023-07-11 23:08:31 +02:00
Lorenz Kästle
068c124f36 Detect if fmtstr was set in edge cases 2023-07-11 16:39:29 +02:00
waja
265a7c0ed8
Merge branch 'master' into compiler_warning_part_2 2023-06-28 16:39:27 +02:00
waja
103217831e
Merge branch 'master' into compiler_warning_part_3 2023-06-28 16:39:09 +02:00
waja
4f4dd3a7a3
Merge branch 'master' into compiler_warning_part_5 2023-06-28 16:38:43 +02:00
waja
9ef6660cab
Merge branch 'master' into compiler_warning_part_6 2023-06-28 16:38:22 +02:00
waja
c22c277b3d
Merge branch 'master' into check_swap_scanf_expressions 2023-06-28 16:37:55 +02:00
Arkadiusz Miśkiewicz
252272344e Add support for SNI in check_smtp.
Add support for SSL/TLS hostname extension support (SNI) for check_smtp
plugin.

Backported from nagios-plugins:
9f1628f4b5
2023-06-12 23:18:20 +02:00
Franz Schwartau
d762fb1374 check_smtp: update year in copyright header 2023-06-12 22:09:54 +02:00
Franz Schwartau
6d5e81fcba check_smtp: add missing -r option in usage 2023-06-12 21:49:42 +02:00
Patrick Uiterwijk
ce85affd20 check_smtp: Add option to prefix PROXY header
This enables checks of SMTP servers that expect the haproxy
PROXY protocol:  -o smtpd_upstream_proxy_protocol=haproxy.

Backported from nagios-plugins:
3246efe923
2023-06-12 21:49:42 +02:00
Lorenz
d01740f22e
Merge pull request #1884 from RincewindsHat/check_disk_iec_units
check_disk: Display SI units correctly
2023-06-12 10:59:06 +02:00
Platon Pronko
1086326532 check_mysql: handle ER_ACCESS_DENIED_NO_PASSWORD_ERROR if ignore_auth=1
In some situations MySQL might return ER_ACCESS_DENIED_NO_PASSWORD_ERROR
instead of ER_ACCESS_DENIED_ERROR. Semantically these errors are the same.
2023-05-30 15:35:39 +08:00
RincewindsHat
bf8eb6dcc7 check_disk: Display SI units correctly 2023-05-26 08:45:00 +02:00
Lorenz
1bce93b28a
Merge branch 'master' into check_swap_scanf_expressions 2023-05-22 00:57:31 +02:00
Lorenz
b3e066a82e
Merge pull request #1486 from philipowen/feature/pgsql-extra-info
check_pgsql: Add extra output
2023-05-10 14:04:15 +02:00
Lorenz
b784428cdd
Merge pull request #1875 from RincewindsHat/file_encodings
check_nt: change encoding from latin1 to utf8
2023-05-08 21:15:36 +02:00
Lorenz
869cca59d8
Merge pull request #1866 from RincewindsHat/compiler_warning_part_1
Compiler warning part 1
2023-05-08 20:24:11 +02:00
Lorenz Kästle
d10ee31d89 Typo in check_mysql 2023-04-28 16:51:39 +02:00
Lorenz
fcf68d702e
Update plugins/check_nt.c
Co-authored-by: datamuc <m@rbfh.de>
2023-04-27 00:42:30 +02:00
Lorenz Kästle
a359667f2b Changing remaining sscanf format specifier to unsigned long 2023-04-26 18:19:23 +02:00
Lorenz Kästle
b2659391ab check_nt: change encoding from latin1 to utf8 2023-04-26 10:13:51 +02:00
Lorenz Kästle
b96a8424f0 Avoid unnecessary malloc and use stack instead 2023-04-26 09:15:04 +02:00
RincewindsHat
cb55797937 Refix spelling issues 2023-04-18 00:42:20 +02:00
RincewindsHat
b4e578e2cd Try fixing deprecated functions in libdbi 2023-04-18 00:37:46 +02:00
RincewindsHat
6d341c40ab Fixes for Waddress
* check_snmp: Fix string comparison
2023-04-18 00:35:41 +02:00
RincewindsHat
a00c412e7b Fixes for -Wnonnull-compare 2023-04-18 00:35:09 +02:00
RincewindsHat
8700f49716 Replace deprecated TLS client functions 2023-04-18 00:22:25 +02:00
RincewindsHat
d271819149 Fixes for -Wrestrict 2023-04-18 00:20:39 +02:00
RincewindsHat
907b933a87 Fixes for -Wunused-parameters 2023-04-18 00:20:12 +02:00
RincewindsHat
f7687d47cb Fixes for -Wimplicit-fallthrough 2023-04-18 00:18:07 +02:00
RincewindsHat
6c78f0b5ea Fixes for -Wunused
* lib/utils_base.c
* plugins/check_curl.c
* plugins-root/check_dhcp.c
   Removed a line which theoretically can not do anything, but there was
   comment which indicated something else. Still trying this though.
2023-04-18 00:13:24 +02:00