diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2005-09-13 15:48:15 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2005-09-13 15:48:15 +0000 |
commit | 31c5bbba7e193f4011e7b85308b9ee0144405c79 (patch) | |
tree | f69022720e4e758d5d6e6c5841471520ab9e1bb0 /plugins/check_ping.c | |
parent | 42050b45f28c1d9ac8c54a83921dbbd638adde13 (diff) | |
download | monitoring-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.c | 13 |
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; | |||
53 | int n_addresses; | 53 | int n_addresses; |
54 | int max_addr = 1; | 54 | int max_addr = 1; |
55 | int max_packets = -1; | 55 | int max_packets = -1; |
56 | int verbose = FALSE; | 56 | int verbose = 0; |
57 | 57 | ||
58 | float rta = UNKNOWN_TRIP_TIME; | 58 | float rta = UNKNOWN_TRIP_TIME; |
59 | int pl = UNKNOWN_PACKET_LOSS; | 59 | int 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 */ |