From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- web/attachments/56819-ping.diff | 120 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 web/attachments/56819-ping.diff (limited to 'web/attachments/56819-ping.diff') diff --git a/web/attachments/56819-ping.diff b/web/attachments/56819-ping.diff new file mode 100644 index 0000000..8a849a1 --- /dev/null +++ b/web/attachments/56819-ping.diff @@ -0,0 +1,120 @@ +*** check_ping.c.orig Mon Jan 13 20:15:16 2003 +--- check_ping.c Wed Jul 23 14:38:19 2003 +*************** +*** 19,25 **** + + #define OPTIONS "\ + -H -w ,%% -c ,%%\n\ +! [-p packets] [-t timeout] [-L]\n" + + #define LONGOPTIONS "\ + -H, --hostname=HOST\n\ +--- 19,26 ---- + + #define OPTIONS "\ + -H -w ,%% -c ,%%\n\ +! [-p packets] [-t timeout] [-6] [-L]\n" +! + + #define LONGOPTIONS "\ + -H, --hostname=HOST\n\ +*************** +*** 32,37 **** +--- 33,40 ---- + number of ICMP ECHO packets to send (Default: %d)\n\ + -t, --timeout=INTEGER\n\ + optional specified timeout in second (Default: %d)\n\ ++ -6, --use-ping6\n\ ++ use ping6 for ICMPv6 instead of ping for IPv4\n\ + -L, --link\n\ + show HTML in the plugin output (obsoleted by urlize)\n\ + THRESHOLD is ,%% where is the round trip average travel\n\ +*************** +*** 70,81 **** +--- 73,87 ---- + char *server_address = NULL; + int max_packets = -1; + int verbose = FALSE; ++ int ipv6 = FALSE; + + float rta = UNKNOWN_TRIP_TIME; + int pl = UNKNOWN_PACKET_LOSS; + + char *warn_text = NULL; + ++ #define PING6_COMMAND "/sbin/ping6 -n -c %d %s" ++ + int + main (int argc, char **argv) + { +*************** +*** 86,98 **** + usage ("Could not parse arguments"); + exit; + + /* does the host address of number of packets argument come first? */ + #ifdef PING_PACKETS_FIRST + asprintf (&command_line, PING_COMMAND, max_packets, server_address); + #else + asprintf (&command_line, PING_COMMAND, server_address, max_packets); + #endif +! + /* Set signal handling and alarm */ + if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) { + printf ("Cannot catch SIGALRM"); +--- 92,108 ---- + usage ("Could not parse arguments"); + exit; + ++ #ifdef PING6_COMMAND ++ asprintf (&command_line, ipv6 ? PING6_COMMAND : PING_COMMAND, max_packets, server_address); ++ #else ++ + /* does the host address of number of packets argument come first? */ + #ifdef PING_PACKETS_FIRST + asprintf (&command_line, PING_COMMAND, max_packets, server_address); + #else + asprintf (&command_line, PING_COMMAND, server_address, max_packets); + #endif +! #endif + /* Set signal handling and alarm */ + if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) { + printf ("Cannot catch SIGALRM"); +*************** +*** 157,167 **** + {"packets", required_argument, 0, 'p'}, + {"nohtml", no_argument, 0, 'n'}, + {"link", no_argument, 0, 'L'}, + {0, 0, 0, 0} + }; + #endif + +! #define OPTCHARS "Vvht:c:w:H:p:nL" + + if (argc < 2) + return ERROR; +--- 167,178 ---- + {"packets", required_argument, 0, 'p'}, + {"nohtml", no_argument, 0, 'n'}, + {"link", no_argument, 0, 'L'}, ++ {"use-ping6", no_argument, 0, '6'}, + {0, 0, 0, 0} + }; + #endif + +! #define OPTCHARS "Vvht:c:w:H:p:n6L" + + if (argc < 2) + return ERROR; +*************** +*** 213,218 **** +--- 224,232 ---- + break; + case 'L': /* show HTML */ + display_html = TRUE; ++ break; ++ case '6': ++ ipv6 = TRUE; + break; + case 'c': + get_threshold (optarg, &crta, &cpl); -- cgit v1.2.3-74-g34f1