check_ping.c 17 KB

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