Commit graph

128 commits

Author SHA1 Message Date
Lorenz Kästle
89f79cf2d2 check_icmp: set rtmin initially 2024-11-28 09:02:29 +01:00
Lorenz Kästle
714fd1aceb check_icmp: Add some lines to introduce some readability 2024-11-28 09:02:29 +01:00
Lorenz Kästle
eb9f9cf8c4 check_icmp: clang-format 2024-11-28 09:02:29 +01:00
Lorenz Kästle
de6e3c45f3 check_icmp: Apply clang-format again 2024-10-30 17:12:19 +01:00
RincewindsHat
aa1f9c5011 check_icmp: clang-format 2024-10-16 00:11:39 +02:00
RincewindsHat
c0694cc6b5 check_icmp: Update copyright 2024-10-15 11:56:41 +02:00
RincewindsHat
780909f980 check_icmp: Properly mark function with void input 2024-10-15 11:55:27 +02:00
RincewindsHat
85f2e32e27 check_icmp: Declare internal variables static 2024-10-15 11:55:08 +02:00
RincewindsHat
0caa47a50b check_icmp: clang-format 2024-10-15 11:44:28 +02:00
Sven Nierlein
0488426c7e check_icmp: keep performance data order in case of none-reachable hosts
For responding hosts nothing changes:

    ./check_icmp -H 10.0.0.1
    OK - 10.0.0.1 rta 0.336ms lost 0%|rta=0.336ms;200.000;500.000;0; rtmax=0.471ms;;;; rtmin=0.000ms;;;; pl=0%;40;80;0;100

In case the host is down, the performance data now contain 'U' according to:
https://www.monitoring-plugins.org/doc/guidelines.html#AEN201

Old:
    ./check_icmp -H 10.0.0.99
    CRITICAL - 10.0.0.99: Host unreachable @ 10.0.1.138. rta nan, lost 100%|pl=100%;40;80;0;100

Old:
    ./check_icmp -H 10.0.0.99
    CRITICAL - 10.0.0.99: Host unreachable @ 10.0.1.138. rta nan, lost 100%|rta=U;;;; rtmax=U;;;; rtmin=U;;;; pl=100%;40;80;0;100

This confuses some performance graphing tools, ex.: pnp.

Signed-off-by: Sven Nierlein <sven@consol.de>
2024-03-01 09:03:17 +01:00
RincewindsHat
f5074ac7f0 Fix spelling stuff 2023-10-13 01:29:31 +02:00
RincewindsHat
0de0daccec Add some more comments about the MOS score 2023-10-13 01:25:22 +02:00
RincewindsHat
eb6c83a650 Even more code formatting and cleanup 2023-10-09 14:03:36 +02:00
RincewindsHat
9da06d5625 Do some more formatting 2023-10-09 01:57:37 +02:00
RincewindsHat
c568ad207c Remove preprocessor macro 2023-10-09 01:31:52 +02:00
RincewindsHat
f7df88dac3 Do some code formatting 2023-10-09 01:18:04 +02:00
RincewindsHat
b6fea24c3d More consequent booleans 2023-10-09 01:17:44 +02:00
RincewindsHat
6a4b9927cb fix unused variables compiler warning 2023-10-08 22:50:17 +02:00
RincewindsHat
b053278b18 fix sign compare compiler warnings 2023-10-08 22:49:45 +02:00
RincewindsHat
9426b9a338 Initialise threshold variables properly 2023-10-08 22:48:39 +02:00
RincewindsHat
da59856f99 Fix typo 2023-10-07 22:43:44 +02:00
RincewindsHat
b81847cb5f Refactor new threshold parser 2023-10-07 11:49:27 +02:00
RincewindsHat
19dc003936 Do some actual error checking on the threshold parser 2023-10-07 11:48:57 +02:00
RincewindsHat
9faa417aeb Remove useless return after crash 2023-10-06 16:05:01 +02:00
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
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
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
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
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
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