diff -r ./config.h nagios-plugins/config.h 1539,1541d1538 < /* path and args for ICMP ping command with defined source */ < #define PING_COMMAND_SOURCE "/sbin/ping -S %s -n -c %d %s" < Только в .: nagios-plugins Только в .: nagios-plugins.patch diff -r ./plugins/check_ping.c nagios-plugins/plugins/check_ping.c 39d38 < #include "arpa/inet.h" 63d61 < char *source = NULL; 73a72,73 > > 90a91 > /* Parse extra opts if any */ 115,118c116 < if (source == NULL) < rawcmd = strdup(PING_COMMAND); < else < rawcmd = strdup(PING_COMMAND_SOURCE); --- > rawcmd = strdup(PING_COMMAND); 120c118 < rawcmd = strdup(PING_COMMAND_SOURCE); --- > rawcmd = strdup(PING_COMMAND); 128c126 < asprintf (&cmd, rawcmd, source, max_packets, addresses[i]); --- > asprintf (&cmd, rawcmd, max_packets, addresses[i]); 205d202 < {"source", optional_argument, 0, 'S'}, 220c217 < c = getopt_long (argc, argv, "VvhnL46t:c:w:H:p:S:", longopts, &option); --- > c = getopt_long (argc, argv, "VvhnL46t:c:w:H:p:", longopts, &option); 271,278d267 < case 'S': /* source address */ < ptr = optarg; < source = ptr; < struct sockaddr_in sa; < char str[INET_ADDRSTRLEN]; < if (inet_pton(AF_INET, source, &(sa.sin_addr)) != 0) < die (STATE_UNKNOWN, _("Bad local source\n")); < break; 580d568 < printf (" %s\n", "-S, --source=IP"); 612c600 < printf ("%s -S -H -w ,%% -c ,%%\n", progname); --- > printf ("%s -H -w ,%% -c ,%%\n", progname);