summaryrefslogtreecommitdiffstats
path: root/web/attachments/302976-nagios-plugins-check_fping-timeout-1.4.13.patch
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/302976-nagios-plugins-check_fping-timeout-1.4.13.patch')
-rw-r--r--web/attachments/302976-nagios-plugins-check_fping-timeout-1.4.13.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/web/attachments/302976-nagios-plugins-check_fping-timeout-1.4.13.patch b/web/attachments/302976-nagios-plugins-check_fping-timeout-1.4.13.patch
new file mode 100644
index 0000000..965631e
--- /dev/null
+++ b/web/attachments/302976-nagios-plugins-check_fping-timeout-1.4.13.patch
@@ -0,0 +1,62 @@
1diff -urN nagios-plugins-1.4.13.ORIG/plugins/check_fping.c nagios-plugins-1.4.13/plugins/check_fping.c
2--- nagios-plugins-1.4.13.ORIG/plugins/check_fping.c 2008-11-15 08:39:42.000000000 +0000
3+++ nagios-plugins-1.4.13/plugins/check_fping.c 2008-11-15 10:03:56.000000000 +0000
4@@ -46,7 +46,8 @@
5 PACKET_COUNT = 1,
6 PACKET_SIZE = 56,
7 PL = 0,
8- RTA = 1
9+ RTA = 1,
10+ TARGET_TIMEOUT = 500
11 };
12
13 int textscan (char *buf);
14@@ -58,6 +59,7 @@
15 char *server_name = NULL;
16 int packet_size = PACKET_SIZE;
17 int packet_count = PACKET_COUNT;
18+int target_timeout = TARGET_TIMEOUT;
19 int verbose = FALSE;
20 int cpl;
21 int wpl;
22@@ -92,8 +94,8 @@
23 server = strscpy (server, server_name);
24
25 /* compose the command */
26- asprintf (&command_line, "%s -b %d -c %d %s", PATH_TO_FPING,
27- packet_size, packet_count, server);
28+ asprintf (&command_line, "%s -t %d -b %d -c %d %s", PATH_TO_FPING,
29+ target_timeout, packet_size, packet_count, server);
30
31 if (verbose)
32 printf ("%s\n", command_line);
33@@ -252,7 +254,7 @@
34 }
35
36 while (1) {
37- c = getopt_long (argc, argv, "+hVvH:c:w:b:n:", longopts, &option);
38+ c = getopt_long (argc, argv, "+hVvH:c:w:b:n:t:", longopts, &option);
39
40 if (c == -1 || c == EOF || c == 1)
41 break;
42@@ -313,6 +315,12 @@
43 else
44 usage (_("Packet count must be a positive integer"));
45 break;
46+ case 't': /* timeout in msec */
47+ if (is_intpos (optarg))
48+ target_timeout = atoi (optarg);
49+ else
50+ usage (_("Target timeout must be a positive integer"));
51+ break;
52 }
53 }
54
55@@ -414,5 +422,5 @@
56 print_usage (void)
57 {
58 printf (_("Usage:"));
59- printf (" %s <host_address> -w limit -c limit [-b size] [-n number]\n", progname);
60+ printf (" %s <host_address> -w limit -c limit [-b size] [-n number] [-t number]\n", progname);
61 }
62