diff options
author | Costa Tsaousis <costa@tsaousis.gr> | 2018-09-27 20:37:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-27 20:37:00 +0300 |
commit | a440a24688f2258bba3ac2e7bbd57c112581893d (patch) | |
tree | dfc8a3d1a914f71cd48d90018f1b318cfb2bddf6 /src | |
parent | e7933ec9541eae74b8085c0b2001fc3f21a1557e (diff) |
tcp syn and accept queue charts and alarms (#4281)
* tcp syn and accept queue charts and alarms; fixes #3234
* tcp syn and accept queue converted to auto
* updated configs.signatures
* enable 1m_ipv4_tcp_accept_queue_drops alarm
* /proc/net/netstat refers to the whole networking stack
* updated configs.signatures
Diffstat (limited to 'src')
-rw-r--r-- | src/appconfig.h | 5 | ||||
-rw-r--r-- | src/common.h | 68 | ||||
-rw-r--r-- | src/plugin_nfacct.c | 14 | ||||
-rw-r--r-- | src/plugin_proc.h | 1 | ||||
-rw-r--r-- | src/proc_net_netstat.c | 336 | ||||
-rw-r--r-- | src/proc_net_snmp.c | 17 | ||||
-rw-r--r-- | src/proc_net_snmp6.c | 44 | ||||
-rw-r--r-- | src/proc_net_sockstat6.c | 10 |
8 files changed, 281 insertions, 214 deletions
diff --git a/src/appconfig.h b/src/appconfig.h index c4638bad56..1b6568ec06 100644 --- a/src/appconfig.h +++ b/src/appconfig.h @@ -1,5 +1,7 @@ // SPDX-License-Identifier: GPL-3.0+ +#include "common.h" + #ifndef NETDATA_CONFIG_H #define NETDATA_CONFIG_H 1 @@ -31,7 +33,10 @@ extern struct config #define CONFIG_BOOLEAN_NO 0 #define CONFIG_BOOLEAN_YES 1 + +#ifndef CONFIG_BOOLEAN_AUTO #define CONFIG_BOOLEAN_AUTO 2 +#endif extern int appconfig_load(struct config *root, char *filename, int overwrite_used); diff --git a/src/common.h b/src/common.h index 4ba7f9f822..e48e3541e3 100644 --- a/src/common.h +++ b/src/common.h @@ -145,7 +145,8 @@ // - for each FAMILY +100 // - for each CHART +10 -#define NETDATA_CHART_PRIO_SYSTEM_IPV4 501 +#define NETDATA_CHART_PRIO_SYSTEM_IP 501 +#define NETDATA_CHART_PRIO_SYSTEM_IPV6 502 // Memory Section - 1xxx #define NETDATA_CHART_PRIO_MEM_SYSTEM 1000 @@ -160,44 +161,59 @@ #define NETDATA_CHART_PRIO_MEM_HW 1500 -// IPv4 - -#define NETDATA_CHART_PRIO_IPV4 3000 -#define NETDATA_CHART_PRIO_IPV4_SOCKETS 3000 -#define NETDATA_CHART_PRIO_IPV4_PACKETS 3050 -#define NETDATA_CHART_PRIO_IPV4_ERRORS 3100 - -#define NETDATA_CHART_PRIO_IPV4_ICMP 3150 - -#define NETDATA_CHART_PRIO_IPV4_TCP 3200 -#define NETDATA_CHART_PRIO_IPV4_TCP_MEM 3290 +// IP -#define NETDATA_CHART_PRIO_IPV4_UDP 3300 -#define NETDATA_CHART_PRIO_IPV4_UDP_MEM 3390 +#define NETDATA_CHART_PRIO_IP 4000 +#define NETDATA_CHART_PRIO_IP_ERRORS 4100 +#define NETDATA_CHART_PRIO_IP_TCP 4200 +#define NETDATA_CHART_PRIO_IP_TCP_MEM 4290 +#define NETDATA_CHART_PRIO_IP_BCAST 4500 +#define NETDATA_CHART_PRIO_IP_MCAST 4600 +#define NETDATA_CHART_PRIO_IP_ECN 4700 -#define NETDATA_CHART_PRIO_IPV4_UDPLITE 3400 -#define NETDATA_CHART_PRIO_IPV4_RAW 3450 - -#define NETDATA_CHART_PRIO_IPV4_FRAGMENTS 3460 -#define NETDATA_CHART_PRIO_IPV4_FRAGMENTS_MEM 3470 +// IPv4 -#define NETDATA_CHART_PRIO_IPV4_BCAST 3500 -#define NETDATA_CHART_PRIO_IPV4_MCAST 3600 -#define NETDATA_CHART_PRIO_IPV4_ECN 3700 +#define NETDATA_CHART_PRIO_IPV4 5100 +#define NETDATA_CHART_PRIO_IPV4_SOCKETS 5100 +#define NETDATA_CHART_PRIO_IPV4_PACKETS 5130 +#define NETDATA_CHART_PRIO_IPV4_ERRORS 5150 +#define NETDATA_CHART_PRIO_IPV4_ICMP 5170 +#define NETDATA_CHART_PRIO_IPV4_TCP 5200 +#define NETDATA_CHART_PRIO_IPV4_TCP_MEM 5290 +#define NETDATA_CHART_PRIO_IPV4_UDP 5300 +#define NETDATA_CHART_PRIO_IPV4_UDP_MEM 5390 +#define NETDATA_CHART_PRIO_IPV4_UDPLITE 5400 +#define NETDATA_CHART_PRIO_IPV4_RAW 5450 +#define NETDATA_CHART_PRIO_IPV4_FRAGMENTS 5460 +#define NETDATA_CHART_PRIO_IPV4_FRAGMENTS_MEM 5470 // IPv6 -#define NETDATA_CHART_PRIO_IPV6 3500 +#define NETDATA_CHART_PRIO_IPV6 6200 +#define NETDATA_CHART_PRIO_IPV6_PACKETS 6200 +#define NETDATA_CHART_PRIO_IPV6_ERRORS 6300 +#define NETDATA_CHART_PRIO_IPV6_FRAGMENTS 6400 +#define NETDATA_CHART_PRIO_IPV6_TCP 6500 +#define NETDATA_CHART_PRIO_IPV6_UDP 6600 +#define NETDATA_CHART_PRIO_IPV6_UDP_ERRORS 6610 +#define NETDATA_CHART_PRIO_IPV6_UDPLITE 6700 +#define NETDATA_CHART_PRIO_IPV6_UDPLITE_ERRORS 6710 +#define NETDATA_CHART_PRIO_IPV6_RAW 6800 +#define NETDATA_CHART_PRIO_IPV6_BCAST 6840 +#define NETDATA_CHART_PRIO_IPV6_MCAST 6850 +#define NETDATA_CHART_PRIO_IPV6_ICMP 6900 + // SCTP -#define NETDATA_CHART_PRIO_SCTP 3600 +#define NETDATA_CHART_PRIO_SCTP 7000 + // Netfilter -#define NETDATA_CHART_PRIO_NETFILTER 3700 -#define NETDATA_CHART_PRIO_SYNPROXY 3750 +#define NETDATA_CHART_PRIO_NETFILTER 8700 +#define NETDATA_CHART_PRIO_SYNPROXY 8750 // ---------------------------------------------------------------------------- diff --git a/src/plugin_nfacct.c b/src/plugin_nfacct.c index 9cdbaa347e..f00498fdc0 100644 --- a/src/plugin_nfacct.c +++ b/src/plugin_nfacct.c @@ -306,7 +306,7 @@ static void nfstat_send_metrics() { , "connections/s" , "nfacct" , NULL - , 3001 + , NETDATA_CHART_PRIO_NETFILTER + 1 , nfstat_root.update_every , RRDSET_TYPE_LINE ); @@ -342,7 +342,7 @@ static void nfstat_send_metrics() { , "changes/s" , "nfacct" , NULL - , 3002 + , NETDATA_CHART_PRIO_NETFILTER + 2 , nfstat_root.update_every , RRDSET_TYPE_LINE ); @@ -379,7 +379,7 @@ static void nfstat_send_metrics() { , "searches/s" , "nfacct" , NULL - , 3010 + , NETDATA_CHART_PRIO_NETFILTER + 10 , nfstat_root.update_every , RRDSET_TYPE_LINE ); @@ -416,7 +416,7 @@ static void nfstat_send_metrics() { , "events/s" , "nfacct" , NULL - , 3005 + , NETDATA_CHART_PRIO_NETFILTER + 5 , nfstat_root.update_every , RRDSET_TYPE_LINE ); @@ -455,7 +455,7 @@ static void nfstat_send_metrics() { , "expectations/s" , "nfacct" , NULL - , 3003 + , NETDATA_CHART_PRIO_NETFILTER + 3 , nfstat_root.update_every , RRDSET_TYPE_LINE ); @@ -675,7 +675,7 @@ static void nfacct_send_metrics() { , "packets/s" , "nfacct" , NULL - , 3206 + , NETDATA_CHART_PRIO_NETFILTER + 206 , nfacct_root.update_every , RRDSET_TYPE_STACKED ); @@ -718,7 +718,7 @@ static void nfacct_send_metrics() { , "kilobytes/s" , "nfacct" , NULL - , 3207 + , NETDATA_CHART_PRIO_NETFILTER + 207 , nfacct_root.update_every , RRDSET_TYPE_STACKED ); diff --git a/src/plugin_proc.h b/src/plugin_proc.h index 6f976b693b..27d6aa63db 100644 --- a/src/plugin_proc.h +++ b/src/plugin_proc.h @@ -37,7 +37,6 @@ extern int get_numa_node_count(void); // metrics that need to be shared among data collectors extern unsigned long long tcpext_TCPSynRetrans; -extern unsigned long long tcpext_TCPReqQFullDrop; // netdev renames extern void netdev_rename_device_add(const char *host_device, const char *container_device, const char *container_name); diff --git a/src/proc_net_netstat.c b/src/proc_net_netstat.c index 965164a215..712e2a354e 100644 --- a/src/proc_net_netstat.c +++ b/src/proc_net_netstat.c @@ -2,8 +2,9 @@ #include "common.h" +#define RRD_TYPE_NET_NETSTAT "ip" + unsigned long long tcpext_TCPSynRetrans = 0; -unsigned long long tcpext_TCPReqQFullDrop = 0; static void parse_line_pair(procfile *ff, ARL_BASE *base, size_t header_line, size_t values_line) { size_t hwords = procfile_linewords(ff, header_line); @@ -26,7 +27,7 @@ int do_proc_net_netstat(int update_every, usec_t dt) { static int do_bandwidth = -1, do_inerrors = -1, do_mcast = -1, do_bcast = -1, do_mcast_p = -1, do_bcast_p = -1, do_ecn = -1, \ do_tcpext_reorder = -1, do_tcpext_syscookies = -1, do_tcpext_ofo = -1, do_tcpext_connaborts = -1, do_tcpext_memory = -1, - do_tcpext_listen = -1; + do_tcpext_syn_queue = -1, do_tcpext_accept_queue = -1; static uint32_t hash_ipext = 0, hash_tcpext = 0; static procfile *ff = NULL; @@ -35,61 +36,61 @@ int do_proc_net_netstat(int update_every, usec_t dt) { static ARL_BASE *arl_ipext = NULL; // -------------------------------------------------------------------- - // IPv4 + // IP - // IPv4 bandwidth + // IP bandwidth static unsigned long long ipext_InOctets = 0; static unsigned long long ipext_OutOctets = 0; - // IPv4 input errors + // IP input errors static unsigned long long ipext_InNoRoutes = 0; static unsigned long long ipext_InTruncatedPkts = 0; static unsigned long long ipext_InCsumErrors = 0; - // IPv4 multicast bandwidth + // IP multicast bandwidth static unsigned long long ipext_InMcastOctets = 0; static unsigned long long ipext_OutMcastOctets = 0; - // IPv4 multicast packets + // IP multicast packets static unsigned long long ipext_InMcastPkts = 0; static unsigned long long ipext_OutMcastPkts = 0; - // IPv4 broadcast bandwidth + // IP broadcast bandwidth static unsigned long long ipext_InBcastOctets = 0; static unsigned long long ipext_OutBcastOctets = 0; - // IPv4 broadcast packets + // IP broadcast packets static unsigned long long ipext_InBcastPkts = 0; static unsigned long long ipext_OutBcastPkts = 0; - // IPv4 ECN + // IP ECN static unsigned long long ipext_InNoECTPkts = 0; static unsigned long long ipext_InECT1Pkts = 0; static unsigned long long ipext_InECT0Pkts = 0; static unsigned long long ipext_InCEPkts = 0; // -------------------------------------------------------------------- - // IPv4 TCP + // IP TCP - // IPv4 TCP Reordering + // IP TCP Reordering static unsigned long long tcpext_TCPRenoReorder = 0; static unsigned long long tcpext_TCPFACKReorder = 0; static unsigned long long tcpext_TCPSACKReorder = 0; static unsigned long long tcpext_TCPTSReorder = 0; - // IPv4 TCP SYN Cookies + // IP TCP SYN Cookies static unsigned long long tcpext_SyncookiesSent = 0; static unsigned long long tcpext_SyncookiesRecv = 0; static unsigned long long tcpext_SyncookiesFailed = 0; - // IPv4 TCP Out Of Order Queue + // IP TCP Out Of Order Queue // http://www.spinics.net/lists/netdev/msg204696.html static unsigned long long tcpext_TCPOFOQueue = 0; // Number of packets queued in OFO queue static unsigned long long tcpext_TCPOFODrop = 0; // Number of packets meant to be queued in OFO but dropped because socket rcvbuf limit hit. static unsigned long long tcpext_TCPOFOMerge = 0; // Number of packets in OFO that were merged with other packets. static unsigned long long tcpext_OfoPruned = 0; // packets dropped from out-of-order queue because of socket buffer overrun - // IPv4 TCP connection resets + // IP TCP connection resets // https://github.com/ecki/net-tools/blob/bd8bceaed2311651710331a7f8990c3e31be9840/statistics.c static unsigned long long tcpext_TCPAbortOnData = 0; // connections reset due to unexpected data static unsigned long long tcpext_TCPAbortOnClose = 0; // connections reset due to early user close @@ -102,10 +103,12 @@ int do_proc_net_netstat(int update_every, usec_t dt) { static unsigned long long tcpext_ListenOverflows = 0; // times the listen queue of a socket overflowed static unsigned long long tcpext_ListenDrops = 0; // SYNs to LISTEN sockets ignored - // IPv4 TCP memory pressures + // IP TCP memory pressures static unsigned long long tcpext_TCPMemoryPressures = 0; - // shared tcpext_TCPReqQFullDrop + static unsigned long long tcpext_TCPReqQFullDrop = 0; + static unsigned long long tcpext_TCPReqQFullDoCookies = 0; + // shared: tcpext_TCPSynRetrans @@ -126,13 +129,15 @@ int do_proc_net_netstat(int update_every, usec_t dt) { do_tcpext_ofo = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP out-of-order queue", CONFIG_BOOLEAN_AUTO); do_tcpext_connaborts = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP connection aborts", CONFIG_BOOLEAN_AUTO); do_tcpext_memory = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP memory pressures", CONFIG_BOOLEAN_AUTO); - do_tcpext_listen = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP listen issues", CONFIG_BOOLEAN_AUTO); + + do_tcpext_syn_queue = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP SYN queue", CONFIG_BOOLEAN_AUTO); + do_tcpext_accept_queue = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP accept queue", CONFIG_BOOLEAN_AUTO); arl_ipext = arl_create("netstat/ipext", NULL, 60); arl_tcpext = arl_create("netstat/tcpext", NULL, 60); // -------------------------------------------------------------------- - // IPv4 + // IP if(do_bandwidth != CONFIG_BOOLEAN_NO) { arl_expect(arl_ipext, "InOctets", &ipext_InOctets); @@ -173,7 +178,7 @@ int do_proc_net_netstat(int update_every, usec_t dt) { } // -------------------------------------------------------------------- - // IPv4 TCP + // IP TCP if(do_tcpext_reorder != CONFIG_BOOLEAN_NO) { arl_expect(arl_tcpext, "TCPFACKReorder", &tcpext_TCPFACKReorder); @@ -208,14 +213,18 @@ int do_proc_net_netstat(int update_every, usec_t dt) { arl_expect(arl_tcpext, "TCPMemoryPressures", &tcpext_TCPMemoryPressures); } - if(do_tcpext_listen != CONFIG_BOOLEAN_NO) { + if(do_tcpext_accept_queue != CONFIG_BOOLEAN_NO) { arl_expect(arl_tcpext, "ListenOverflows", &tcpext_ListenOverflows); arl_expect(arl_tcpext, "ListenDrops", &tcpext_ListenDrops); } + if(do_tcpext_syn_queue != CONFIG_BOOLEAN_NO) { + arl_expect(arl_tcpext, "TCPReqQFullDrop", &tcpext_TCPReqQFullDrop); + arl_expect(arl_tcpext, "TCPReqQFullDoCookies", &tcpext_TCPReqQFullDoCookies); + } + // shared metrics arl_expect(arl_tcpext, "TCPSynRetrans", &tcpext_TCPSynRetrans); - arl_expect(arl_tcpext, "TCPReqQFullDrop", &tcpext_TCPReqQFullDrop); } if(unlikely(!ff)) { @@ -253,111 +262,111 @@ int do_proc_net_netstat(int update_every, usec_t dt) { if(do_bandwidth == CONFIG_BOOLEAN_YES || (do_bandwidth == CONFIG_BOOLEAN_AUTO && (ipext_InOctets || ipext_OutOctets))) { do_bandwidth = CONFIG_BOOLEAN_YES; - static RRDSET *st_system_ipv4 = NULL; + static RRDSET *st_system_ip = NULL; static RRDDIM *rd_in = NULL, *rd_out = NULL; - if(unlikely(!st_system_ipv4)) { - st_system_ipv4 = rrdset_create_localhost( + if(unlikely(!st_system_ip)) { + st_system_ip = rrdset_create_localhost( "system" - , "ipv4" + , RRD_TYPE_NET_NETSTAT , NULL , "network" , NULL - , "IPv4 Bandwidth" + , "IP Bandwidth" , "kilobits/s" , "proc" , "net/netstat" - , NETDATA_CHART_PRIO_SYSTEM_IPV4 + , NETDATA_CHART_PRIO_SYSTEM_IP , update_every , RRDSET_TYPE_AREA ); - rd_in = rrddim_add(st_system_ipv4, "InOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL); - rd_out = rrddim_add(st_system_ipv4, "OutOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL); + rd_in = rrddim_add(st_system_ip, "InOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL); + rd_out = rrddim_add(st_system_ip, "OutOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL); } else - rrdset_next(st_system_ipv4); + rrdset_next(st_system_ip); - rrddim_set_by_pointer(st_system_ipv4, rd_in, ipext_InOctets); - rrddim_set_by_pointer(st_system_ipv4, rd_out, ipext_OutOctets); + rrddim_set_by_pointer(st_system_ip, rd_in, ipext_InOctets); + rrddim_set_by_pointer(st_system_ip, rd_out, ipext_OutOctets); - rrdset_done(st_system_ipv4); + rrdset_done(st_system_ip); } // -------------------------------------------------------------------- if(do_inerrors == CONFIG_BOOLEAN_YES || (do_inerrors == CONFIG_BOOLEAN_AUTO && (ipext_InNoRoutes || ipext_InTruncatedPkts))) { do_inerrors = CONFIG_BOOLEAN_YES; - static RRDSET *st_ipv4_inerrors = NULL; + static RRDSET *st_ip_inerrors = NULL; static RRDDIM *rd_noroutes = NULL, *rd_truncated = NULL, *rd_checksum = NULL; - if(unlikely(!st_ipv4_inerrors)) { - st_ipv4_inerrors = rrdset_create_localhost( - "ipv4" + if(unlikely(!st_ip_inerrors)) { + st_ip_inerrors = rrdset_create_localhost( + RRD_TYPE_NET_NETSTAT , "inerrors" , NULL , "errors" , NULL - , "IPv4 Input Errors" + , "IP Input Errors" , "packets/s" , "proc" , "net/netstat" - , NETDATA_CHART_PRIO_IPV4_ERRORS + , NETDATA_CHART_PRIO_IP_ERRORS , update_every , RRDSET_TYPE_LINE ); - rrdset_flag_set(st_ipv4_inerrors, RRDSET_FLAG_DETAIL); + rrdset_flag_set(st_ip_inerrors, RRDSET_FLAG_DETAIL); - rd_noroutes = rrddim_add(st_ipv4_inerrors, "InNoRoutes", "noroutes", 1, 1, RRD_ALGORITHM_INCREMENTAL); - rd_truncated = rrddim_add(st_ipv4_inerrors, "InTruncatedPkts", "truncated", 1, 1, RRD_ALGORITHM_INCREMENTAL); - rd_checksum = rrddim_add(st_ipv4_inerrors, "InCsumErrors", "checksum", 1, 1, RRD_ALGORITHM_INCREMENTAL); + rd_noroutes = rrddim_add(st_ip_inerrors, "InNoRoutes", "noroutes", 1, 1, RRD_ALGORITHM_INCREMENTAL); + rd_truncated = rrddim_add(st_ip_inerrors, "InTruncatedPkts", "truncated", 1, 1, RRD_ALGORITHM_INCREMENTAL); + rd_checksum = rrddim_add(st_ip_inerrors, "InCsumErrors", "checksum", 1, 1, RRD_ALGORITHM_INCREMENTAL); } else - rrdset_next(st_ipv4_inerrors); + rrdset_next(st_ip_inerrors); - rrddim_set_by_pointer(st_ipv4_inerrors, rd_noroutes, ipext_InNoRoutes); - rrddim_set_by_pointer(st_ipv4_inerrors, rd_truncated, ipext_InTruncatedPkts); - rrddim_set_by_pointer(st_ipv4_inerrors, rd_checksum, ipext_InCsumErrors); + rrddim_set_by_pointer(st_ip_inerrors, rd_noroutes, ipext_InNoRoutes); + rrddim_set_by_pointer(st_ip_inerrors, rd_truncated, ipext_InTruncatedPkts); + rrddim_set_by_pointer(st_ip_inerrors, rd_checksum, ipext_InCsumErrors); - rrdset_done(st_ipv4_inerrors); + rrdset_done(st_ip_inerrors); } // -------------------------------------------------------------------- if(do_mcast == CONFIG_BOOLEAN_YES || (do_mcast == CONFIG_BOOLEAN_AUTO && (ipext_InMcastOctets || ipext_OutMcastOctets))) { do_mcast = CONFIG_BOOLEAN_YES; - static RRDSET *st_ipv4_mcast = NULL; + static RRDSET *st_ip_mcast = NULL; static RRDDIM *rd_in = NULL, *rd_out = NULL; - if(unlikely(!st_ipv4_mcast)) { - st_ipv4_mcast = rrdset_create_localhost( - "ipv4" + if(unlikely(!st_ip_mcast)) { + st_ip_mcast = rrdset_create_localhost( + RRD_TYPE_NET_NETSTAT , "mcast" , NULL , "multicast" , NULL - , "IPv4 Multicast Bandwidth" + , "IP Multicast Bandwidth" , "kilobits/s" , "proc" , "net/netstat" - , NETDATA_CHART_PRIO_IPV4_MCAST + , NETDATA_CHART_PRIO_IP_MCAST , update_every , RRDSET_TYPE_AREA ); - rrdset_flag_set(st_ipv4_mcast, RRDSET_FLAG_DETAIL); + rrdset_flag_set(st_ip_mcast, RRDSET_FLAG_DETAIL); - rd_in = rrddim_add(st_ipv4_mcast, "InMcastOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL); - rd_out = rrddim_add(st_ipv4_mcast, "OutMcastOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL); + rd_in = rrddim_add(st_ip_mcast, "InMcastOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL); + rd_out = rrddim_add(st_ip_mcast, "OutMcastOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL); } else - rrdset_next(st_ipv4_mcast); + rrdset_next(st_ip_mcast); - rrddim_set_by_pointer(st_ipv4_mcast, rd_in, ipext_InMcastOctets); - rrddim_set_by_pointer(st_ipv4_mcast, rd_out, ipext_OutMcastOctets); + rrddim_set_by_pointer(st_ip_mcast, rd_in, ipext_InMcastOctets); + rrddim_set_by_pointer(st_ip_mcast, rd_out, ipext_OutMcastOctets); - rrdset_done(st_ipv4_mcast); + rrdset_done(st_ip_mcast); } // -------------------------------------------------------------------- @@ -365,37 +374,37 @@ int do_proc_net_netstat(int update_every, usec_t dt) { if(do_bcast == CONFIG_BOOLEAN_YES || (do_bcast == CONFIG_BOOLEAN_AUTO && (ipext_InBcastOctets || ipext_OutBcastOctets))) { do_bcast = CONFIG_BOOLEAN_YES; - static RRDSET *st_ipv4_bcast = NULL; + static RRDSET *st_ip_bcast = NULL; static RRDDIM *rd_in = NULL, *rd_out = NULL; - if(unlikely(!st_ipv4_bcast)) { - st_ipv4_bcast = rrdset_create_localhost( - "ipv4" + if(unlikely(!st_ip_bcast)) { + st_ip_bcast = rrdset_create_localhost( + RRD_TYPE_NET_NETSTAT , "bcast" , NULL , "broadcast" , NULL - , "IPv4 Broadcast Bandwidth" + , "IP Broadcast Bandwidth" , "kilobits/s" , "proc" , "net/netstat" - , NETDATA_CHART_PRIO_IPV4_BCAST + , NETDATA_CHART_PRIO_IP_BCAST , update_every , RRDSET_TYPE_AREA ); - rrdset_flag_set(st_ipv4_bcast, RRDSET_FLAG_DETAIL); + rrdset_flag_set(st_ip_bcast, RRDSET_FLAG_DETAIL); - rd_in = rrddim_add(st_ipv4_bcast, "InBcastOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL); - rd_out = rrddim_add(st_ipv4_bcast, "OutBcastOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL); + rd_in = rrddim_add(st_ip_bcast, "InBcastOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL); + rd_out = rrddim_add(st_ip_bcast, "OutBcastOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL); } else - rrdset_next(st_ipv4_bcast); + rrdset_next(st_ip_bcast); - rrddim_set_by_pointer(st_ipv4_bcast, rd_in, ipext_InBcastOctets); - rrddim_set_by_pointer(st_ipv4_bcast, rd_out, ipext_OutBcastOctets); + rrddim_set_by_pointer(st_ip_bcast, rd_in, ipext_InBcastOctets); + rrddim_set_by_pointer(st_ip_bcast, rd_out, ipext_OutBcastOctets); - rrdset_done(st_ipv4_bcast); + rrdset_done(st_ip_bcast); } // -------------------------------------------------------------------- @@ -403,36 +412,36 @@ int do_proc_net_netstat(int update_every, usec_t dt) { if(do_mcast_p == CONFIG_BOOLEAN_YES || (do_mcast_p == CONFIG_BOOLEAN_AUTO && (ipext_InMcastPkts || ipext_OutMcastPkts))) { do_mcast_p = CONFIG_BOOLEAN_YES; - static RRDSET *st_ipv4_mcastpkts = NULL; + static RRDSET *st_ip_mcastpkts = NULL; static RRDDIM *rd_in = NULL, *rd_out = NULL; - if(unlikely(!st_ipv4_mcastpkts)) { - st_ipv4_mcastpkts = rrdset_create_localhost( - "ipv4" + if(unlikely(!st_ip_mcastpkts)) { + st_ip_mcastpkts = rrdset_create_localhost( + RRD_TYPE_NET_NETSTAT , "mcastpkts" , NULL , "multicast" , NULL - , "IPv4 Multicast Packets" + , "IP Multicast Packets" , "packets/s" , "proc" , "net/netstat" - , NETDATA_CHART_PRIO_IPV4_MCAST + 10 + , NETDATA_CHART_PRIO_IP_MCAST + 10 , update_every , RRDSET_TYPE_LINE ); - rrdset_flag_set(st_ipv4_mcastpkts, RRDSET_FLAG_DETAIL); + rrdset_flag_set(st_ip_mcastpkts, RRDSET_FLAG_DETAIL); - rd_in = rrddim_add(st_ipv4_mcastpkts, "InMcastPkts", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL); - rd_out = rrddim_add(st_ipv4_mcastpkts, "OutMcastPkts", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL); + rd_in = rrddim_add(st_ip_mcastpkts, "InMcastPkts", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL); + rd_out = rrddim_add(st_ip_mcastpkts, "OutMcastPkts", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL); } - else rrdset_next(st_ipv4_mcastpkts); + else rrdset_next(st_ip_mcastpkts); - rrddim_set_by_pointer(st_ipv4_mcastpkts, rd_in, ipext_InMcastPkts); - rrddim_set_by_pointer(st_ipv4_mcastpkts, rd_out, ipext_OutMcastPkts); + rrddim_set_by_pointer(st_ip_mcastpkts, rd_in, ipext_InMcastPkts); + rrddim_set_by_pointer(st_ip_mcastpkts, rd_out, ipext_OutMcastPkts); - rrdset_done(st_ipv4_mcastpkts); + rrdset_done(st_ip_mcastpkts); } // -------------------------------------------------------------------- @@ -440,37 +449,37 @@ int do_proc_net_netstat(int update_every, usec_t dt) { if(do_bcast_p == CONFIG_BOOLEAN_YES || (do_bcast_p == CONFIG_BOOLEAN_AUTO && (ipext_InBcastPkts || ipext_OutBcastPkts))) { do_bcast_p = CONFIG_BOOLEAN_YES; - static RRDSET *st_ipv4_bcastpkts = NULL; + static RRDSET *st_ip_bcastpkts = NULL; static RRDDIM *rd_in = NULL, *rd_out = NULL; - if(unlikely(!st_ipv4_bcastpkts)) { - st_ipv4_bcastpkts = rrdset_create_localhost( - "ipv4" + if(unlikely(!st_ip_bcastpkts)) { + st_ip_bcastpkts = rrdset_create_localhost( + RRD_TYPE_NET_NETSTAT , "bcastpkts" , NULL , "broadcast" , NULL - , "IPv4 Broadcast Packets" + , "IP Broadcast Packets" , "packets/s" , "proc" , "net/netstat" - , NETDATA_CHART_PRIO_IPV4_BCAST + 10 + , NETDATA_CHART_PRIO_IP_BCAST + 10 , update_every , RRDSET_TYPE_LINE ); - rrdset_flag_set(st_ipv4_bcastpkts, RRDSET_FLAG_DETAIL); + rrdset_flag_set(st_ip_bcastpkts, RRDSET_FLAG_DETAIL); - rd_in = rrddim_add(st_ipv4_bcastpkts, "InBcastPkts", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL); - rd_out = rrddim_add(st_ipv4_bcastpkts, "OutBcastPkts", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL); + rd_in = rrddim_add(st_ip_bcastpkts, "InBcastPkts", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL); + rd_out = rrddim_add(st_ip_bcastpkts, "OutBcastPkts", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL); } else - rrdset_next(st_ipv4_bcastpkts); + rrdset_next(st_ip_bcastpkts); - rrddim_set_by_pointer(st_ipv4_bcastpkts, rd_in, ipext_InBcastPkts); - rrddim_set_by_pointer(st_ipv4_bcastpkts, rd_out, ipext_OutBcastPkts); + rrddim_set_by_pointer(st_ip_bcastpkts, rd_in, ipext_InBcastPkts); + rrddim_set_by_pointer(st_ip_bcastpkts, rd_out, ipext_OutBcastPkts); - rrdset_done(st_ipv4_bcastpkts); + rrdset_done(st_ip_bcastpkts); } // -------------------------------------------------------------------- @@ -483,16 +492,16 @@ int do_proc_net_netstat(int update_every, usec_t dt) { if(unlikely(!st_ecnpkts)) { st_ecnpkts = rrdset_create_localhost( - "ipv4" + RRD_TYPE_NET_NETSTAT , "ecnpkts" , NULL , "ecn" , NULL - , "IPv4 ECN Statistics" + , "IP ECN Statistics" , "packets/s" , "proc" , "net/netstat" - , NETDATA_CHART_PRIO_IPV4_ECN + , NETDATA_CHART_PRIO_IP_ECN , update_every , RRDSET_TYPE_LINE ); @@ -535,7 +544,7 @@ int do_proc_net_netstat(int update_every, usec_t dt) { if(unlikely(!st_tcpmemorypressures)) { st_tcpmemorypressures = rrdset_create_localhost( - "ipv4" + RRD_TYPE_NET_NETSTAT , "tcpmemorypressures" , NULL , "tcp" @@ -544,7 +553,7 @@ int do_proc_net_netstat(int update_every, usec_t dt) { , "events/s" , "proc" , "net/netstat" - , NETDATA_CHART_PRIO_IPV4_TCP_MEM + , NETDATA_CHART_PRIO_IP_TCP_MEM , update_every , RRDSET_TYPE_LINE ); @@ -569,7 +578,7 @@ int do_proc_net_netstat(int update_every, usec_t dt) { if(unlikely(!st_tcpconnaborts)) { st_tcpconnaborts = rrdset_create_localhost( - "ipv4" + RRD_TYPE_NET_NETSTAT , "tcpconnaborts" , NULL , "tcp" @@ -578,7 +587,7 @@ int do_proc_net_netstat(int update_every, usec_t dt) { , "connections/s" , "proc" , "net/netstat" - , NETDATA_CHART_PRIO_IPV4_TCP + 10 + , NETDATA_CHART_PRIO_IP_TCP + 10 , update_every , RRDSET_TYPE_LINE ); @@ -613,7 +622,7 @@ int do_proc_net_netstat(int update_every, usec_t dt) { if(unlikely(!st_tcpreorders)) { st_tcpreorders = rrdset_create_localhost( - "ipv4" + RRD_TYPE_NET_NETSTAT , "tcpreorders" , NULL , "tcp" @@ -622,7 +631,7 @@ int do_proc_net_netstat(int update_every, usec_t dt) { , "packets/s" , "proc" , "net/netstat" - , NETDATA_CHART_PRIO_IPV4_TCP + 20 + , NETDATA_CHART_PRIO_IP_TCP + 20 , update_every , RRDSET_TYPE_LINE ); @@ -648,13 +657,13 @@ int do_proc_net_netstat(int update_every, usec_t dt) { if(do_tcpext_ofo == CONFIG_BOOLEAN_YES || (do_tcpext_ofo == CONFIG_BOOLEAN_AUTO && (tcpext_TCPOFOQueue || tcpext_TCPOFODrop || tcpext_TCPOFOMerge))) { do_tcpext_ofo = CONFIG_BOOLEAN_YES; - static RRDSET *st_ipv4_tcpofo = NULL; + static RRDSET *st_ip_tcpofo = NULL; static RRDDIM *rd_inqueue = NULL, *rd_dropped = NULL, *rd_merged = NULL, *rd_pruned = NULL; - if(unlikely(!st_ipv4_tcpofo)) { + if(unlikely(!st_ip_tcpofo)) { - st_ipv4_tcpofo = rrdset_create_localhost( - "ipv4" + st_ip_tcpofo = rrdset_create_localhost( + RRD_TYPE_NET_NETSTAT , "tcpofo" , NULL , "tcp" @@ -663,25 +672,25 @@ int do_proc_net_netstat(int update_every, usec_t dt) { , "packets/s" , "proc" , "net/netstat" - |