diff options
Diffstat (limited to 'plugins/check_ping.c')
-rw-r--r-- | plugins/check_ping.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/plugins/check_ping.c b/plugins/check_ping.c index dbc5c3e4..ba7af373 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, |
@@ -224,11 +230,11 @@ process_arguments (int argc, char **argv) | |||
224 | usage5 (); | 230 | usage5 (); |
225 | case 'h': /* help */ | 231 | case 'h': /* help */ |
226 | print_help (); | 232 | print_help (); |
227 | exit (STATE_OK); | 233 | exit (STATE_UNKNOWN); |
228 | break; | 234 | break; |
229 | case 'V': /* version */ | 235 | case 'V': /* version */ |
230 | print_revision (progname, NP_VERSION); | 236 | print_revision (progname, NP_VERSION); |
231 | exit (STATE_OK); | 237 | exit (STATE_UNKNOWN); |
232 | break; | 238 | break; |
233 | case 't': /* timeout period */ | 239 | case 't': /* timeout period */ |
234 | timeout_interval = atoi (optarg); | 240 | timeout_interval = atoi (optarg); |