summaryrefslogtreecommitdiffstats
path: root/plugins/check_ping.c
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2005-09-13 15:48:15 (GMT)
committerTon Voon <tonvoon@users.sourceforge.net>2005-09-13 15:48:15 (GMT)
commit31c5bbba7e193f4011e7b85308b9ee0144405c79 (patch)
treef69022720e4e758d5d6e6c5841471520ab9e1bb0 /plugins/check_ping.c
parent42050b45f28c1d9ac8c54a83921dbbd638adde13 (diff)
downloadmonitoring-plugins-31c5bbba7e193f4011e7b85308b9ee0144405c79.tar.gz
More diagnostic messages from check_ping
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1216 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_ping.c')
-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 fc72014..6b56660 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 */