check_ping.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  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. if (process_arguments (argc, argv) == ERROR)
  82. usage4 (_("Could not parse arguments"));
  83. /* Set signal handling and alarm */
  84. if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) {
  85. usage4 (_("Cannot catch SIGALRM"));
  86. }
  87. /* If ./configure finds ping has timeout values, set plugin alarm slightly
  88. * higher so that we can use response from command line ping */
  89. #if defined(PING_PACKETS_FIRST) && defined(PING_HAS_TIMEOUT)
  90. alarm (timeout_interval + 1);
  91. #else
  92. alarm (timeout_interval);
  93. #endif
  94. for (i = 0 ; i < n_addresses ; i++) {
  95. #ifdef PING6_COMMAND
  96. if (address_family != AF_INET && is_inet6_addr(addresses[i]))
  97. rawcmd = strdup(PING6_COMMAND);
  98. else
  99. rawcmd = strdup(PING_COMMAND);
  100. #else
  101. rawcmd = strdup(PING_COMMAND);
  102. #endif
  103. /* does the host address of number of packets argument come first? */
  104. #ifdef PING_PACKETS_FIRST
  105. # ifdef PING_HAS_TIMEOUT
  106. asprintf (&cmd, rawcmd, timeout_interval, max_packets, addresses[i]);
  107. # else
  108. asprintf (&cmd, rawcmd, max_packets, addresses[i]);
  109. # endif
  110. #else
  111. asprintf (&cmd, rawcmd, addresses[i], max_packets);
  112. #endif
  113. if (verbose >= 2)
  114. printf ("CMD: %s\n", cmd);
  115. /* run the command */
  116. this_result = run_ping (cmd, addresses[i]);
  117. if (pl == UNKNOWN_PACKET_LOSS || rta < 0.0) {
  118. printf ("%s\n", cmd);
  119. die (STATE_UNKNOWN,
  120. _("CRITICAL - Could not interpret output from ping command\n"));
  121. }
  122. if (pl >= cpl || rta >= crta || rta < 0)
  123. this_result = STATE_CRITICAL;
  124. else if (pl >= wpl || rta >= wrta)
  125. this_result = STATE_WARNING;
  126. else if (pl >= 0 && rta >= 0)
  127. this_result = max_state (STATE_OK, this_result);
  128. if (n_addresses > 1 && this_result != STATE_UNKNOWN)
  129. die (STATE_OK, "%s is alive\n", addresses[i]);
  130. if (display_html == TRUE)
  131. printf ("<A HREF='%s/traceroute.cgi?%s'>", CGIURL, addresses[i]);
  132. if (pl == 100)
  133. printf (_("PING %s - %sPacket loss = %d%%"), state_text (this_result), warn_text,
  134. pl);
  135. else
  136. printf (_("PING %s - %sPacket loss = %d%%, RTA = %2.2f ms"),
  137. state_text (this_result), warn_text, pl, rta);
  138. if (display_html == TRUE)
  139. printf ("</A>");
  140. /* Print performance data */
  141. printf("|%s", fperfdata ("rta", (double) rta, "ms",
  142. wrta>0?TRUE:FALSE, wrta,
  143. crta>0?TRUE:FALSE, crta,
  144. TRUE, 0, FALSE, 0));
  145. printf(" %s\n", perfdata ("pl", (long) pl, "%",
  146. wpl>0?TRUE:FALSE, wpl,
  147. cpl>0?TRUE:FALSE, cpl,
  148. TRUE, 0, FALSE, 0));
  149. if (verbose >= 2)
  150. printf ("%f:%d%% %f:%d%%\n", wrta, wpl, crta, cpl);
  151. result = max_state (result, this_result);
  152. free (rawcmd);
  153. free (cmd);
  154. }
  155. return result;
  156. }
  157. /* process command-line arguments */
  158. int
  159. process_arguments (int argc, char **argv)
  160. {
  161. int c = 1;
  162. char *ptr;
  163. int option = 0;
  164. static struct option longopts[] = {
  165. STD_LONG_OPTS,
  166. {"packets", required_argument, 0, 'p'},
  167. {"nohtml", no_argument, 0, 'n'},
  168. {"link", no_argument, 0, 'L'},
  169. {"use-ipv4", no_argument, 0, '4'},
  170. {"use-ipv6", no_argument, 0, '6'},
  171. {0, 0, 0, 0}
  172. };
  173. if (argc < 2)
  174. return ERROR;
  175. for (c = 1; c < argc; c++) {
  176. if (strcmp ("-to", argv[c]) == 0)
  177. strcpy (argv[c], "-t");
  178. if (strcmp ("-nohtml", argv[c]) == 0)
  179. strcpy (argv[c], "-n");
  180. }
  181. while (1) {
  182. c = getopt_long (argc, argv, "VvhnL46t:c:w:H:p:", longopts, &option);
  183. if (c == -1 || c == EOF)
  184. break;
  185. switch (c) {
  186. case '?': /* usage */
  187. usage5 ();
  188. case 'h': /* help */
  189. print_help ();
  190. exit (STATE_OK);
  191. break;
  192. case 'V': /* version */
  193. print_revision (progname, revision);
  194. exit (STATE_OK);
  195. break;
  196. case 't': /* timeout period */
  197. timeout_interval = atoi (optarg);
  198. break;
  199. case 'v': /* verbose mode */
  200. verbose++;
  201. break;
  202. case '4': /* IPv4 only */
  203. address_family = AF_INET;
  204. break;
  205. case '6': /* IPv6 only */
  206. #ifdef USE_IPV6
  207. address_family = AF_INET6;
  208. #else
  209. usage (_("IPv6 support not available\n"));
  210. #endif
  211. break;
  212. case 'H': /* hostname */
  213. ptr=optarg;
  214. while (1) {
  215. n_addresses++;
  216. if (n_addresses > max_addr) {
  217. max_addr *= 2;
  218. addresses = realloc (addresses, sizeof(char*) * max_addr);
  219. if (addresses == NULL)
  220. die (STATE_UNKNOWN, _("Could not realloc() addresses\n"));
  221. }
  222. addresses[n_addresses-1] = ptr;
  223. if ((ptr = index (ptr, ','))) {
  224. strcpy (ptr, "");
  225. ptr += sizeof(char);
  226. } else {
  227. break;
  228. }
  229. }
  230. break;
  231. case 'p': /* number of packets to send */
  232. if (is_intnonneg (optarg))
  233. max_packets = atoi (optarg);
  234. else
  235. usage2 (_("<max_packets> (%s) must be a non-negative number\n"), optarg);
  236. break;
  237. case 'n': /* no HTML */
  238. display_html = FALSE;
  239. break;
  240. case 'L': /* show HTML */
  241. display_html = TRUE;
  242. break;
  243. case 'c':
  244. get_threshold (optarg, &crta, &cpl);
  245. break;
  246. case 'w':
  247. get_threshold (optarg, &wrta, &wpl);
  248. break;
  249. }
  250. }
  251. c = optind;
  252. if (c == argc)
  253. return validate_arguments ();
  254. if (addresses[0] == NULL) {
  255. if (is_host (argv[c]) == FALSE) {
  256. usage2 (_("Invalid hostname/address"), argv[c]);
  257. } else {
  258. addresses[0] = argv[c++];
  259. n_addresses++;
  260. if (c == argc)
  261. return validate_arguments ();
  262. }
  263. }
  264. if (wpl == UNKNOWN_PACKET_LOSS) {
  265. if (is_intpercent (argv[c]) == FALSE) {
  266. printf (_("<wpl> (%s) must be an integer percentage\n"), argv[c]);
  267. return ERROR;
  268. } else {
  269. wpl = atoi (argv[c++]);
  270. if (c == argc)
  271. return validate_arguments ();
  272. }
  273. }
  274. if (cpl == UNKNOWN_PACKET_LOSS) {
  275. if (is_intpercent (argv[c]) == FALSE) {
  276. printf (_("<cpl> (%s) must be an integer percentage\n"), argv[c]);
  277. return ERROR;
  278. } else {
  279. cpl = atoi (argv[c++]);
  280. if (c == argc)
  281. return validate_arguments ();
  282. }
  283. }
  284. if (wrta < 0.0) {
  285. if (is_negative (argv[c])) {
  286. printf (_("<wrta> (%s) must be a non-negative number\n"), argv[c]);
  287. return ERROR;
  288. } else {
  289. wrta = atof (argv[c++]);
  290. if (c == argc)
  291. return validate_arguments ();
  292. }
  293. }
  294. if (crta < 0.0) {
  295. if (is_negative (argv[c])) {
  296. printf (_("<crta> (%s) must be a non-negative number\n"), argv[c]);
  297. return ERROR;
  298. } else {
  299. crta = atof (argv[c++]);
  300. if (c == argc)
  301. return validate_arguments ();
  302. }
  303. }
  304. if (max_packets == -1) {
  305. if (is_intnonneg (argv[c])) {
  306. max_packets = atoi (argv[c++]);
  307. } else {
  308. printf (_("<max_packets> (%s) must be a non-negative number\n"), argv[c]);
  309. return ERROR;
  310. }
  311. }
  312. return validate_arguments ();
  313. }
  314. int
  315. get_threshold (char *arg, float *trta, int *tpl)
  316. {
  317. if (is_intnonneg (arg) && sscanf (arg, "%f", trta) == 1)
  318. return OK;
  319. else if (strpbrk (arg, ",:") && strstr (arg, "%") && sscanf (arg, "%f%*[:,]%d%%", trta, tpl) == 2)
  320. return OK;
  321. else if (strstr (arg, "%") && sscanf (arg, "%d%%", tpl) == 1)
  322. return OK;
  323. usage2 (_("%s: Warning threshold must be integer or percentage!\n\n"), arg);
  324. return STATE_UNKNOWN;
  325. }
  326. int
  327. validate_arguments ()
  328. {
  329. float max_seconds;
  330. int i;
  331. if (wrta < 0.0) {
  332. printf (_("<wrta> was not set\n"));
  333. return ERROR;
  334. }
  335. else if (crta < 0.0) {
  336. printf (_("<crta> was not set\n"));
  337. return ERROR;
  338. }
  339. else if (wpl == UNKNOWN_PACKET_LOSS) {
  340. printf (_("<wpl> was not set\n"));
  341. return ERROR;
  342. }
  343. else if (cpl == UNKNOWN_PACKET_LOSS) {
  344. printf (_("<cpl> was not set\n"));
  345. return ERROR;
  346. }
  347. else if (wrta > crta) {
  348. printf (_("<wrta> (%f) cannot be larger than <crta> (%f)\n"), wrta, crta);
  349. return ERROR;
  350. }
  351. else if (wpl > cpl) {
  352. printf (_("<wpl> (%d) cannot be larger than <cpl> (%d)\n"), wpl, cpl);
  353. return ERROR;
  354. }
  355. if (max_packets == -1)
  356. max_packets = DEFAULT_MAX_PACKETS;
  357. max_seconds = crta / 1000.0 * max_packets + max_packets;
  358. if (max_seconds > timeout_interval)
  359. timeout_interval = (int)max_seconds;
  360. for (i=0; i<n_addresses; i++) {
  361. if (is_host(addresses[i]) == FALSE)
  362. usage2 (_("Invalid hostname/address"), addresses[i]);
  363. }
  364. if (n_addresses == 0) {
  365. usage (_("You must specify a server address or host name"));
  366. }
  367. return OK;
  368. }
  369. int
  370. run_ping (const char *cmd, const char *addr)
  371. {
  372. char buf[MAX_INPUT_BUFFER];
  373. int result = STATE_UNKNOWN;
  374. if ((child_process = spopen (cmd)) == NULL)
  375. die (STATE_UNKNOWN, _("Could not open pipe: %s\n"), cmd);
  376. child_stderr = fdopen (child_stderr_array[fileno (child_process)], "r");
  377. if (child_stderr == NULL)
  378. printf (_("Cannot open stderr for %s\n"), cmd);
  379. while (fgets (buf, MAX_INPUT_BUFFER - 1, child_process)) {
  380. if (verbose >= 3)
  381. printf("Output: %s", buf);
  382. result = max_state (result, error_scan (buf, addr));
  383. /* get the percent loss statistics */
  384. if(sscanf(buf,"%*d packets transmitted, %*d packets received, +%*d errors, %d%% packet loss",&pl)==1 ||
  385. sscanf(buf,"%*d packets transmitted, %*d packets received, +%*d duplicates, %d%% packet loss", &pl) == 1 ||
  386. sscanf(buf,"%*d packets transmitted, %*d received, +%*d duplicates, %d%% packet loss", &pl) == 1 ||
  387. sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% packet loss",&pl)==1 ||
  388. sscanf(buf,"%*d packets transmitted, %*d packets received, %d%% loss, time",&pl)==1 ||
  389. sscanf(buf,"%*d packets transmitted, %*d received, %d%% loss, time", &pl)==1 ||
  390. sscanf(buf,"%*d packets transmitted, %*d received, %d%% packet loss, time", &pl)==1 ||
  391. sscanf(buf,"%*d packets transmitted, %*d received, +%*d errors, %d%% packet loss", &pl) == 1 ||
  392. sscanf(buf,"%*d packets transmitted %*d received, +%*d errors, %d%% packet loss", &pl) == 1
  393. )
  394. continue;
  395. /* get the round trip average */
  396. else
  397. if(sscanf(buf,"round-trip min/avg/max = %*f/%f/%*f",&rta)==1 ||
  398. sscanf(buf,"round-trip min/avg/max/mdev = %*f/%f/%*f/%*f",&rta)==1 ||
  399. sscanf(buf,"round-trip min/avg/max/sdev = %*f/%f/%*f/%*f",&rta)==1 ||
  400. sscanf(buf,"round-trip min/avg/max/stddev = %*f/%f/%*f/%*f",&rta)==1 ||
  401. sscanf(buf,"round-trip min/avg/max/std-dev = %*f/%f/%*f/%*f",&rta)==1 ||
  402. sscanf(buf,"round-trip (ms) min/avg/max = %*f/%f/%*f",&rta)==1 ||
  403. sscanf(buf,"round-trip (ms) min/avg/max/stddev = %*f/%f/%*f/%*f",&rta)==1 ||
  404. sscanf(buf,"rtt min/avg/max/mdev = %*f/%f/%*f/%*f ms",&rta)==1)
  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. /* close the pipe - WARNING if status is set */
  429. if (spclose (child_process))
  430. result = max_state (result, STATE_WARNING);
  431. if (warn_text == NULL)
  432. warn_text = strdup("");
  433. return result;
  434. }
  435. int
  436. error_scan (char buf[MAX_INPUT_BUFFER], const char *addr)
  437. {
  438. if (strstr (buf, "Network is unreachable") ||
  439. strstr (buf, "Destination Net Unreachable")
  440. )
  441. die (STATE_CRITICAL, _("CRITICAL - Network Unreachable (%s)"), addr);
  442. else if (strstr (buf, "Destination Host Unreachable"))
  443. die (STATE_CRITICAL, _("CRITICAL - Host Unreachable (%s)"), addr);
  444. else if (strstr (buf, "Destination Port Unreachable"))
  445. die (STATE_CRITICAL, _("CRITICAL - Bogus ICMP: Port Unreachable (%s)"), addr);
  446. else if (strstr (buf, "Destination Protocol Unreachable"))
  447. die (STATE_CRITICAL, _("CRITICAL - Bogus ICMP: Protocol Unreachable (%s)"), addr);
  448. else if (strstr (buf, "Destination Net Prohibited"))
  449. die (STATE_CRITICAL, _("CRITICAL - Network Prohibited (%s)"), addr);
  450. else if (strstr (buf, "Destination Host Prohibited"))
  451. die (STATE_CRITICAL, _("CRITICAL - Host Prohibited (%s)"), addr);
  452. else if (strstr (buf, "Packet filtered"))
  453. die (STATE_CRITICAL, _("CRITICAL - Packet Filtered (%s)"), addr);
  454. else if (strstr (buf, "unknown host" ))
  455. die (STATE_CRITICAL, _("CRITICAL - Host not found (%s)"), addr);
  456. else if (strstr (buf, "Time to live exceeded"))
  457. die (STATE_CRITICAL, _("CRITICAL - Time to live exceeded (%s)"), 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"));
  464. return (STATE_WARNING);
  465. }
  466. return (STATE_OK);
  467. }
  468. void
  469. print_help (void)
  470. {
  471. print_revision (progname, revision);
  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_IPv46));
  479. printf (" %s\n", "-H, --hostname=HOST");
  480. printf (" %s\n", _("host to ping"));
  481. printf (" %s\n", "-w, --warning=THRESHOLD");
  482. printf (" %s\n", _("warning threshold pair"));
  483. printf (" %s\n", "-c, --critical=THRESHOLD");
  484. printf (" %s\n", _("critical threshold pair"));
  485. printf (" %s\n", "-p, --packets=INTEGER");
  486. printf (" %s ", _("number of ICMP ECHO packets to send"));
  487. printf (_("(Default: %d)\n"), DEFAULT_MAX_PACKETS);
  488. printf (" %s\n", "-L, --link");
  489. printf (" %s\n", _("show HTML in the plugin output (obsoleted by urlize)"));
  490. printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
  491. printf ("\n");
  492. printf ("%s\n", _("THRESHOLD is <rta>,<pl>% where <rta> is the round trip average travel"));
  493. printf ("%s\n", _("time (ms) which triggers a WARNING or CRITICAL state, and <pl> is the"));
  494. printf ("%s\n", _("percentage of packet loss to trigger an alarm state."));
  495. printf ("\n");
  496. printf ("%s\n", _("This plugin uses the ping command to probe the specified host for packet loss"));
  497. printf ("%s\n", _("(percentage) and round trip average (milliseconds). It can produce HTML output"));
  498. printf ("%s\n", _("linking to a traceroute CGI contributed by Ian Cass. The CGI can be found in"));
  499. printf ("%s\n", _("the contrib area of the downloads section at http://www.nagios.org/"));
  500. printf (_(UT_SUPPORT));
  501. }
  502. void
  503. print_usage (void)
  504. {
  505. printf (_("Usage:"));
  506. printf ("%s -H <host_address> -w <wrta>,<wpl>%% -c <crta>,<cpl>%%\n", progname);
  507. printf (" [-p packets] [-t timeout] [-4|-6]\n");
  508. }