diff options
Diffstat (limited to 'web/attachments/450268-nagios-plugins.patch')
-rw-r--r-- | web/attachments/450268-nagios-plugins.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/web/attachments/450268-nagios-plugins.patch b/web/attachments/450268-nagios-plugins.patch new file mode 100644 index 0000000..f70b810 --- /dev/null +++ b/web/attachments/450268-nagios-plugins.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | diff -r ./config.h nagios-plugins/config.h | ||
2 | 1539,1541d1538 | ||
3 | < /* path and args for ICMP ping command with defined source */ | ||
4 | < #define PING_COMMAND_SOURCE "/sbin/ping -S %s -n -c %d %s" | ||
5 | < | ||
6 | Только в .: nagios-plugins | ||
7 | Только в .: nagios-plugins.patch | ||
8 | diff -r ./plugins/check_ping.c nagios-plugins/plugins/check_ping.c | ||
9 | 39d38 | ||
10 | < #include "arpa/inet.h" | ||
11 | 63d61 | ||
12 | < char *source = NULL; | ||
13 | 73a72,73 | ||
14 | > | ||
15 | > | ||
16 | 90a91 | ||
17 | > /* Parse extra opts if any */ | ||
18 | 115,118c116 | ||
19 | < if (source == NULL) | ||
20 | < rawcmd = strdup(PING_COMMAND); | ||
21 | < else | ||
22 | < rawcmd = strdup(PING_COMMAND_SOURCE); | ||
23 | --- | ||
24 | > rawcmd = strdup(PING_COMMAND); | ||
25 | 120c118 | ||
26 | < rawcmd = strdup(PING_COMMAND_SOURCE); | ||
27 | --- | ||
28 | > rawcmd = strdup(PING_COMMAND); | ||
29 | 128c126 | ||
30 | < asprintf (&cmd, rawcmd, source, max_packets, addresses[i]); | ||
31 | --- | ||
32 | > asprintf (&cmd, rawcmd, max_packets, addresses[i]); | ||
33 | 205d202 | ||
34 | < {"source", optional_argument, 0, 'S'}, | ||
35 | 220c217 | ||
36 | < c = getopt_long (argc, argv, "VvhnL46t:c:w:H:p:S:", longopts, &option); | ||
37 | --- | ||
38 | > c = getopt_long (argc, argv, "VvhnL46t:c:w:H:p:", longopts, &option); | ||
39 | 271,278d267 | ||
40 | < case 'S': /* source address */ | ||
41 | < ptr = optarg; | ||
42 | < source = ptr; | ||
43 | < struct sockaddr_in sa; | ||
44 | < char str[INET_ADDRSTRLEN]; | ||
45 | < if (inet_pton(AF_INET, source, &(sa.sin_addr)) != 0) | ||
46 | < die (STATE_UNKNOWN, _("Bad local source\n")); | ||
47 | < break; | ||
48 | 580d568 | ||
49 | < printf (" %s\n", "-S, --source=IP"); | ||
50 | 612c600 | ||
51 | < printf ("%s -S <source_address> -H <host_address> -w <wrta>,<wpl>%% -c <crta>,<cpl>%%\n", progname); | ||
52 | --- | ||
53 | > printf ("%s -H <host_address> -w <wrta>,<wpl>%% -c <crta>,<cpl>%%\n", progname); | ||