diff options
author | Sven Nierlein <sven@consol.de> | 2024-02-28 14:37:27 (GMT) |
---|---|---|
committer | Sven Nierlein <sven@nierlein.org> | 2024-03-01 08:03:17 (GMT) |
commit | 0488426c7e8018d77734fb0e46328182de28f76a (patch) | |
tree | 157d97cab7fdeabdab304af540e40de92774b3d7 /plugins-root/t/check_icmp.t | |
parent | 117cd8e4b826e471e795536228628d817df33f5a (diff) | |
download | monitoring-plugins-0488426c7e8018d77734fb0e46328182de28f76a.tar.gz |
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>
Diffstat (limited to 'plugins-root/t/check_icmp.t')
-rw-r--r-- | plugins-root/t/check_icmp.t | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins-root/t/check_icmp.t b/plugins-root/t/check_icmp.t index 4f9db86..de1d88d 100644 --- a/plugins-root/t/check_icmp.t +++ b/plugins-root/t/check_icmp.t | |||
@@ -12,7 +12,7 @@ my $allow_sudo = getTestParameter( "NP_ALLOW_SUDO", | |||
12 | "no" ); | 12 | "no" ); |
13 | 13 | ||
14 | if ($allow_sudo eq "yes" or $> == 0) { | 14 | if ($allow_sudo eq "yes" or $> == 0) { |
15 | plan tests => 39; | 15 | plan tests => 40; |
16 | } else { | 16 | } else { |
17 | plan skip_all => "Need sudo to test check_icmp"; | 17 | plan skip_all => "Need sudo to test check_icmp"; |
18 | } | 18 | } |
@@ -57,7 +57,8 @@ $res = NPTest->testCmd( | |||
57 | "$sudo ./check_icmp -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -t 2" | 57 | "$sudo ./check_icmp -H $host_nonresponsive -w 10000ms,100% -c 10000ms,100% -t 2" |
58 | ); | 58 | ); |
59 | is( $res->return_code, 2, "Timeout - host nonresponsive" ); | 59 | is( $res->return_code, 2, "Timeout - host nonresponsive" ); |
60 | like( $res->output, '/100%/', "Error contains '100%' string (for 100% packet loss)" ); | 60 | like( $res->output, '/pl=100%/', "Error contains 'pl=100%' string (for 100% packet loss)" ); |
61 | like( $res->output, '/rta=U/', "Error contains 'rta=U' string" ); | ||
61 | 62 | ||
62 | $res = NPTest->testCmd( | 63 | $res = NPTest->testCmd( |
63 | "$sudo ./check_icmp -w 10000ms,100% -c 10000ms,100%" | 64 | "$sudo ./check_icmp -w 10000ms,100% -c 10000ms,100%" |