@cryptotaxi247 / netdata-1 / commits / de8ce5a5c

Separate net.inet6.icmp6.stats module

Vladimir Kobal committed Mar 14, 2017 at 18:51 UTC de8ce5a5c2efca032c02374391f48e0a9a7fe8d0
3 files changed +377 -250
src/freebsd_sysctl.c
+362 -237
@@ -2342,25 +2342,376 @@ int do_net_inet6_ip6_stats(int update_every, usec_t dt) {
2342 return 0;
2343 }
2344
2345 +// --------------------------------------------------------------------------------------------------------------------
2346 +// net.inet6.icmp6.stats
2347 +
2348 +int do_net_inet6_icmp6_stats(int update_every, usec_t dt) {
2349 + static int do_icmp6 = -1, do_icmp6_redir = -1, do_icmp6_errors = -1, do_icmp6_echos = -1, do_icmp6_router = -1,
2350 + do_icmp6_neighbor = -1, do_icmp6_types = -1;
2351 +
2352 + if (unlikely(do_icmp6 == -1)) {
2353 + do_icmp6 = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp", CONFIG_BOOLEAN_AUTO);
2354 + do_icmp6_redir = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp redirects", CONFIG_BOOLEAN_AUTO);
2355 + do_icmp6_errors = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp errors", CONFIG_BOOLEAN_AUTO);
2356 + do_icmp6_echos = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp echos", CONFIG_BOOLEAN_AUTO);
2357 + do_icmp6_router = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp router", CONFIG_BOOLEAN_AUTO);
2358 + do_icmp6_neighbor = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp neighbor", CONFIG_BOOLEAN_AUTO);
2359 + do_icmp6_types = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp types", CONFIG_BOOLEAN_AUTO);
2360 + }
2361 +
2362 + if (likely(do_icmp6 || do_icmp6_redir || do_icmp6_errors || do_icmp6_echos || do_icmp6_router || do_icmp6_neighbor || do_icmp6_types)) {
2363 + static int mib[4] = {0, 0, 0, 0};
2364 + struct icmp6stat icmp6stat;
2365 +
2366 + if (unlikely(GETSYSCTL_SIMPLE("net.inet6.icmp6.stats", mib, icmp6stat))) {
2367 + do_icmp6 = 0;
2368 + error("DISABLED: ipv6.icmp chart");
2369 + do_icmp6_redir = 0;
2370 + error("DISABLED: ipv6.icmpredir chart");
2371 + do_icmp6_errors = 0;
2372 + error("DISABLED: ipv6.icmperrors chart");
2373 + do_icmp6_echos = 0;
2374 + error("DISABLED: ipv6.icmpechos chart");
2375 + do_icmp6_router = 0;
2376 + error("DISABLED: ipv6.icmprouter chart");
2377 + do_icmp6_neighbor = 0;
2378 + error("DISABLED: ipv6.icmpneighbor chart");
2379 + do_icmp6_types = 0;
2380 + error("DISABLED: ipv6.icmptypes chart");
2381 + error("DISABLED: net.inet6.icmp6.stats module");
2382 + return 1;
2383 + } else {
2384 + int i;
2385 + struct icmp6_total {
2386 + u_long msgs_in;
2387 + u_long msgs_out;
2388 + } icmp6_total = {0, 0};
2389 +
2390 + for (i = 0; i <= ICMP6_MAXTYPE; i++) {
2391 + icmp6_total.msgs_in += icmp6stat.icp6s_inhist[i];
2392 + icmp6_total.msgs_out += icmp6stat.icp6s_outhist[i];
2393 + }
2394 + icmp6_total.msgs_in += icmp6stat.icp6s_badcode + icmp6stat.icp6s_badlen + icmp6stat.icp6s_checksum + icmp6stat.icp6s_tooshort;
2395 +
2396 + // --------------------------------------------------------------------
2397 +
2398 + if (do_icmp6 == CONFIG_BOOLEAN_YES || (do_icmp6 == CONFIG_BOOLEAN_AUTO && (icmp6_total.msgs_in || icmp6_total.msgs_out))) {
2399 + do_icmp6 = CONFIG_BOOLEAN_YES;
2400 +
2401 + static RRDSET *st = NULL;
2402 + static RRDDIM *rd_received = NULL, *rd_sent = NULL;
2403 +
2404 + if (unlikely(!st)) {
2405 + st = rrdset_create_localhost("ipv6",
2406 + "icmp",
2407 + NULL,
2408 + "icmp",
2409 + NULL,
2410 + "IPv6 ICMP Messages",
2411 + "messages/s",
2412 + 10000,
2413 + update_every,
2414 + RRDSET_TYPE_LINE
2415 + );
2416 +
2417 + rd_received = rrddim_add(st, "received", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2418 + rd_sent = rrddim_add(st, "sent", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2419 + } else
2420 + rrdset_next(st);
2421 +
2422 + rrddim_set_by_pointer(st, rd_received, icmp6_total.msgs_out);
2423 + rrddim_set_by_pointer(st, rd_sent, icmp6_total.msgs_in);
2424 +
2425 + rrdset_done(st);
2426 + }
2427 +
2428 + // --------------------------------------------------------------------
2429 +
2430 + if (do_icmp6_redir == CONFIG_BOOLEAN_YES || (do_icmp6_redir == CONFIG_BOOLEAN_AUTO && (icmp6stat.icp6s_inhist[ND_REDIRECT] || icmp6stat.icp6s_outhist[ND_REDIRECT]))) {
2431 + do_icmp6_redir = CONFIG_BOOLEAN_YES;
2432 +
2433 + static RRDSET *st = NULL;
2434 + static RRDDIM *rd_received = NULL, *rd_sent = NULL;
2435 +
2436 + if (unlikely(!st)) {
2437 + st = rrdset_create_localhost("ipv6",
2438 + "icmpredir",
2439 + NULL,
2440 + "icmp",
2441 + NULL,
2442 + "IPv6 ICMP Redirects",
2443 + "redirects/s",
2444 + 10050,
2445 + update_every,
2446 + RRDSET_TYPE_LINE
2447 + );
2448 +
2449 + rd_received = rrddim_add(st, "received", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2450 + rd_sent = rrddim_add(st, "sent", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2451 + } else
2452 + rrdset_next(st);
2453 +
2454 + rrddim_set_by_pointer(st, rd_received, icmp6stat.icp6s_outhist[ND_REDIRECT]);
2455 + rrddim_set_by_pointer(st, rd_sent, icmp6stat.icp6s_inhist[ND_REDIRECT]);
2456 + rrdset_done(st);
2457 + }
2458 +
2459 + // --------------------------------------------------------------------
2460 +
2461 + if (do_icmp6_errors == CONFIG_BOOLEAN_YES || (do_icmp6_errors == CONFIG_BOOLEAN_AUTO && (
2462 + icmp6stat.icp6s_badcode ||
2463 + icmp6stat.icp6s_badlen ||
2464 + icmp6stat.icp6s_checksum ||
2465 + icmp6stat.icp6s_tooshort ||
2466 + icmp6stat.icp6s_error ||
2467 + icmp6stat.icp6s_inhist[ICMP6_DST_UNREACH] ||
2468 + icmp6stat.icp6s_inhist[ICMP6_TIME_EXCEEDED] ||
2469 + icmp6stat.icp6s_inhist[ICMP6_PARAM_PROB] ||
2470 + icmp6stat.icp6s_outhist[ICMP6_DST_UNREACH] ||
2471 + icmp6stat.icp6s_outhist[ICMP6_TIME_EXCEEDED] ||
2472 + icmp6stat.icp6s_outhist[ICMP6_PARAM_PROB]))) {
2473 + do_icmp6_errors = CONFIG_BOOLEAN_YES;
2474 +
2475 + static RRDSET *st = NULL;
2476 + static RRDDIM *rd_in_errors = NULL, *rd_out_errors = NULL, *rd_in_csum_errors = NULL,
2477 + *rd_in_dest_unreachs = NULL, *rd_in_pkt_too_bigs = NULL, *rd_in_time_excds = NULL,
2478 + *rd_in_parm_problems = NULL, *rd_out_dest_unreachs = NULL, *rd_out_time_excds = NULL,
2479 + *rd_out_parm_problems = NULL;
2480 +
2481 + if (unlikely(!st)) {
2482 + st = rrdset_create_localhost("ipv6",
2483 + "icmperrors",
2484 + NULL, "icmp",
2485 + NULL,
2486 + "IPv6 ICMP Errors",
2487 + "errors/s",
2488 + 10100,
2489 + update_every,
2490 + RRDSET_TYPE_LINE
2491 + );
2492 +
2493 + rd_in_errors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2494 + rd_out_errors = rrddim_add(st, "OutErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2495 + rd_in_csum_errors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2496 + rd_in_dest_unreachs = rrddim_add(st, "InDestUnreachs", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2497 + rd_in_pkt_too_bigs = rrddim_add(st, "InPktTooBigs", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2498 + rd_in_time_excds = rrddim_add(st, "InTimeExcds", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2499 + rd_in_parm_problems = rrddim_add(st, "InParmProblems", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2500 + rd_out_dest_unreachs = rrddim_add(st, "OutDestUnreachs", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2501 + rd_out_time_excds = rrddim_add(st, "OutTimeExcds", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2502 + rd_out_parm_problems = rrddim_add(st, "OutParmProblems", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2503 + } else
2504 + rrdset_next(st);
2505 +
2506 + rrddim_set_by_pointer(st, rd_in_errors, icmp6stat.icp6s_badcode + icmp6stat.icp6s_badlen +
2507 + icmp6stat.icp6s_checksum + icmp6stat.icp6s_tooshort);
2508 + rrddim_set_by_pointer(st, rd_out_errors, icmp6stat.icp6s_error);
2509 + rrddim_set_by_pointer(st, rd_in_csum_errors, icmp6stat.icp6s_checksum);
2510 + rrddim_set_by_pointer(st, rd_in_dest_unreachs, icmp6stat.icp6s_inhist[ICMP6_DST_UNREACH]);
2511 + rrddim_set_by_pointer(st, rd_in_pkt_too_bigs, icmp6stat.icp6s_badlen);
2512 + rrddim_set_by_pointer(st, rd_in_time_excds, icmp6stat.icp6s_inhist[ICMP6_TIME_EXCEEDED]);
2513 + rrddim_set_by_pointer(st, rd_in_parm_problems, icmp6stat.icp6s_inhist[ICMP6_PARAM_PROB]);
2514 + rrddim_set_by_pointer(st, rd_out_dest_unreachs, icmp6stat.icp6s_outhist[ICMP6_DST_UNREACH]);
2515 + rrddim_set_by_pointer(st, rd_out_time_excds, icmp6stat.icp6s_outhist[ICMP6_TIME_EXCEEDED]);
2516 + rrddim_set_by_pointer(st, rd_out_parm_problems, icmp6stat.icp6s_outhist[ICMP6_PARAM_PROB]);
2517 + rrdset_done(st);
2518 + }
2519 +
2520 + // --------------------------------------------------------------------
2521 +
2522 + if (do_icmp6_echos == CONFIG_BOOLEAN_YES || (do_icmp6_echos == CONFIG_BOOLEAN_AUTO && (
2523 + icmp6stat.icp6s_inhist[ICMP6_ECHO_REQUEST] ||
2524 + icmp6stat.icp6s_outhist[ICMP6_ECHO_REQUEST] ||
2525 + icmp6stat.icp6s_inhist[ICMP6_ECHO_REPLY] ||
2526 + icmp6stat.icp6s_outhist[ICMP6_ECHO_REPLY]))) {
2527 + do_icmp6_echos = CONFIG_BOOLEAN_YES;
2528 +
2529 + static RRDSET *st = NULL;
2530 + static RRDDIM *rd_in = NULL, *rd_out = NULL, *rd_in_replies = NULL, *rd_out_replies = NULL;
2531 +
2532 + if (unlikely(!st)) {
2533 + st = rrdset_create_localhost("ipv6",
2534 + "icmpechos",
2535 + NULL,
2536 + "icmp",
2537 + NULL,
2538 + "IPv6 ICMP Echo",
2539 + "messages/s",
2540 + 10200,
2541 + update_every,
2542 + RRDSET_TYPE_LINE
2543 + );
2544 +
2545 + rd_in = rrddim_add(st, "InEchos", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2546 + rd_out = rrddim_add(st, "OutEchos", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2547 + rd_in_replies = rrddim_add(st, "InEchoReplies", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2548 + rd_out_replies = rrddim_add(st, "OutEchoReplies", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2549 + } else
2550 + rrdset_next(st);
2551 +
2552 + rrddim_set_by_pointer(st, rd_in, icmp6stat.icp6s_inhist[ICMP6_ECHO_REQUEST]);
2553 + rrddim_set_by_pointer(st, rd_out, icmp6stat.icp6s_outhist[ICMP6_ECHO_REQUEST]);
2554 + rrddim_set_by_pointer(st, rd_in_replies, icmp6stat.icp6s_inhist[ICMP6_ECHO_REPLY]);
2555 + rrddim_set_by_pointer(st, rd_out_replies, icmp6stat.icp6s_outhist[ICMP6_ECHO_REPLY]);
2556 + rrdset_done(st);
2557 + }
2558 +
2559 + // --------------------------------------------------------------------
2560 +
2561 + if (do_icmp6_router == CONFIG_BOOLEAN_YES || (do_icmp6_router == CONFIG_BOOLEAN_AUTO && (
2562 + icmp6stat.icp6s_inhist[ND_ROUTER_SOLICIT] ||
2563 + icmp6stat.icp6s_outhist[ND_ROUTER_SOLICIT] ||
2564 + icmp6stat.icp6s_inhist[ND_ROUTER_ADVERT] ||
2565 + icmp6stat.icp6s_outhist[ND_ROUTER_ADVERT]))) {
2566 + do_icmp6_router = CONFIG_BOOLEAN_YES;
2567 +
2568 + static RRDSET *st = NULL;
2569 + static RRDDIM *rd_in_solicits = NULL, *rd_out_solicits = NULL,
2570 + *rd_in_advertisements = NULL, *rd_out_advertisements = NULL;
2571 +
2572 + if (unlikely(!st)) {
2573 + st = rrdset_create_localhost("ipv6",
2574 + "icmprouter",
2575 + NULL,
2576 + "icmp",
2577 + NULL,
2578 + "IPv6 Router Messages",
2579 + "messages/s",
2580 + 10400,
2581 + update_every,
2582 + RRDSET_TYPE_LINE
2583 + );
2584 +
2585 + rd_in_solicits = rrddim_add(st, "InSolicits", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2586 + rd_out_solicits = rrddim_add(st, "OutSolicits", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2587 + rd_in_advertisements = rrddim_add(st, "InAdvertisements", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2588 + rd_out_advertisements = rrddim_add(st, "OutAdvertisements", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2589 + } else
2590 + rrdset_next(st);
2591 +
2592 + rrddim_set_by_pointer(st, rd_in_solicits, icmp6stat.icp6s_inhist[ND_ROUTER_SOLICIT]);
2593 + rrddim_set_by_pointer(st, rd_out_solicits, icmp6stat.icp6s_outhist[ND_ROUTER_SOLICIT]);
2594 + rrddim_set_by_pointer(st, rd_in_advertisements, icmp6stat.icp6s_inhist[ND_ROUTER_ADVERT]);
2595 + rrddim_set_by_pointer(st, rd_out_advertisements, icmp6stat.icp6s_outhist[ND_ROUTER_ADVERT]);
2596 + rrdset_done(st);
2597 + }
2598 +
2599 + // --------------------------------------------------------------------
2600 +
2601 + if (do_icmp6_neighbor == CONFIG_BOOLEAN_YES || (do_icmp6_neighbor == CONFIG_BOOLEAN_AUTO && (
2602 + icmp6stat.icp6s_inhist[ND_NEIGHBOR_SOLICIT] ||
2603 + icmp6stat.icp6s_outhist[ND_NEIGHBOR_SOLICIT] ||
2604 + icmp6stat.icp6s_inhist[ND_NEIGHBOR_ADVERT] ||
2605 + icmp6stat.icp6s_outhist[ND_NEIGHBOR_ADVERT]))) {
2606 + do_icmp6_neighbor = CONFIG_BOOLEAN_YES;
2607 +
2608 + static RRDSET *st = NULL;
2609 + static RRDDIM *rd_in_solicits = NULL, *rd_out_solicits = NULL,
2610 + *rd_in_advertisements = NULL, *rd_out_advertisements = NULL;
2611 +
2612 + if (unlikely(!st)) {
2613 + st = rrdset_create_localhost("ipv6",
2614 + "icmpneighbor",
2615 + NULL,
2616 + "icmp",
2617 + NULL,
2618 + "IPv6 Neighbor Messages",
2619 + "messages/s",
2620 + 10500,
2621 + update_every,
2622 + RRDSET_TYPE_LINE
2623 + );
2624 +
2625 + rd_in_solicits = rrddim_add(st, "InSolicits", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2626 + rd_out_solicits = rrddim_add(st, "OutSolicits", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2627 + rd_in_advertisements = rrddim_add(st, "InAdvertisements", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2628 + rd_out_advertisements = rrddim_add(st, "OutAdvertisements", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2629 + } else
2630 + rrdset_next(st);
2631 +
2632 + rrddim_set_by_pointer(st, rd_in_solicits, icmp6stat.icp6s_inhist[ND_NEIGHBOR_SOLICIT]);
2633 + rrddim_set_by_pointer(st, rd_out_solicits, icmp6stat.icp6s_outhist[ND_NEIGHBOR_SOLICIT]);
2634 + rrddim_set_by_pointer(st, rd_in_advertisements, icmp6stat.icp6s_inhist[ND_NEIGHBOR_ADVERT]);
2635 + rrddim_set_by_pointer(st, rd_out_advertisements, icmp6stat.icp6s_outhist[ND_NEIGHBOR_ADVERT]);
2636 + rrdset_done(st);
2637 + }
2638 +
2639 + // --------------------------------------------------------------------
2640 +
2641 + if (do_icmp6_types == CONFIG_BOOLEAN_YES || (do_icmp6_types == CONFIG_BOOLEAN_AUTO && (
2642 + icmp6stat.icp6s_inhist[1] ||
2643 + icmp6stat.icp6s_inhist[128] ||
2644 + icmp6stat.icp6s_inhist[129] ||
2645 + icmp6stat.icp6s_inhist[136] ||
2646 + icmp6stat.icp6s_outhist[1] ||
2647 + icmp6stat.icp6s_outhist[128] ||
2648 + icmp6stat.icp6s_outhist[129] ||
2649 + icmp6stat.icp6s_outhist[133] ||
2650 + icmp6stat.icp6s_outhist[135] ||
2651 + icmp6stat.icp6s_outhist[136]))) {
2652 + do_icmp6_types = CONFIG_BOOLEAN_YES;
2653 +
2654 + static RRDSET *st = NULL;
2655 + static RRDDIM *rd_in_1 = NULL, *rd_in_128 = NULL, *rd_in_129 = NULL, *rd_in_136 = NULL,
2656 + *rd_out_1 = NULL, *rd_out_128 = NULL, *rd_out_129 = NULL, *rd_out_133 = NULL,
2657 + *rd_out_135 = NULL, *rd_out_143 = NULL;
2658 +
2659 + if (unlikely(!st)) {
2660 + st = rrdset_create_localhost("ipv6",
2661 + "icmptypes",
2662 + NULL,
2663 + "icmp",
2664 + NULL,
2665 + "IPv6 ICMP Types",
2666 + "messages/s",
2667 + 10700,
2668 + update_every,
2669 + RRDSET_TYPE_LINE
2670 + );
2671 +
2672 + rd_in_1 = rrddim_add(st, "InType1", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2673 + rd_in_128 = rrddim_add(st, "InType128", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2674 + rd_in_129 = rrddim_add(st, "InType129", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2675 + rd_in_136 = rrddim_add(st, "InType136", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2676 + rd_out_1 = rrddim_add(st, "OutType1", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2677 + rd_out_128 = rrddim_add(st, "OutType128", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2678 + rd_out_129 = rrddim_add(st, "OutType129", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2679 + rd_out_133 = rrddim_add(st, "OutType133", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2680 + rd_out_135 = rrddim_add(st, "OutType135", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2681 + rd_out_143 = rrddim_add(st, "OutType143", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2682 + } else
2683 + rrdset_next(st);
2684 +
2685 + rrddim_set_by_pointer(st, rd_in_1, icmp6stat.icp6s_inhist[1]);
2686 + rrddim_set_by_pointer(st, rd_in_128, icmp6stat.icp6s_inhist[128]);
2687 + rrddim_set_by_pointer(st, rd_in_129, icmp6stat.icp6s_inhist[129]);
2688 + rrddim_set_by_pointer(st, rd_in_136, icmp6stat.icp6s_inhist[136]);
2689 + rrddim_set_by_pointer(st, rd_out_1, icmp6stat.icp6s_outhist[1]);
2690 + rrddim_set_by_pointer(st, rd_out_128, icmp6stat.icp6s_outhist[128]);
2691 + rrddim_set_by_pointer(st, rd_out_129, icmp6stat.icp6s_outhist[129]);
2692 + rrddim_set_by_pointer(st, rd_out_133, icmp6stat.icp6s_outhist[133]);
2693 + rrddim_set_by_pointer(st, rd_out_135, icmp6stat.icp6s_outhist[135]);
2694 + rrddim_set_by_pointer(st, rd_out_143, icmp6stat.icp6s_outhist[143]);
2695 + rrdset_done(st);
2696 + }
2697 + }
2698 + } else {
2699 + error("DISABLED: net.inet6.icmp6.stats module");
2700 + return 1;
2701 + }
2702 +
2703 + return 0;
2704 +}
2705 +
2706 // --------------------------------------------------------------------------------------------------------------------
2707 // old sources
2708
2709 int do_freebsd_sysctl_old(int update_every, usec_t dt) {
2349 - static int do_disk_io = -1,
2350 - do_bandwidth = -1,
2351 - do_icmp6 = -1, do_icmp6_redir = -1, do_icmp6_errors = -1, do_icmp6_echos = -1, do_icmp6_router = -1,
2352 - do_icmp6_neighbor = -1, do_icmp6_types = -1, do_space = -1, do_inodes = -1;
2710 + static int do_disk_io = -1, do_bandwidth = -1, do_space = -1, do_inodes = -1;
2711
2712 if (unlikely(do_disk_io == -1)) {
2713 do_disk_io = config_get_boolean("plugin:freebsd:sysctl", "stats for all disks", 1);
2714 do_bandwidth = config_get_boolean("plugin:freebsd:sysctl", "bandwidth", 1);
2357 - do_icmp6 = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp", CONFIG_BOOLEAN_AUTO);
2358 - do_icmp6_redir = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp redirects", CONFIG_BOOLEAN_AUTO);
2359 - do_icmp6_errors = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp errors", CONFIG_BOOLEAN_AUTO);
2360 - do_icmp6_echos = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp echos", CONFIG_BOOLEAN_AUTO);
2361 - do_icmp6_router = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp router", CONFIG_BOOLEAN_AUTO);
2362 - do_icmp6_neighbor = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp neighbor", CONFIG_BOOLEAN_AUTO);
2363 - do_icmp6_types = config_get_boolean_ondemand("plugin:freebsd:sysctl", "icmp types", CONFIG_BOOLEAN_AUTO);
2715 do_space = config_get_boolean("plugin:freebsd:sysctl", "space usage for all disks", 1);
2716 do_inodes = config_get_boolean("plugin:freebsd:sysctl", "inodes usage for all disks", 1);
2717 }
@@ -2400,13 +2751,6 @@ int do_freebsd_sysctl_old(int update_every, usec_t dt) {
2751 u_long ift_obytes;
2752 } iftot = {0, 0};
2753
2403 - // NEEDED BY: do_icmp6...
2404 - struct icmp6stat icmp6stat;
2405 - struct icmp6_total {
2406 - u_long msgs_in;
2407 - u_long msgs_out;
2408 - } icmp6_total = {0, 0};
2409 -
2754 // NEEDED BY: do_space, do_inodes
2755 struct statfs *mntbuf;
2756 int mntsize;
@@ -2738,225 +3082,6 @@ int do_freebsd_sysctl_old(int update_every, usec_t dt) {
3082 }
3083 }
3084
2741 - // --------------------------------------------------------------------
2742 -
2743 - if (likely(do_icmp6 || do_icmp6_redir || do_icmp6_errors || do_icmp6_echos || do_icmp6_router || do_icmp6_neighbor || do_icmp6_types)) {
2744 - if (unlikely(GETSYSCTL_BY_NAME("net.inet6.icmp6.stats", icmp6stat))) {
2745 - do_icmp6 = 0;
2746 - error("DISABLED: ipv6.icmp");
2747 - } else {
2748 - for (i = 0; i <= ICMP6_MAXTYPE; i++) {
2749 - icmp6_total.msgs_in += icmp6stat.icp6s_inhist[i];
2750 - icmp6_total.msgs_out += icmp6stat.icp6s_outhist[i];
2751 - }
2752 - icmp6_total.msgs_in += icmp6stat.icp6s_badcode + icmp6stat.icp6s_badlen + icmp6stat.icp6s_checksum + icmp6stat.icp6s_tooshort;
2753 - if (do_icmp6 == CONFIG_BOOLEAN_YES || (do_icmp6 == CONFIG_BOOLEAN_AUTO && (icmp6_total.msgs_in || icmp6_total.msgs_out))) {
2754 - do_icmp6 = CONFIG_BOOLEAN_YES;
2755 - st = rrdset_find_localhost("ipv6.icmp");
2756 - if (unlikely(!st)) {
2757 - st = rrdset_create_localhost("ipv6", "icmp", NULL, "icmp", NULL, "IPv6 ICMP Messages",
2758 - "messages/s", 10000, update_every, RRDSET_TYPE_LINE);
2759 -
2760 - rrddim_add(st, "received", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2761 - rrddim_add(st, "sent", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2762 - } else
2763 - rrdset_next(st);
2764 -
2765 - rrddim_set(st, "sent", icmp6_total.msgs_in);
2766 - rrddim_set(st, "received", icmp6_total.msgs_out);
2767 - rrdset_done(st);
2768 - }
2769 -
2770 - // --------------------------------------------------------------------
2771 -
2772 - if (do_icmp6_redir == CONFIG_BOOLEAN_YES || (do_icmp6_redir == CONFIG_BOOLEAN_AUTO && (icmp6stat.icp6s_inhist[ND_REDIRECT] || icmp6stat.icp6s_outhist[ND_REDIRECT]))) {
2773 - do_icmp6_redir = CONFIG_BOOLEAN_YES;
2774 - st = rrdset_find_localhost("ipv6.icmpredir");
2775 - if (unlikely(!st)) {
2776 - st = rrdset_create_localhost("ipv6", "icmpredir", NULL, "icmp", NULL, "IPv6 ICMP Redirects",
2777 - "redirects/s", 10050, update_every, RRDSET_TYPE_LINE);
2778 -
2779 - rrddim_add(st, "received", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2780 - rrddim_add(st, "sent", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2781 - } else
2782 - rrdset_next(st);
2783 -
2784 - rrddim_set(st, "sent", icmp6stat.icp6s_inhist[ND_REDIRECT]);
2785 - rrddim_set(st, "received", icmp6stat.icp6s_outhist[ND_REDIRECT]);
2786 - rrdset_done(st);
2787 - }
2788 -
2789 - // --------------------------------------------------------------------
2790 -
2791 - if (do_icmp6_errors == CONFIG_BOOLEAN_YES || (do_icmp6_errors == CONFIG_BOOLEAN_AUTO && (
2792 - icmp6stat.icp6s_badcode ||
2793 - icmp6stat.icp6s_badlen ||
2794 - icmp6stat.icp6s_checksum ||
2795 - icmp6stat.icp6s_tooshort ||
2796 - icmp6stat.icp6s_error ||
2797 - icmp6stat.icp6s_inhist[ICMP6_DST_UNREACH] ||
2798 - icmp6stat.icp6s_inhist[ICMP6_TIME_EXCEEDED] ||
2799 - icmp6stat.icp6s_inhist[ICMP6_PARAM_PROB] ||
2800 - icmp6stat.icp6s_outhist[ICMP6_DST_UNREACH] ||
2801 - icmp6stat.icp6s_outhist[ICMP6_TIME_EXCEEDED] ||
2802 - icmp6stat.icp6s_outhist[ICMP6_PARAM_PROB]))) {
2803 - do_icmp6_errors = CONFIG_BOOLEAN_YES;
2804 - st = rrdset_find_localhost("ipv6.icmperrors");
2805 - if (unlikely(!st)) {
2806 - st = rrdset_create_localhost("ipv6", "icmperrors", NULL, "icmp", NULL, "IPv6 ICMP Errors", "errors/s", 10100, update_every, RRDSET_TYPE_LINE);
2807 -
2808 - rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2809 - rrddim_add(st, "OutErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2810 -
2811 - rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2812 - rrddim_add(st, "InDestUnreachs", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2813 - rrddim_add(st, "InPktTooBigs", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2814 - rrddim_add(st, "InTimeExcds", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2815 - rrddim_add(st, "InParmProblems", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2816 - rrddim_add(st, "OutDestUnreachs", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2817 - rrddim_add(st, "OutTimeExcds", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2818 - rrddim_add(st, "OutParmProblems", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2819 - } else
2820 - rrdset_next(st);
2821 -
2822 - rrddim_set(st, "InErrors", icmp6stat.icp6s_badcode + icmp6stat.icp6s_badlen + icmp6stat.icp6s_checksum + icmp6stat.icp6s_tooshort);
2823 - rrddim_set(st, "OutErrors", icmp6stat.icp6s_error);
2824 - rrddim_set(st, "InCsumErrors", icmp6stat.icp6s_checksum);
2825 - rrddim_set(st, "InDestUnreachs", icmp6stat.icp6s_inhist[ICMP6_DST_UNREACH]);
2826 - rrddim_set(st, "InPktTooBigs", icmp6stat.icp6s_badlen);
2827 - rrddim_set(st, "InTimeExcds", icmp6stat.icp6s_inhist[ICMP6_TIME_EXCEEDED]);
2828 - rrddim_set(st, "InParmProblems", icmp6stat.icp6s_inhist[ICMP6_PARAM_PROB]);
2829 - rrddim_set(st, "OutDestUnreachs", icmp6stat.icp6s_outhist[ICMP6_DST_UNREACH]);
2830 - rrddim_set(st, "OutTimeExcds", icmp6stat.icp6s_outhist[ICMP6_TIME_EXCEEDED]);
2831 - rrddim_set(st, "OutParmProblems", icmp6stat.icp6s_outhist[ICMP6_PARAM_PROB]);
2832 - rrdset_done(st);
2833 - }
2834 -
2835 - // --------------------------------------------------------------------
2836 -
2837 - if (do_icmp6_echos == CONFIG_BOOLEAN_YES || (do_icmp6_echos == CONFIG_BOOLEAN_AUTO && (
2838 - icmp6stat.icp6s_inhist[ICMP6_ECHO_REQUEST] ||
2839 - icmp6stat.icp6s_outhist[ICMP6_ECHO_REQUEST] ||
2840 - icmp6stat.icp6s_inhist[ICMP6_ECHO_REPLY] ||
2841 - icmp6stat.icp6s_outhist[ICMP6_ECHO_REPLY]))) {
2842 - do_icmp6_echos = CONFIG_BOOLEAN_YES;
2843 - st = rrdset_find_localhost("ipv6.icmpechos");
2844 - if (unlikely(!st)) {
2845 - st = rrdset_create_localhost("ipv6", "icmpechos", NULL, "icmp", NULL, "IPv6 ICMP Echo", "messages/s", 10200, update_every, RRDSET_TYPE_LINE);
2846 -
2847 - rrddim_add(st, "InEchos", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2848 - rrddim_add(st, "OutEchos", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2849 - rrddim_add(st, "InEchoReplies", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2850 - rrddim_add(st, "OutEchoReplies", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2851 - } else
2852 - rrdset_next(st);
2853 -
2854 - rrddim_set(st, "InEchos", icmp6stat.icp6s_inhist[ICMP6_ECHO_REQUEST]);
2855 - rrddim_set(st, "OutEchos", icmp6stat.icp6s_outhist[ICMP6_ECHO_REQUEST]);
2856 - rrddim_set(st, "InEchoReplies", icmp6stat.icp6s_inhist[ICMP6_ECHO_REPLY]);
2857 - rrddim_set(st, "OutEchoReplies", icmp6stat.icp6s_outhist[ICMP6_ECHO_REPLY]);
2858 - rrdset_done(st);
2859 - }
2860 -
2861 - // --------------------------------------------------------------------
2862 -
2863 - if (do_icmp6_router == CONFIG_BOOLEAN_YES || (do_icmp6_router == CONFIG_BOOLEAN_AUTO && (
2864 - icmp6stat.icp6s_inhist[ND_ROUTER_SOLICIT] ||
2865 - icmp6stat.icp6s_outhist[ND_ROUTER_SOLICIT] ||
2866 - icmp6stat.icp6s_inhist[ND_ROUTER_ADVERT] ||
2867 - icmp6stat.icp6s_outhist[ND_ROUTER_ADVERT]))) {
2868 - do_icmp6_router = CONFIG_BOOLEAN_YES;
2869 - st = rrdset_find_localhost("ipv6.icmprouter");
2870 - if (unlikely(!st)) {
2871 - st = rrdset_create_localhost("ipv6", "icmprouter", NULL, "icmp", NULL, "IPv6 Router Messages", "messages/s", 10400, update_every, RRDSET_TYPE_LINE);
2872 -
2873 - rrddim_add(st, "InSolicits", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2874 - rrddim_add(st, "OutSolicits", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2875 - rrddim_add(st, "InAdvertisements", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2876 - rrddim_add(st, "OutAdvertisements", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2877 - } else
2878 - rrdset_next(st);
2879 -
2880 - rrddim_set(st, "InSolicits", icmp6stat.icp6s_inhist[ND_ROUTER_SOLICIT]);
2881 - rrddim_set(st, "OutSolicits", icmp6stat.icp6s_outhist[ND_ROUTER_SOLICIT]);
2882 - rrddim_set(st, "InAdvertisements", icmp6stat.icp6s_inhist[ND_ROUTER_ADVERT]);
2883 - rrddim_set(st, "OutAdvertisements", icmp6stat.icp6s_outhist[ND_ROUTER_ADVERT]);
2884 - rrdset_done(st);
2885 - }
2886 -
2887 - // --------------------------------------------------------------------
2888 -
2889 - if (do_icmp6_neighbor == CONFIG_BOOLEAN_YES || (do_icmp6_neighbor == CONFIG_BOOLEAN_AUTO && (
2890 - icmp6stat.icp6s_inhist[ND_NEIGHBOR_SOLICIT] ||
2891 - icmp6stat.icp6s_outhist[ND_NEIGHBOR_SOLICIT] ||
2892 - icmp6stat.icp6s_inhist[ND_NEIGHBOR_ADVERT] ||
2893 - icmp6stat.icp6s_outhist[ND_NEIGHBOR_ADVERT]))) {
2894 - do_icmp6_neighbor = CONFIG_BOOLEAN_YES;
2895 - st = rrdset_find_localhost("ipv6.icmpneighbor");
2896 - if (unlikely(!st)) {
2897 - st = rrdset_create_localhost("ipv6", "icmpneighbor", NULL, "icmp", NULL, "IPv6 Neighbor Messages", "messages/s", 10500, update_every, RRDSET_TYPE_LINE);
2898 -
2899 - rrddim_add(st, "InSolicits", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2900 - rrddim_add(st, "OutSolicits", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2901 - rrddim_add(st, "InAdvertisements", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2902 - rrddim_add(st, "OutAdvertisements", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2903 - } else
2904 - rrdset_next(st);
2905 -
2906 - rrddim_set(st, "InSolicits", icmp6stat.icp6s_inhist[ND_NEIGHBOR_SOLICIT]);
2907 - rrddim_set(st, "OutSolicits", icmp6stat.icp6s_outhist[ND_NEIGHBOR_SOLICIT]);
2908 - rrddim_set(st, "InAdvertisements", icmp6stat.icp6s_inhist[ND_NEIGHBOR_ADVERT]);
2909 - rrddim_set(st, "OutAdvertisements", icmp6stat.icp6s_outhist[ND_NEIGHBOR_ADVERT]);
2910 - rrdset_done(st);
2911 - }
2912 -
2913 - // --------------------------------------------------------------------
2914 -
2915 - if (do_icmp6_types == CONFIG_BOOLEAN_YES || (do_icmp6_types == CONFIG_BOOLEAN_AUTO && (
2916 - icmp6stat.icp6s_inhist[1] ||
2917 - icmp6stat.icp6s_inhist[128] ||
2918 - icmp6stat.icp6s_inhist[129] ||
2919 - icmp6stat.icp6s_inhist[136] ||
2920 - icmp6stat.icp6s_outhist[1] ||
2921 - icmp6stat.icp6s_outhist[128] ||
2922 - icmp6stat.icp6s_outhist[129] ||
2923 - icmp6stat.icp6s_outhist[133] ||
2924 - icmp6stat.icp6s_outhist[135] ||
2925 - icmp6stat.icp6s_outhist[136]))) {
2926 - do_icmp6_types = CONFIG_BOOLEAN_YES;
2927 - st = rrdset_find_localhost("ipv6.icmptypes");
2928 - if (unlikely(!st)) {
2929 - st = rrdset_create_localhost("ipv6", "icmptypes", NULL, "icmp", NULL, "IPv6 ICMP Types",
2930 - "messages/s", 10700, update_every, RRDSET_TYPE_LINE);
2931 -
2932 - rrddim_add(st, "InType1", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2933 - rrddim_add(st, "InType128", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2934 - rrddim_add(st, "InType129", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2935 - rrddim_add(st, "InType136", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2936 - rrddim_add(st, "OutType1", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2937 - rrddim_add(st, "OutType128", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2938 - rrddim_add(st, "OutType129", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2939 - rrddim_add(st, "OutType133", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2940 - rrddim_add(st, "OutType135", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2941 - rrddim_add(st, "OutType143", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2942 - } else
2943 - rrdset_next(st);
2944 -
2945 - rrddim_set(st, "InType1", icmp6stat.icp6s_inhist[1]);
2946 - rrddim_set(st, "InType128", icmp6stat.icp6s_inhist[128]);
2947 - rrddim_set(st, "InType129", icmp6stat.icp6s_inhist[129]);
2948 - rrddim_set(st, "InType136", icmp6stat.icp6s_inhist[136]);
2949 - rrddim_set(st, "OutType1", icmp6stat.icp6s_outhist[1]);
2950 - rrddim_set(st, "OutType128", icmp6stat.icp6s_outhist[128]);
2951 - rrddim_set(st, "OutType129", icmp6stat.icp6s_outhist[129]);
2952 - rrddim_set(st, "OutType133", icmp6stat.icp6s_outhist[133]);
2953 - rrddim_set(st, "OutType135", icmp6stat.icp6s_outhist[135]);
2954 - rrddim_set(st, "OutType143", icmp6stat.icp6s_outhist[143]);
2955 - rrdset_done(st);
2956 - }
2957 - }
2958 - }
2959 -
3085 // --------------------------------------------------------------------------
3086
3087 if (likely(do_space || do_inodes)) {
src/plugin_freebsd.c
+14 -13
@@ -20,26 +20,27 @@ static struct freebsd_module {
20 { .name = "vm.vmtotal", .dim = "vmtotal", .enabled = 1, .func = do_vm_vmtotal },
21 { .name = "kern.cp_time", .dim = "cp_time", .enabled = 1, .func = do_kern_cp_time },
22 { .name = "hw.intrcnt", .dim = "hw_intr", .enabled = 1, .func = do_hw_intcnt },
23 - { .name = "vm.stats.sys.v_intr", .dim = "dev_intr", .enabled = 1, .func = do_vm_stats_sys_v_intr },
24 - { .name = "vm.stats.sys.v_soft", .dim = "soft_intr", .enabled = 1, .func = do_vm_stats_sys_v_soft },
25 - { .name = "vm.stats.sys.v_swtch", .dim = "context_swtch", .enabled = 1, .func = do_vm_stats_sys_v_swtch },
26 - { .name = "vm.stats.vm.v_forks", .dim = "forks", .enabled = 1, .func = do_vm_stats_sys_v_forks },
23 + { .name = "vm.stats.sys.v_intr", .dim = "dev_intr", .enabled = 1, .func = do_vm_stats_sys_v_intr },
24 + { .name = "vm.stats.sys.v_soft", .dim = "soft_intr", .enabled = 1, .func = do_vm_stats_sys_v_soft },
25 + { .name = "vm.stats.sys.v_swtch", .dim = "context_swtch", .enabled = 1, .func = do_vm_stats_sys_v_swtch },
26 + { .name = "vm.stats.vm.v_forks", .dim = "forks", .enabled = 1, .func = do_vm_stats_sys_v_forks },
27 { .name = "vm.swap_info", .dim = "swap", .enabled = 1, .func = do_vm_swap_info },
28 { .name = "system.ram", .dim = "system_ram", .enabled = 1, .func = do_system_ram },
29 - { .name = "vm.stats.vm.v_swappgs", .dim = "swap_io", .enabled = 1, .func = do_vm_stats_sys_v_swappgs },
29 + { .name = "vm.stats.vm.v_swappgs", .dim = "swap_io", .enabled = 1, .func = do_vm_stats_sys_v_swappgs },
30 { .name = "kern.ipc.sem", .dim = "semaphores", .enabled = 1, .func = do_kern_ipc_sem },
31 { .name = "kern.ipc.shm", .dim = "shared_memory", .enabled = 1, .func = do_kern_ipc_shm },
32 { .name = "kern.ipc.msq", .dim = "message_queues", .enabled = 1, .func = do_kern_ipc_msq },
33 - { .name = "uptime", .dim = "uptime", .enabled = 1, .func = do_uptime },
34 - { .name = "net.isr", .dim = "net_isr", .enabled = 1, .func = do_net_isr },
33 + { .name = "uptime", .dim = "uptime", .enabled = 1, .func = do_uptime },
34 + { .name = "net.isr", .dim = "net_isr", .enabled = 1, .func = do_net_isr },
35
36 // network metrics
37 - { .name = "net.inet.tcp.states", .dim = "tcp_states", .enabled = 1, .func = do_net_inet_tcp_states },
38 - { .name = "net.inet.tcp.stats", .dim = "tcp_stats", .enabled = 1, .func = do_net_inet_tcp_stats },
39 - { .name = "net.inet.udp.stats", .dim = "udp_stats", .enabled = 1, .func = do_net_inet_udp_stats },
40 - { .name = "net.inet.icmp.stats", .dim = "icmp_stats", .enabled = 1, .func = do_net_inet_icmp_stats },
41 - { .name = "net.inet.ip.stats", .dim = "ip_stats", .enabled = 1, .func = do_net_inet_ip_stats },
42 - { .name = "net.inet6.ip6.stats", .dim = "ip6_stats", .enabled = 1, .func = do_net_inet6_ip6_stats },
37 + { .name = "net.inet.tcp.states", .dim = "tcp_states", .enabled = 1, .func = do_net_inet_tcp_states },
38 + { .name = "net.inet.tcp.stats", .dim = "tcp_stats", .enabled = 1, .func = do_net_inet_tcp_stats },
39 + { .name = "net.inet.udp.stats", .dim = "udp_stats", .enabled = 1, .func = do_net_inet_udp_stats },
40 + { .name = "net.inet.icmp.stats", .dim = "icmp_stats", .enabled = 1, .func = do_net_inet_icmp_stats },
41 + { .name = "net.inet.ip.stats", .dim = "ip_stats", .enabled = 1, .func = do_net_inet_ip_stats },
42 + { .name = "net.inet6.ip6.stats", .dim = "ip6_stats", .enabled = 1, .func = do_net_inet6_ip6_stats },
43 + { .name = "net.inet6.icmp6.stats", .dim = "icmp6_stats", .enabled = 1, .func = do_net_inet6_icmp6_stats },
44
45 // CPU metrics
46 { .name = "kern.cp_times", .dim = "cp_times", .enabled = 1, .func = do_kern_cp_times },
src/plugin_freebsd.h
+1
@@ -31,6 +31,7 @@ extern int do_net_inet_udp_stats(int update_every, usec_t dt);
31 extern int do_net_inet_icmp_stats(int update_every, usec_t dt);
32 extern int do_net_inet_ip_stats(int update_every, usec_t dt);
33 extern int do_net_inet6_ip6_stats(int update_every, usec_t dt);
34 +extern int do_net_inet6_icmp6_stats(int update_every, usec_t dt);
35
36 extern int do_freebsd_sysctl_old(int update_every, usec_t dt);
37