diff -urN nagios-plugins-1.4.13.ORIG/plugins/check_fping.c nagios-plugins-1.4.13/plugins/check_fping.c --- nagios-plugins-1.4.13.ORIG/plugins/check_fping.c 2008-11-15 08:39:42.000000000 +0000 +++ nagios-plugins-1.4.13/plugins/check_fping.c 2008-11-15 10:03:56.000000000 +0000 @@ -46,7 +46,8 @@ PACKET_COUNT = 1, PACKET_SIZE = 56, PL = 0, - RTA = 1 + RTA = 1, + TARGET_TIMEOUT = 500 }; int textscan (char *buf); @@ -58,6 +59,7 @@ char *server_name = NULL; int packet_size = PACKET_SIZE; int packet_count = PACKET_COUNT; +int target_timeout = TARGET_TIMEOUT; int verbose = FALSE; int cpl; int wpl; @@ -92,8 +94,8 @@ server = strscpy (server, server_name); /* compose the command */ - asprintf (&command_line, "%s -b %d -c %d %s", PATH_TO_FPING, - packet_size, packet_count, server); + asprintf (&command_line, "%s -t %d -b %d -c %d %s", PATH_TO_FPING, + target_timeout, packet_size, packet_count, server); if (verbose) printf ("%s\n", command_line); @@ -252,7 +254,7 @@ } while (1) { - c = getopt_long (argc, argv, "+hVvH:c:w:b:n:", longopts, &option); + c = getopt_long (argc, argv, "+hVvH:c:w:b:n:t:", longopts, &option); if (c == -1 || c == EOF || c == 1) break; @@ -313,6 +315,12 @@ else usage (_("Packet count must be a positive integer")); break; + case 't': /* timeout in msec */ + if (is_intpos (optarg)) + target_timeout = atoi (optarg); + else + usage (_("Target timeout must be a positive integer")); + break; } } @@ -414,5 +422,5 @@ print_usage (void) { printf (_("Usage:")); - printf (" %s -w limit -c limit [-b size] [-n number]\n", progname); + printf (" %s -w limit -c limit [-b size] [-n number] [-t number]\n", progname); }