diff options
author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2021-12-02 15:42:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-02 15:42:05 (GMT) |
commit | 911e44045d7291f5ede22739fd176ef55dd3de4a (patch) | |
tree | cf36b95a4a964b03d6ecf75770ced2cb3a2ac3a9 /plugins/check_ping.c | |
parent | 8294af907bd8482a86df749f562b7ec09e3faeed (diff) | |
parent | ed7cdf82a42f16532801ea4f118870ce9a130fcf (diff) | |
download | monitoring-plugins-911e44045d7291f5ede22739fd176ef55dd3de4a.tar.gz |
Merge branch 'master' into fix/shellcheckrefs/pull/1459/head
Diffstat (limited to 'plugins/check_ping.c')
-rw-r--r-- | plugins/check_ping.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/check_ping.c b/plugins/check_ping.c index 423ecbe..ba7af37 100644 --- a/plugins/check_ping.c +++ b/plugins/check_ping.c | |||
@@ -37,6 +37,8 @@ const char *email = "devel@monitoring-plugins.org"; | |||
37 | #include "popen.h" | 37 | #include "popen.h" |
38 | #include "utils.h" | 38 | #include "utils.h" |
39 | 39 | ||
40 | #include <signal.h> | ||
41 | |||
40 | #define WARN_DUPLICATES "DUPLICATES FOUND! " | 42 | #define WARN_DUPLICATES "DUPLICATES FOUND! " |
41 | #define UNKNOWN_TRIP_TIME -1.0 /* -1 seconds */ | 43 | #define UNKNOWN_TRIP_TIME -1.0 /* -1 seconds */ |
42 | 44 | ||
@@ -163,10 +165,14 @@ main (int argc, char **argv) | |||
163 | printf ("</A>"); | 165 | printf ("</A>"); |
164 | 166 | ||
165 | /* Print performance data */ | 167 | /* Print performance data */ |
166 | printf("|%s", fperfdata ("rta", (double) rta, "ms", | 168 | if (pl != 100) { |
167 | wrta>0?TRUE:FALSE, wrta, | 169 | printf("|%s", fperfdata ("rta", (double) rta, "ms", |
168 | crta>0?TRUE:FALSE, crta, | 170 | wrta>0?TRUE:FALSE, wrta, |
169 | TRUE, 0, FALSE, 0)); | 171 | crta>0?TRUE:FALSE, crta, |
172 | TRUE, 0, FALSE, 0)); | ||
173 | } else { | ||
174 | printf("| rta=U;%f;%f;;", wrta, crta); | ||
175 | } | ||
170 | printf(" %s\n", perfdata ("pl", (long) pl, "%", | 176 | printf(" %s\n", perfdata ("pl", (long) pl, "%", |
171 | wpl>0?TRUE:FALSE, wpl, | 177 | wpl>0?TRUE:FALSE, wpl, |
172 | cpl>0?TRUE:FALSE, cpl, | 178 | cpl>0?TRUE:FALSE, cpl, |