summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/check_ping.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/plugins/check_ping.c b/plugins/check_ping.c
index fc720144..6b566608 100644
--- a/plugins/check_ping.c
+++ b/plugins/check_ping.c
@@ -53,7 +53,7 @@ char **addresses = NULL;
53int n_addresses; 53int n_addresses;
54int max_addr = 1; 54int max_addr = 1;
55int max_packets = -1; 55int max_packets = -1;
56int verbose = FALSE; 56int verbose = 0;
57 57
58float rta = UNKNOWN_TRIP_TIME; 58float rta = UNKNOWN_TRIP_TIME;
59int pl = UNKNOWN_PACKET_LOSS; 59int pl = UNKNOWN_PACKET_LOSS;
@@ -112,8 +112,8 @@ main (int argc, char **argv)
112 asprintf (&cmd, rawcmd, addresses[i], max_packets); 112 asprintf (&cmd, rawcmd, addresses[i], max_packets);
113#endif 113#endif
114 114
115 if (verbose) 115 if (verbose >= 2)
116 printf ("%s ==> ", cmd); 116 printf ("CMD: %s\n", cmd);
117 117
118 /* run the command */ 118 /* run the command */
119 this_result = run_ping (cmd, addresses[i]); 119 this_result = run_ping (cmd, addresses[i]);
@@ -146,7 +146,7 @@ main (int argc, char **argv)
146 printf ("</A>"); 146 printf ("</A>");
147 printf ("\n"); 147 printf ("\n");
148 148
149 if (verbose) 149 if (verbose >= 2)
150 printf ("%f:%d%% %f:%d%%\n", wrta, wpl, crta, cpl); 150 printf ("%f:%d%% %f:%d%%\n", wrta, wpl, crta, cpl);
151 151
152 result = max_state (result, this_result); 152 result = max_state (result, this_result);
@@ -208,7 +208,7 @@ process_arguments (int argc, char **argv)
208 timeout_interval = atoi (optarg); 208 timeout_interval = atoi (optarg);
209 break; 209 break;
210 case 'v': /* verbose mode */ 210 case 'v': /* verbose mode */
211 verbose = TRUE; 211 verbose++;
212 break; 212 break;
213 case '4': /* IPv4 only */ 213 case '4': /* IPv4 only */
214 address_family = AF_INET; 214 address_family = AF_INET;
@@ -412,6 +412,9 @@ run_ping (const char *cmd, const char *addr)
412 412
413 while (fgets (buf, MAX_INPUT_BUFFER - 1, child_process)) { 413 while (fgets (buf, MAX_INPUT_BUFFER - 1, child_process)) {
414 414
415 if (verbose >= 3)
416 printf("Output: %s", buf);
417
415 result = max_state (result, error_scan (buf, addr)); 418 result = max_state (result, error_scan (buf, addr));
416 419
417 /* get the percent loss statistics */ 420 /* get the percent loss statistics */