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; int n_addresses; int max_addr = 1; int max_packets = -1; -int verbose = FALSE; +int verbose = 0; float rta = UNKNOWN_TRIP_TIME; int pl = UNKNOWN_PACKET_LOSS; @@ -112,8 +112,8 @@ main (int argc, char **argv) asprintf (&cmd, rawcmd, addresses[i], max_packets); #endif - if (verbose) - printf ("%s ==> ", cmd); + if (verbose >= 2) + printf ("CMD: %s\n", cmd); /* run the command */ this_result = run_ping (cmd, addresses[i]); @@ -146,7 +146,7 @@ main (int argc, char **argv) printf ("</A>"); printf ("\n"); - if (verbose) + if (verbose >= 2) printf ("%f:%d%% %f:%d%%\n", wrta, wpl, crta, cpl); result = max_state (result, this_result); @@ -208,7 +208,7 @@ process_arguments (int argc, char **argv) timeout_interval = atoi (optarg); break; case 'v': /* verbose mode */ - verbose = TRUE; + verbose++; break; case '4': /* IPv4 only */ address_family = AF_INET; @@ -412,6 +412,9 @@ run_ping (const char *cmd, const char *addr) while (fgets (buf, MAX_INPUT_BUFFER - 1, child_process)) { + if (verbose >= 3) + printf("Output: %s", buf); + result = max_state (result, error_scan (buf, addr)); /* get the percent loss statistics */ |