Commit graph

4692 commits

Author SHA1 Message Date
Lorenz Kästle
bd55d9cd2d check_icmp: Add missing line ending in help 2025-06-23 11:46:45 +02:00
Lorenz Kästle
8626d22fc5 check_icmp: trigger help before anything important 2025-06-23 11:44:46 +02:00
Lorenz Kästle
6ac0580a10 check_icmp: Add comment to config 2025-06-23 11:42:25 +02:00
Lorenz Kästle
622d7f4c89 check_icmp: add long options to help 2025-06-23 11:41:56 +02:00
Lorenz Kästle
bf67d5cb53 check_icmp: remove dead comment 2025-06-23 11:41:41 +02:00
Lorenz Kästle
771ccfa526 check_icmp: remove unnecessary variable 2025-06-23 11:41:24 +02:00
Lorenz Kästle
7e9519e0ad check_icmp: correct output strings 2025-06-23 10:59:21 +02:00
Lorenz Kästle
b08bafc45c check_icmp: remove paket_interval, was never used anyway 2025-06-23 10:52:56 +02:00
Lorenz Kästle
27d30c3df0 Fix typo 2025-06-23 10:34:12 +02:00
Lorenz Kästle
efba4f7654 check_icmp: cleanup some leftover comments 2025-06-23 10:32:24 +02:00
Lorenz Kästle
cd20cc0632 check_icmp: add long options, add output format option
This commit switches check_icmp from getopt to getopt_long
to provide long options too and (most importantly) homogenize
option parsing between the different plugins.
2025-06-23 10:17:28 +02:00
Lorenz Kästle
8ae415ee4c Improve check_icmp help output 2025-06-23 10:16:42 +02:00
Lorenz Kästle
b8580c18e3
Merge pull request #2125 from RincewindsHat/refactor/check_icmp
Refactor check_icmp:

 - Far less global variables
 - Proper IPv6/legacy IP dual stack functionality (allowed mixed v4/v6 hosts)
 - Improved readability/understandability
 - General cleanup
2025-06-20 11:29:07 +02:00
Lorenz Kästle
d2735eecd4 Fix number of tests 2025-06-20 10:53:46 +02:00
Lorenz Kästle
6bc2e75199 Fix test with weird arguments 2025-06-20 10:28:45 +02:00
Lorenz Kästle
2bea8e9522 check_icmp: Remove signal handling and timeouts
The timeout option was redundant in that the runtime
of check_icmp was always limited by the input parameters
and therefore timeout gets removed with this commit to
avoid that confusion.

The rest of the signal handlings was removed too, since
the added complexity does not provide sufficient returns.
If check_icmp gets a signal, it now dies like most other
programs instead of trying to save some things and return a
(arguably wrong) result.
2025-06-20 10:04:34 +02:00
Lorenz Kästle
20e938bb54 Override state with min_hosts_alive 2025-06-19 01:15:37 +02:00
Lorenz Kästle
b71cb430cb Implement flexible state override functions 2025-06-19 01:15:11 +02:00
Lorenz Kästle
ca954e4f76 Reintroduce min_hosts_alive 2025-06-19 00:55:41 +02:00
Lorenz Kästle
43ae5fbe2d Fix possible multiplication overflow? 2025-06-17 15:44:35 +02:00
Lorenz Kästle
f680cd7b88 Improve error detection for threshold parsers 2025-06-17 15:19:30 +02:00
Lorenz Kästle
916d3a52a0
Merge pull request #2129 from RincewindsHat/check_fping_5.3_options
Add fping 5.2 and 5.3 options to check_fping
2025-06-12 13:45:21 +02:00
Lorenz Kästle
a669b2531d Remove options if fping version is too low and die directly 2025-06-12 13:33:50 +02:00
Lorenz Kästle
19f409ac55 Remove unnecessary newline 2025-06-12 13:26:55 +02:00
Lorenz Kästle
f2c6ce08e3 check_fping: small style improvement 2025-06-12 11:53:06 +02:00
Lorenz Kästle
7247fc656a Implement new fping options for fping 5.2 and 5.3
fping 5.2 and 5.3 add some new useful command line options
which this commit add to check_fping.

These are:

 * --fwmark - sets a firewall mark in the packages to make them
   identifiable (fping 5.2)
 * --icmp-timestamp - fping uses ICMP timestamp instead of ICMP
   Echo (fping 5.2)
 * --check-source - fping discards replies which originate not from
   the target address (fping 5.2)

The fping release notes describe theses options ( https://github.com/schweikert/fping/releases )
in a little bit more detail.
Currently the help display for those options is only shown
when fping was available in the appropriate version during
compilation.
2025-06-12 11:13:59 +02:00
Lorenz Kästle
88683af1da Implement autoconf logic for fping version detection 2025-06-11 17:09:27 +02:00
Lorenz Kästle
1187374e74 Remove unused FPING6 variable 2025-06-11 13:11:04 +02:00
Lorenz Kästle
0f8690c19b Remove check_icmp text regex tests 2025-06-09 12:42:17 +02:00
Lorenz Kästle
dd93b1403a utils: Make fmt function for compiler 2025-05-18 19:19:23 +02:00
Lorenz Kästle
906e895c72 Format specifier fixes 2025-05-18 19:19:07 +02:00
Lorenz Kästle
738d58714d some more fixes 2025-05-18 19:11:14 +02:00
Lorenz Kästle
3b76fdc840 Fix typos 2025-05-18 18:48:49 +02:00
Lorenz Kästle
d92bbaef83 Some more fixes 2025-05-18 18:46:30 +02:00
Lorenz Kästle
b5de682309 WIP - check_icmp refactor 8 2025-05-18 18:10:25 +02:00
Lorenz Kästle
8f08e7ab3e WIP - check_icmp refactor 7 2025-05-18 14:44:31 +02:00
Lorenz Kästle
fbcd11acb7 Clang-format 2025-05-18 00:20:36 +02:00
Lorenz Kästle
a01d522c4c WIP - check_icmp refactor 6 2025-05-17 11:49:06 +02:00
Lorenz Kästle
322cd6f829 Lib: Add perfdata for char and unsigned char 2025-05-17 11:26:27 +02:00
Lorenz Kästle
6b86583e0d WIP - check_icmp refactor 5 2025-05-16 12:46:56 +02:00
Lorenz Kästle
af88e3ced3
Merge pull request #2115 from Firstyear/20250327-use-flags-fping
Improve handling of -4/-6
This changes the handling of `-4`/`-6` flags for check_fping to make it more explicit which IP stack is used in which case.
Additionally, the deprecated `fping6` command is removed wholesale and the explicit `-4`/`-6` flags are used instead.
2025-05-13 09:01:05 +02:00
Lorenz Kästle
b13f977807
Merge pull request #2124 from monitoring-plugins/fix_check_apt_const_char
changed filename in cmd_file_read to const char * (check_apt warning)
2025-05-09 11:57:53 +02:00
Andreas Baumann
ec47bbbda6 changed filename in cmd_file_read to const char * (check_apt warning) 2025-05-09 10:49:02 +02:00
Firstyear
da80da50d3
Merge branch 'master' into 20250327-use-flags-fping 2025-05-09 09:16:13 +10:00
Lorenz Kästle
22366b6958
Merge pull request #2123 from RincewindsHat/fix_do_not_deactivate_v6_in_ci
Do not explicitely disable IPv6 in the CI
2025-05-08 10:55:15 +02:00
Lorenz Kästle
236188e92f Do not explicitely disable IPv6 in the CI 2025-05-08 09:04:20 +02:00
William
1fb9300a2f Remove un-needed flags 2025-05-07 13:17:47 +10:00
William
58a3424511 Improve logic 2025-05-07 13:15:51 +10:00
William
a1472be883 Harden check with unspec 2025-05-07 13:15:51 +10:00
William
4acba2b3ec Improve handling of -4/-6
If fping is used with a target that has dual stack v4/v6, then due to
the logic during command construction, ipv4 will never be checked as v6
is preferred by fping.

This explicitly flags -4/-6 when it is requested by the user.
2025-05-07 13:15:51 +10:00