check_ping.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614
  1. /*****************************************************************************
  2. *
  3. * Nagios check_ping plugin
  4. *
  5. * License: GPL
  6. * Copyright (c) 2000-2007 Nagios Plugins Development Team
  7. *
  8. * Last Modified: $Date$
  9. *
  10. * Description:
  11. *
  12. * This file contains the check_ping plugin
  13. *
  14. * Use the ping program to check connection statistics for a remote host.
  15. *
  16. *
  17. * This program is free software: you can redistribute it and/or modify
  18. * it under the terms of the GNU General Public License as published by
  19. * the Free Software Foundation, either version 3 of the License, or
  20. * (at your option) any later version.
  21. *
  22. * This program is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU General Public License
  28. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  29. *
  30. * $Id$
  31. *
  32. *****************************************************************************/
  33. const char *progname = "check_ping";
  34. const char *revision = "$Revision$";
  35. const char *copyright = "2000-2007";
  36. const char *email = "nagiosplug-devel@lists.sourceforge.net";
  37. #include "common.h"
  38. #include "netutils.h"
  39. #include "popen.h"
  40. #include "utils.h"
  41. #define WARN_DUPLICATES "DUPLICATES FOUND! "
  42. #define UNKNOWN_TRIP_TIME -1.0 /* -1 seconds */
  43. enum {
  44. UNKNOWN_PACKET_LOSS = 200, /* 200% */
  45. DEFAULT_MAX_PACKETS = 5 /* default no. of ICMP ECHO packets */
  46. };
  47. int process_arguments (int, char **);
  48. int get_threshold (char *, float *, int *);
  49. int validate_arguments (void);
  50. int run_ping (const char *cmd, const char *addr);
  51. int error_scan (char buf[MAX_INPUT_BUFFER], const char *addr);
  52. void print_usage (void);
  53. void print_help (void);
  54. int display_html = FALSE;
  55. int wpl = UNKNOWN_PACKET_LOSS;
  56. int cpl = UNKNOWN_PACKET_LOSS;
  57. float wrta = UNKNOWN_TRIP_TIME;
  58. float crta = UNKNOWN_TRIP_TIME;
  59. char **addresses = NULL;
  60. int n_addresses = 0;
  61. int max_addr = 1;
  62. int max_packets = -1;
  63. int verbose = 0;
  64. float rta = UNKNOWN_TRIP_TIME;
  65. int pl = UNKNOWN_PACKET_LOSS;
  66. char *warn_text;
  67. int
  68. main (int argc, char **argv)
  69. {
  70. char *cmd = NULL;
  71. char *rawcmd = NULL;
  72. int result = STATE_UNKNOWN;
  73. int this_result = STATE_UNKNOWN;
  74. int i;
  75. setlocale (LC_ALL, "");
  76. setlocale (LC_NUMERIC, "C");
  77. bindtextdomain (PACKAGE, LOCALEDIR);
  78. textdomain (PACKAGE);
  79. addresses = malloc (sizeof(char*) * max_addr);
  80. addresses[0] = NULL;
  81. /* Parse extra opts if any */
  82. argv=np_extra_opts (&argc, argv, progname);
  83. if (process_arguments (argc, argv) == ERROR)
  84. usage4 (_("Could not parse arguments"));
  85. /* Set signal handling and alarm */
  86. if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) {
  87. usage4 (_("Cannot catch SIGALRM"));
  88. }
  89. /* If ./configure finds ping has timeout values, set plugin alarm slightly
  90. * higher so that we can use response from command line ping */
  91. #if defined(PING_PACKETS_FIRST) && defined(PING_HAS_TIMEOUT)
  92. alarm (timeout_interval + 1);
  93. #else
  94. alarm (timeout_interval);
  95. #endif
  96. for (i = 0 ; i < n_addresses ; i++) {
  97. #ifdef PING6_COMMAND
  98. if (address_family != AF_INET && is_inet6_addr(addresses[i]))
  99. rawcmd = strdup(PING6_COMMAND);
  100. else
  101. rawcmd = strdup(PING_COMMAND);
  102. #else
  103. rawcmd = strdup(PING_COMMAND);
  104. #endif
  105. /* does the host address of number of packets argument come first? */
  106. #ifdef PING_PACKETS_FIRST
  107. # ifdef PING_HAS_TIMEOUT
  108. asprintf (&cmd, rawcmd, timeout_interval, max_packets, addresses[i]);
  109. # else
  110. asprintf (&cmd, rawcmd, max_packets, addresses[i]);
  111. # endif
  112. #else
  113. asprintf (&cmd, rawcmd, addresses[i], max_packets);
  114. #endif
  115. if (verbose >= 2)
  116. printf ("CMD: %s\n", cmd);
  117. /* run the command */
  118. this_result = run_ping (cmd, addresses[i]);
  119. if (pl == UNKNOWN_PACKET_LOSS || rta < 0.0) {
  120. printf ("%s\n", cmd);
  121. die (STATE_UNKNOWN,
  122. _("CRITICAL - Could not interpret output from ping command\n"));
  123. }
  124. if (pl >= cpl || rta >= crta || rta < 0)
  125. this_result = STATE_CRITICAL;
  126. else if (pl >= wpl || rta >= wrta)
  127. this_result = STATE_WARNING;
  128. else if (pl >= 0 && rta >= 0)
  129. this_result = max_state (STATE_OK, this_result);
  130. if (n_addresses > 1 && this_result != STATE_UNKNOWN)
  131. die (STATE_OK, "%s is alive\n", addresses[i]);
  132. if (display_html == TRUE)
  133. printf ("<A HREF='%s/traceroute.cgi?%s'>", CGIURL, addresses[i]);
  134. if (pl == 100)
  135. printf (_("PING %s - %sPacket loss = %d%%"), state_text (this_result), warn_text,
  136. pl);
  137. else
  138. printf (_("PING %s - %sPacket loss = %d%%, RTA = %2.2f ms"),
  139. state_text (this_result), warn_text, pl, rta);
  140. if (display_html == TRUE)
  141. printf ("</A>");
  142. /* Print performance data */
  143. printf("|%s", fperfdata ("rta", (double) rta, "ms",
  144. wrta>0?TRUE:FALSE, wrta,
  145. crta>0?TRUE:FALSE, crta,
  146. TRUE, 0, FALSE, 0));
  147. printf(" %s\n", perfdata ("pl", (long) pl, "%",
  148. wpl>0?TRUE:FALSE, wpl,
  149. cpl>0?TRUE:FALSE, cpl,
  150. TRUE, 0, FALSE, 0));
  151. if (verbose >= 2)
  152. printf ("%f:%d%% %f:%d%%\n", wrta, wpl, crta, cpl);
  153. result = max_state (result, this_result);
  154. free (rawcmd);
  155. free (cmd);
  156. }
  157. return result;
  158. }
  159. /* process command-line arguments */
  160. int
  161. process_arguments (int argc, char **argv)
  162. {
  163. int c = 1;
  164. char *ptr;
  165. int option = 0;
  166. static struct option longopts[] = {
  167. STD_LONG_OPTS,
  168. {"packets", required_argument, 0, 'p'},
  169. {"nohtml", no_argument, 0, 'n'},
  170. {"link", no_argument, 0, 'L'},
  171. {"use-ipv4", no_argument, 0, '4'},
  172. {"use-ipv6", no_argument, 0, '6'},
  173. {0, 0, 0, 0}
  174. };
  175. if (argc < 2)
  176. return ERROR;
  177. for (c = 1; c < argc; c++) {
  178. if (strcmp ("-to", argv[c]) == 0)
  179. strcpy (argv[c], "-t");
  180. if (strcmp ("-nohtml", argv[c]) == 0)
  181. strcpy (argv[c], "-n");
  182. }
  183. while (1) {
  184. c = getopt_long (argc, argv, "VvhnL46t:c:w:H:p:", longopts, &option);
  185. if (c == -1 || c == EOF)
  186. break;
  187. switch (c) {
  188. case '?': /* usage */
  189. usage5 ();
  190. case 'h': /* help */
  191. print_help ();
  192. exit (STATE_OK);
  193. break;
  194. case 'V': /* version */
  195. print_revision (progname, revision);
  196. exit (STATE_OK);
  197. break;
  198. case 't': /* timeout period */
  199. timeout_interval = atoi (optarg);
  200. break;
  201. case 'v': /* verbose mode */
  202. verbose++;
  203. break;
  204. case '4': /* IPv4 only */
  205. address_family = AF_INET;
  206. break;
  207. case '6': /* IPv6 only */
  208. #ifdef USE_IPV6
  209. address_family = AF_INET6;
  210. #else
  211. usage (_("IPv6 support not available\n"));
  212. #endif
  213. break;
  214. case 'H': /* hostname */
  215. ptr=optarg;
  216. while (1) {
  217. n_addresses++;
  218. if (n_addresses > max_addr) {
  219. max_addr *= 2;
  220. addresses = realloc (addresses, sizeof(char*) * max_addr);
  221. if (addresses == NULL)
  222. die (STATE_UNKNOWN, _("Could not realloc() addresses\n"));
  223. }
  224. addresses[n_addresses-1] = ptr;
  225. if ((ptr = index (ptr, ','))) {
  226. strcpy (ptr, "");
  227. ptr += sizeof(char);
  228. } else {
  229. break;
  230. }
  231. }
  232. break;
  233. case 'p': /* number of packets to send */
  234. if (is_intnonneg (optarg))
  235. max_packets = atoi (optarg);
  236. else
  237. usage2 (_("<max_packets> (%s) must be a non-negative number\n"), optarg);
  238. break;
  239. case 'n': /* no HTML */
  240. display_html = FALSE;
  241. break;
  242. case 'L': /* show HTML */
  243. display_html = TRUE;
  244. break;
  245. case 'c':
  246. get_threshold (optarg, &crta, &cpl);
  247. break;
  248. case 'w':
  249. get_threshold (optarg, &wrta, &wpl);
  250. break;
  251. }
  252. }
  253. c = optind;
  254. if (c == argc)
  255. return validate_arguments ();
  256. if (addresses[0] == NULL) {
  257. if (is_host (argv[c]) == FALSE) {
  258. usage2 (_("Invalid hostname/address"), argv[c]);
  259. } else {
  260. addresses[0] = argv[c++];
  261. n_addresses++;
  262. if (c == argc)
  263. return validate_arguments ();
  264. }
  265. }
  266. if (wpl == UNKNOWN_PACKET_LOSS) {
  267. if (is_intpercent (argv[c]) == FALSE) {
  268. printf (_("<wpl> (%s) must be an integer percentage\n"), argv[c]);
  269. return ERROR;
  270. } else {
  271. wpl = atoi (argv[c++]);
  272. if (c == argc)
  273. return validate_arguments ();
  274. }
  275. }
  276. if (cpl == UNKNOWN_PACKET_LOSS) {
  277. if (is_intpercent (argv[c]) == FALSE) {
  278. printf (_("<cpl> (%s) must be an integer percentage\n"), argv[c]);
  279. return ERROR;
  280. } else {
  281. cpl = atoi (argv[c++]);
  282. if (c == argc)
  283. return validate_arguments ();
  284. }
  285. }
  286. if (wrta < 0.0) {
  287. if (is_negative (argv[c])) {
  288. printf (_("<wrta> (%s) must be a non-negative number\n"), argv[c]);
  289. return ERROR;
  290. } else {
  291. wrta = atof (argv[c++]);
  292. if (c == argc)
  293. return validate_arguments ();
  294. }
  295. }
  296. if (crta < 0.0) {
  297. if (is_negative (argv[c])) {
  298. printf (_("<crta> (%s) must be a non-negative number\n"), argv[c]);
  299. return ERROR;
  300. } else {
  301. crta = atof (argv[c++]);
  302. if (c == argc)
  303. return validate_arguments ();
  304. }
  305. }
  306. if (max_packets == -1) {
  307. if (is_intnonneg (argv[c])) {
  308. max_packets = atoi (argv[c++]);
  309. } else {
  310. printf (_("<max_packets> (%s) must be a non-negative number\n"), argv[c]);
  311. return ERROR;
  312. }
  313. }
  314. return validate_arguments ();
  315. }
  316. int
  317. get_threshold (char *arg, float *trta, int *tpl)
  318. {
  319. if (is_intnonneg (arg) && sscanf (arg, "%f", trta) == 1)
  320. return OK;
  321. else if (strpbrk (arg, ",:") && strstr (arg, "%") && sscanf (arg, "%f%*[:,]%d%%", trta, tpl) == 2)
  322. return OK;
  323. else if (strstr (arg, "%") && sscanf (arg, "%d%%", tpl) == 1)
  324. return OK;
  325. usage2 (_("%s: Warning threshold must be integer or percentage!\n\n"), arg);
  326. return STATE_UNKNOWN;
  327. }
  328. int
  329. validate_arguments ()
  330. {
  331. float max_seconds;
  332. int i;
  333. if (wrta < 0.0) {
  334. printf (_("<wrta> was not set\n"));
  335. return ERROR;
  336. }
  337. else if (crta < 0.0) {
  338. printf (_("<crta> was not set\n"));
  339. return ERROR;
  340. }
  341. else if (wpl == UNKNOWN_PACKET_LOSS) {
  342. printf (_("<wpl> was not set\n"));
  343. return ERROR;
  344. }
  345. else if (cpl == UNKNOWN_PACKET_LOSS) {
  346. printf (_("<cpl> was not set\n"));
  347. return ERROR;
  348. }
  349. else if (wrta > crta) {
  350. printf (_("<wrta> (%f) cannot be larger than <crta> (%f)\n"), wrta, crta);
  351. return ERROR;
  352. }
  353. else if (wpl > cpl) {
  354. printf (_("<wpl> (%d) cannot be larger than <cpl> (%d)\n"), wpl, cpl);
  355. return ERROR;
  356. }
  357. if (max_packets == -1)
  358. max_packets = DEFAULT_MAX_PACKETS;
  359. max_seconds = crta / 1000.0 * max_packets + max_packets;
  360. if (max_seconds > timeout_interval)
  361. timeout_interval = (int)max_seconds;
  362. for (i=0; i<n_addresses; i++) {
  363. if (is_host(addresses[i]) == FALSE)
  364. usage2 (_("Invalid hostname/address"), addresses[i]);
  365. }
  366. if (n_addresses == 0) {
  367. usage (_("You must specify a server address or host name"));
  368. }
  369. return OK;
  370. }
  371. int
  372. run_ping (const char *cmd, const char *addr)
  373. {
  374. char buf[MAX_INPUT_BUFFER];
  375. int result = STATE_UNKNOWN;
  376. if ((child_process = spopen (cmd)) == NULL)
  377. die (STATE_UNKNOWN, _("Could not open pipe: %s\n"), cmd);
  378. child_stderr = fdopen (child_stderr_array[fileno (child_process)], "r");
  379. if (child_stderr == NULL)
  380. printf (_("Cannot open stderr for %s\n"), cmd);
  381. while (fgets (buf, MAX_INPUT_BUFFER - 1, child_process)) {
  382. if (verbose >= 3)
  383. printf("Output: %s", buf);
  384. result = max_state (result, error_scan (buf, addr));
  385. /* get the percent loss statistics */
  386. if(sscanf(buf,"%*d packets transmitted, %*d packets received, +%*d errors, %d%% packet loss",&pl)==1 ||
  387. sscanf(buf,"%*d packets transmitted, %*d packets received, +%*d duplicates, %d%% packet loss", &pl) == 1 ||
  388. sscanf(buf,"%*d packets transmitted, %*d received, +%*d duplicates, %d%% packet loss", &pl) == 1 ||
  389. sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% packet loss",&pl)==1 ||
  390. sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% loss, time",&pl)==1 ||
  391. sscanf(buf,"%*d packets transmitted, %*d received, %d%% loss, time", &pl)==1 ||
  392. sscanf(buf,"%*d packets transmitted, %*d received, %d%% packet loss, time", &pl)==1 ||
  393. sscanf(buf,"%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss", &pl) == 1 ||
  394. sscanf(buf,"%*d packets transmitted %*d received, +%*d errors, %d%% packet loss", &pl) == 1
  395. )
  396. continue;
  397. /* get the round trip average */
  398. else
  399. if(sscanf(buf,"round-trip min/avg/max = %*f/%f/%*f",&rta)==1 ||
  400. sscanf(buf,"round-trip min/avg/max/mdev = %*f/%f/%*f/%*f",&rta)==1 ||
  401. sscanf(buf,"round-trip min/avg/max/sdev = %*f/%f/%*f/%*f",&rta)==1 ||
  402. sscanf(buf,"round-trip min/avg/max/stddev = %*f/%f/%*f/%*f",&rta)==1 ||
  403. sscanf(buf,"round-trip min/avg/max/std-dev = %*f/%f/%*f/%*f",&rta)==1 ||
  404. sscanf(buf,"round-trip (ms) min/avg/max = %*f/%f/%*f",&rta)==1 ||
  405. sscanf(buf,"round-trip (ms) min/avg/max/stddev = %*f/%f/%*f/%*f",&rta)==1 ||
  406. sscanf(buf,"rtt min/avg/max/mdev = %*f/%f/%*f/%*f ms",&rta)==1)
  407. continue;
  408. }
  409. /* this is needed because there is no rta if all packets are lost */
  410. if (pl == 100)
  411. rta = crta;
  412. /* check stderr, setting at least WARNING if there is output here */
  413. /* Add warning into warn_text */
  414. while (fgets (buf, MAX_INPUT_BUFFER - 1, child_stderr)) {
  415. if (! strstr(buf,"WARNING - no SO_TIMESTAMP support, falling back to SIOCGSTAMP")) {
  416. if (verbose >= 3) {
  417. printf("Got stderr: %s", buf);
  418. }
  419. if ((result=error_scan(buf, addr)) == STATE_OK) {
  420. result = STATE_WARNING;
  421. if (warn_text == NULL) {
  422. warn_text = strdup(_("System call sent warnings to stderr "));
  423. } else {
  424. asprintf(&warn_text, "%s %s", warn_text, _("System call sent warnings to stderr "));
  425. }
  426. }
  427. }
  428. }
  429. (void) fclose (child_stderr);
  430. /* close the pipe - WARNING if status is set */
  431. if (spclose (child_process))
  432. result = max_state (result, STATE_WARNING);
  433. if (warn_text == NULL)
  434. warn_text = strdup("");
  435. return result;
  436. }
  437. int
  438. error_scan (char buf[MAX_INPUT_BUFFER], const char *addr)
  439. {
  440. if (strstr (buf, "Network is unreachable") ||
  441. strstr (buf, "Destination Net Unreachable")
  442. )
  443. die (STATE_CRITICAL, _("CRITICAL - Network Unreachable (%s)"), addr);
  444. else if (strstr (buf, "Destination Host Unreachable"))
  445. die (STATE_CRITICAL, _("CRITICAL - Host Unreachable (%s)"), addr);
  446. else if (strstr (buf, "Destination Port Unreachable"))
  447. die (STATE_CRITICAL, _("CRITICAL - Bogus ICMP: Port Unreachable (%s)"), addr);
  448. else if (strstr (buf, "Destination Protocol Unreachable"))
  449. die (STATE_CRITICAL, _("CRITICAL - Bogus ICMP: Protocol Unreachable (%s)"), addr);
  450. else if (strstr (buf, "Destination Net Prohibited"))
  451. die (STATE_CRITICAL, _("CRITICAL - Network Prohibited (%s)"), addr);
  452. else if (strstr (buf, "Destination Host Prohibited"))
  453. die (STATE_CRITICAL, _("CRITICAL - Host Prohibited (%s)"), addr);
  454. else if (strstr (buf, "Packet filtered"))
  455. die (STATE_CRITICAL, _("CRITICAL - Packet Filtered (%s)"), addr);
  456. else if (strstr (buf, "unknown host" ))
  457. die (STATE_CRITICAL, _("CRITICAL - Host not found (%s)"), addr);
  458. else if (strstr (buf, "Time to live exceeded"))
  459. die (STATE_CRITICAL, _("CRITICAL - Time to live exceeded (%s)"), addr);
  460. if (strstr (buf, "(DUP!)") || strstr (buf, "DUPLICATES FOUND")) {
  461. if (warn_text == NULL)
  462. warn_text = strdup (_(WARN_DUPLICATES));
  463. else if (! strstr (warn_text, _(WARN_DUPLICATES)) &&
  464. asprintf (&warn_text, "%s %s", warn_text, _(WARN_DUPLICATES)) == -1)
  465. die (STATE_UNKNOWN, _("Unable to realloc warn_text"));
  466. return (STATE_WARNING);
  467. }
  468. return (STATE_OK);
  469. }
  470. void
  471. print_help (void)
  472. {
  473. print_revision (progname, revision);
  474. printf ("Copyright (c) 1999 Ethan Galstad <nagios@nagios.org>\n");
  475. printf (COPYRIGHT, copyright, email);
  476. printf (_("Use ping to check connection statistics for a remote host."));
  477. printf ("\n\n");
  478. print_usage ();
  479. printf (_(UT_HELP_VRSN));
  480. printf (_(UT_EXTRA_OPTS));
  481. printf (_(UT_IPv46));
  482. printf (" %s\n", "-H, --hostname=HOST");
  483. printf (" %s\n", _("host to ping"));
  484. printf (" %s\n", "-w, --warning=THRESHOLD");
  485. printf (" %s\n", _("warning threshold pair"));
  486. printf (" %s\n", "-c, --critical=THRESHOLD");
  487. printf (" %s\n", _("critical threshold pair"));
  488. printf (" %s\n", "-p, --packets=INTEGER");
  489. printf (" %s ", _("number of ICMP ECHO packets to send"));
  490. printf (_("(Default: %d)\n"), DEFAULT_MAX_PACKETS);
  491. printf (" %s\n", "-L, --link");
  492. printf (" %s\n", _("show HTML in the plugin output (obsoleted by urlize)"));
  493. printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
  494. printf ("\n");
  495. printf ("%s\n", _("THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel"));
  496. printf ("%s\n", _("time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the"));
  497. printf ("%s\n", _("percentage of packet loss to trigger an alarm state."));
  498. printf ("\n");
  499. printf ("%s\n", _("This plugin uses the ping command to probe the specified host for packet loss"));
  500. printf ("%s\n", _("(percentage) and round trip average (milliseconds). It can produce HTML output"));
  501. printf ("%s\n", _("linking to a traceroute CGI contributed by Ian Cass. The CGI can be found in"));
  502. printf ("%s\n", _("the contrib area of the downloads section at http://www.nagios.org/"));
  503. #ifdef NP_EXTRA_OPTS
  504. printf ("\n");
  505. printf ("%s\n", _("Notes:"));
  506. printf (_(UT_EXTRA_OPTS_NOTES));
  507. #endif
  508. printf (_(UT_SUPPORT));
  509. }
  510. void
  511. print_usage (void)
  512. {
  513. printf (_("Usage:"));
  514. printf ("%s -H <host_address> -w <wrta>,<wpl>%% -c <crta>,<cpl>%%\n", progname);
  515. printf (" [-p packets] [-t timeout] [-4|-6]\n");
  516. }