Commit graph

186 commits

Author SHA1 Message Date
RincewindsHat
aba1ef97f3 Change function type of get_thresholds to better reflect the options and describe it in general 2023-10-06 16:04:43 +02:00
RincewindsHat
d54588eaf0 Update comment 2023-10-06 15:19:33 +02:00
RincewindsHat
6d7d9a87aa Refactor get_threshold2 to be barely understandable 2023-10-06 15:08:52 +02:00
Danijel Tasov
1ad7e163fa check malloc 2023-10-06 10:54:20 +02:00
Danijel Tasov
e365f9f58e do not introduce new ints as bools 2023-10-06 10:54:03 +02:00
datamuc
9280b0eee2
Merge branch 'master' into merge-jitter 2023-10-04 14:02:25 +02:00
Danijel Tasov
dfa5aa4b83 unnecessary space
Signed-off-by: Danijel Tasov <m@rbfh.de>
2023-10-04 11:56:23 +02:00
Danijel Tasov
1f49981982 readability improvements
Signed-off-by: Danijel Tasov <m@rbfh.de>
2023-10-04 11:52:09 +02:00
Danijel Tasov
843c0bfa46 remove sun ifdef
my be readded later with proper comments

Signed-off-by: Danijel Tasov <m@rbfh.de>
2023-10-04 11:45:16 +02:00
Danijel Tasov
4e7eb55079 add some basic tests for the new modes
Signed-off-by: Danijel Tasov <m@rbfh.de>
2023-10-04 11:34:25 +02:00
Danijel Tasov
df57a23e0a update failure regex 2023-10-04 10:39:30 +02:00
Danijel Tasov
6585711b0b fix host count on when checking multiple hosts 2023-10-04 10:22:35 +02:00
Danijel Tasov
396bcf50ce adjust check_icmp tests 2023-10-04 10:21:41 +02:00
RincewindsHat
9f9f5fd9b2 Update copyright 2023-10-01 14:05:59 +02:00
RincewindsHat
f2ed728823 Remove trailing lines 2023-10-01 14:03:44 +02:00
RincewindsHat
11487d161c Comment some endifs to make comprehension easier 2023-10-01 14:03:34 +02:00
RincewindsHat
1aaa238503 Use real booleans 2023-10-01 13:59:00 +02:00
RincewindsHat
0751063918 Homogenize whitespace usage 2023-10-01 13:55:22 +02:00
RincewindsHat
e695a81b13 Remove unnecessary type defines 2023-10-01 13:40:50 +02:00
Danijel Tasov
a0eb219889 update-po
Signed-off-by: Danijel Tasov <m@rbfh.de>
2023-09-28 15:42:30 +02:00
Danijel Tasov
e6d2b0b08b cleanup more merge debris
Signed-off-by: Danijel Tasov <m@rbfh.de>
2023-09-27 11:14:18 +02:00
Danijel Tasov
42125d928f Add some spaces to the output
needed if multiple modes are used at once

Signed-off-by: Danijel Tasov <m@rbfh.de>
2023-09-26 17:35:31 +02:00
Danijel Tasov
4ed1d74295 fixed comment
Signed-off-by: Danijel Tasov <m@rbfh.de>
2023-09-26 17:26:43 +02:00
Danijel Tasov
111e25efcd Fix speling
Signed-off-by: Danijel Tasov <m@rbfh.de>
2023-09-25 18:29:27 +02:00
Danijel Tasov
3f0cc2533c Fix compile errors
Signed-off-by: Danijel Tasov <m@rbfh.de>
2023-09-25 18:23:54 +02:00
Danijel Tasov
9387e21de7 exit UNKNOWN on -V
Signed-off-by: Danijel Tasov <m@rbfh.de>
2023-09-25 09:49:59 +02:00
Danijel Tasov
2f909de340 fix merge error
Signed-off-by: Danijel Tasov <m@rbfh.de>
2023-09-23 16:46:15 +02:00
Danijel Tasov
4b242f0678 Merge branch 'jitter-orig' into merge-jitter 2023-09-23 16:33:52 +02:00
Danijel Tasov
8272d73e57 remove root check
We can perfectly do icmp without root by using capabalities.  So,
instead of doing unsufficient checks beforehand, we just try and fail if
it doesn't work.

Signed-off-by: Danijel Tasov <m@rbfh.de>
2023-09-23 16:18:08 +02:00
waja
265a7c0ed8
Merge branch 'master' into compiler_warning_part_2 2023-06-28 16:39:27 +02:00
RincewindsHat
cb55797937 Refix spelling issues 2023-04-18 00:42:20 +02:00
RincewindsHat
ab62b2ce5d Fixes for -Wuninitialized 2023-04-18 00:20:28 +02:00
RincewindsHat
907b933a87 Fixes for -Wunused-parameters 2023-04-18 00:20:12 +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
Jan Wagner
0f3703e641 Fix a lot of typos reported by codespell 2023-04-14 18:35:00 +00:00
RincewindsHat
74b6984047 Merge branch 'master' into check_icmp_cleanup 2023-02-19 14:39:08 +01:00
RincewindsHat
423284edfa check_icmp: Fix compiler warning
This fixes a compiler warning which complains about an uninitialized
value for a variable which is then returned.
This had no real world impact, since the program would crash in the
branch where result is not set.
The variable is initialized to "-1" which would be the error for
inet_pton.
2023-02-19 14:34:29 +01:00
RincewindsHat
d3a4bad51d check_icmp: Fix compiler warning
This fixes a compiler warning with no real world impact.
The compiler complains about a missing return, which is correct, but
in that scenario the program would crash anyways, so this has no impact.
2023-02-19 14:31:21 +01:00
Lorenz Kästle
f79eb4f2ca Link plugins against libcrypto to make hashes available 2023-02-01 00:57:42 +01:00
Aksel Sjögren
e5db81bb29 check_icmp: fix parsing help/version long options
Fix parsing of the long options --help and --version. The special
handling must be done before calling getopt().
This fixes erroneous output like:

    ./check_icmp --version
    ./check_icmp: invalid option -- '-'
    ./check_icmp: invalid option -- 'e'
    ./check_icmp: invalid option -- 'r'
    ./check_icmp: invalid option -- '-'
    ./check_icmp: invalid option -- 'e'
    ./check_icmp: invalid option -- 'r'

Signed-off-by: Aksel Sjögren <asjogren@itrsgroup.com>
2022-11-29 16:38:33 +01:00
RincewindsHat
9a73a94258 Replace DBL_MAX with INFITY to check if value was set 2022-11-04 17:08:36 +01:00
RincewindsHat
7d074091db Remove hardcoded DBL_MAX definition 2022-11-04 16:53:57 +01:00
RincewindsHat
413af19555 Remove trailing whitespaces 2022-11-04 16:51:32 +01:00
eriksejr
ee50ddf698
Set msg_namelen to the size of the sockaddr struct for the appropriate address family and not sockaddr_storage (#1771)
Co-authored-by: Erik Sejr <eriks@ssimicro.com>
Co-authored-by: Lorenz <12514511+RincewindsHat@users.noreply.github.com>
2022-07-14 10:25:51 +02:00
Lorenz
6054055571
check_icmp: buffer offerflow (#1733)
* Fix different overflows

* Less includes

* Add testcases

* Remove unused variable

* Remove unused and commented includes
2022-03-15 22:00:55 +01:00
ghciv6
986b247946 - delay set_source_ip() until address_family is detected
- add a test to check '-s'
2022-01-29 12:19:23 +01:00
RincewindsHat
d28bab4dbd More wrong printf formatting 2021-11-24 19:02:17 +01:00
RincewindsHat
e2f24a5af3 Fix CodeQL checks 2021-11-24 14:25:42 +01:00
Aksel Sjögren
3f9b22ab16 check_icmp: Fix pkt perfdata in check_host mode
Add missing "warn" threshold field in "pkt" perfdata output.
Perfdata should be interpreted as;

  'label'=value[UOM];[warn];[crit];[min];[max]

With one field missing, the hardcoded min value '0' ended up in the
"crit" field, making applications interpreting the perfdata thining that
critical threshold is always exceeded.

Signed-off-by: Aksel Sjögren <asjogren@itrsgroup.com>
2021-11-15 17:55:49 +01:00
Aksel Sjögren
39c162e594
Fix check_dhcp tests
* try to use "/usr/sbin/ip" before "ifconfig" since the latter is
  obsolete on Linux to figure out interface to listen for DHCP messages.
  But keeping ifconfig method just in case.
  Without this, tests fail on boxes without ifconfig AND the correct
  interface named ethX.

* amend possible failure responses, as check_dhcp might get a DHCPOFFER,
  but from an unexpected address - which happens if the box running
  tests are on a network with a DHCP server.
2021-04-30 11:14:10 +02:00