@cryptotaxi247 / netdata-1 / commits / 4a389b6ff

Merge netstat, snmp, and snmp6 modules (#13806)

Vladimir Kobal committed Oct 11, 2022 at 18:05 UTC 4a389b6ff35b8cbb7157ceaf4a43abf3df4e684f
7 files changed +2994 -3017
CMakeLists.txt
-2
@@ -648,8 +648,6 @@ set(PROC_PLUGIN_FILES
648 collectors/proc.plugin/proc_net_netstat.c
649 collectors/proc.plugin/proc_net_rpc_nfs.c
650 collectors/proc.plugin/proc_net_rpc_nfsd.c
651 - collectors/proc.plugin/proc_net_snmp.c
652 - collectors/proc.plugin/proc_net_snmp6.c
651 collectors/proc.plugin/proc_net_sctp_snmp.c
652 collectors/proc.plugin/proc_net_sockstat.c
653 collectors/proc.plugin/proc_net_sockstat6.c
Makefile.am
-2
@@ -380,8 +380,6 @@ PROC_PLUGIN_FILES = \
380 collectors/proc.plugin/proc_net_netstat.c \
381 collectors/proc.plugin/proc_net_rpc_nfs.c \
382 collectors/proc.plugin/proc_net_rpc_nfsd.c \
383 - collectors/proc.plugin/proc_net_snmp.c \
384 - collectors/proc.plugin/proc_net_snmp6.c \
383 collectors/proc.plugin/proc_net_sctp_snmp.c \
384 collectors/proc.plugin/proc_net_sockstat.c \
385 collectors/proc.plugin/proc_net_sockstat6.c \
collectors/proc.plugin/plugin_proc.c
+1 -5
@@ -40,11 +40,7 @@ static struct proc_module {
40 {.name = "/proc/net/wireless", .dim = "netwireless", .func = do_proc_net_wireless},
41 {.name = "/proc/net/sockstat", .dim = "sockstat", .func = do_proc_net_sockstat},
42 {.name = "/proc/net/sockstat6", .dim = "sockstat6", .func = do_proc_net_sockstat6},
43 - {.name = "/proc/net/netstat",
44 - .dim = "netstat",
45 - .func = do_proc_net_netstat}, // this has to be before /proc/net/snmp, because there is a shared metric
46 - {.name = "/proc/net/snmp", .dim = "snmp", .func = do_proc_net_snmp},
47 - {.name = "/proc/net/snmp6", .dim = "snmp6", .func = do_proc_net_snmp6},
43 + {.name = "/proc/net/netstat", .dim = "netstat", .func = do_proc_net_netstat},
44 {.name = "/proc/net/sctp/snmp", .dim = "sctp", .func = do_proc_net_sctp_snmp},
45 {.name = "/proc/net/softnet_stat", .dim = "softnet", .func = do_proc_net_softnet_stat},
46 {.name = "/proc/net/ip_vs/stats", .dim = "ipvs", .func = do_proc_net_ip_vs_stats},
collectors/proc.plugin/plugin_proc.h
-3
@@ -14,8 +14,6 @@ void *netdev_main(void *ptr);
14 int do_proc_net_wireless(int update_every, usec_t dt);
15 int do_proc_diskstats(int update_every, usec_t dt);
16 int do_proc_mdstat(int update_every, usec_t dt);
17 -int do_proc_net_snmp(int update_every, usec_t dt);
18 -int do_proc_net_snmp6(int update_every, usec_t dt);
17 int do_proc_net_netstat(int update_every, usec_t dt);
18 int do_proc_net_stat_conntrack(int update_every, usec_t dt);
19 int do_proc_net_ip_vs_stats(int update_every, usec_t dt);
@@ -49,7 +47,6 @@ int do_sys_class_infiniband(int update_every, usec_t dt);
47 int get_numa_node_count(void);
48
49 // metrics that need to be shared among data collectors
52 -extern unsigned long long tcpext_TCPSynRetrans;
50 extern unsigned long long zfs_arcstats_shrinkable_cache_size_bytes;
51
52 // netdev renames
collectors/proc.plugin/proc_net_netstat.c
+2993 -582
@@ -3,14 +3,97 @@
3 #include "plugin_proc.h"
4
5 #define RRD_TYPE_NET_NETSTAT "ip"
6 +#define RRD_TYPE_NET_SNMP "ipv4"
7 +#define RRD_TYPE_NET_SNMP6 "ipv6"
8 #define PLUGIN_PROC_MODULE_NETSTAT_NAME "/proc/net/netstat"
9 #define CONFIG_SECTION_PLUGIN_PROC_NETSTAT "plugin:" PLUGIN_PROC_CONFIG_NAME ":" PLUGIN_PROC_MODULE_NETSTAT_NAME
10
9 -unsigned long long tcpext_TCPSynRetrans = 0;
10 -
11 -static void parse_line_pair(procfile *ff, ARL_BASE *base, size_t header_line, size_t values_line) {
12 - size_t hwords = procfile_linewords(ff, header_line);
13 - size_t vwords = procfile_linewords(ff, values_line);
11 +static struct proc_net_snmp {
12 + // kernel_uint_t ip_Forwarding;
13 + kernel_uint_t ip_DefaultTTL;
14 + kernel_uint_t ip_InReceives;
15 + kernel_uint_t ip_InHdrErrors;
16 + kernel_uint_t ip_InAddrErrors;
17 + kernel_uint_t ip_ForwDatagrams;
18 + kernel_uint_t ip_InUnknownProtos;
19 + kernel_uint_t ip_InDiscards;
20 + kernel_uint_t ip_InDelivers;
21 + kernel_uint_t ip_OutRequests;
22 + kernel_uint_t ip_OutDiscards;
23 + kernel_uint_t ip_OutNoRoutes;
24 + kernel_uint_t ip_ReasmTimeout;
25 + kernel_uint_t ip_ReasmReqds;
26 + kernel_uint_t ip_ReasmOKs;
27 + kernel_uint_t ip_ReasmFails;
28 + kernel_uint_t ip_FragOKs;
29 + kernel_uint_t ip_FragFails;
30 + kernel_uint_t ip_FragCreates;
31 +
32 + kernel_uint_t icmp_InMsgs;
33 + kernel_uint_t icmp_OutMsgs;
34 + kernel_uint_t icmp_InErrors;
35 + kernel_uint_t icmp_OutErrors;
36 + kernel_uint_t icmp_InCsumErrors;
37 +
38 + kernel_uint_t icmpmsg_InEchoReps;
39 + kernel_uint_t icmpmsg_OutEchoReps;
40 + kernel_uint_t icmpmsg_InDestUnreachs;
41 + kernel_uint_t icmpmsg_OutDestUnreachs;
42 + kernel_uint_t icmpmsg_InRedirects;
43 + kernel_uint_t icmpmsg_OutRedirects;
44 + kernel_uint_t icmpmsg_InEchos;
45 + kernel_uint_t icmpmsg_OutEchos;
46 + kernel_uint_t icmpmsg_InRouterAdvert;
47 + kernel_uint_t icmpmsg_OutRouterAdvert;
48 + kernel_uint_t icmpmsg_InRouterSelect;
49 + kernel_uint_t icmpmsg_OutRouterSelect;
50 + kernel_uint_t icmpmsg_InTimeExcds;
51 + kernel_uint_t icmpmsg_OutTimeExcds;
52 + kernel_uint_t icmpmsg_InParmProbs;
53 + kernel_uint_t icmpmsg_OutParmProbs;
54 + kernel_uint_t icmpmsg_InTimestamps;
55 + kernel_uint_t icmpmsg_OutTimestamps;
56 + kernel_uint_t icmpmsg_InTimestampReps;
57 + kernel_uint_t icmpmsg_OutTimestampReps;
58 +
59 + //kernel_uint_t tcp_RtoAlgorithm;
60 + //kernel_uint_t tcp_RtoMin;
61 + //kernel_uint_t tcp_RtoMax;
62 + ssize_t tcp_MaxConn;
63 + kernel_uint_t tcp_ActiveOpens;
64 + kernel_uint_t tcp_PassiveOpens;
65 + kernel_uint_t tcp_AttemptFails;
66 + kernel_uint_t tcp_EstabResets;
67 + kernel_uint_t tcp_CurrEstab;
68 + kernel_uint_t tcp_InSegs;
69 + kernel_uint_t tcp_OutSegs;
70 + kernel_uint_t tcp_RetransSegs;
71 + kernel_uint_t tcp_InErrs;
72 + kernel_uint_t tcp_OutRsts;
73 + kernel_uint_t tcp_InCsumErrors;
74 +
75 + kernel_uint_t udp_InDatagrams;
76 + kernel_uint_t udp_NoPorts;
77 + kernel_uint_t udp_InErrors;
78 + kernel_uint_t udp_OutDatagrams;
79 + kernel_uint_t udp_RcvbufErrors;
80 + kernel_uint_t udp_SndbufErrors;
81 + kernel_uint_t udp_InCsumErrors;
82 + kernel_uint_t udp_IgnoredMulti;
83 +
84 + kernel_uint_t udplite_InDatagrams;
85 + kernel_uint_t udplite_NoPorts;
86 + kernel_uint_t udplite_InErrors;
87 + kernel_uint_t udplite_OutDatagrams;
88 + kernel_uint_t udplite_RcvbufErrors;
89 + kernel_uint_t udplite_SndbufErrors;
90 + kernel_uint_t udplite_InCsumErrors;
91 + kernel_uint_t udplite_IgnoredMulti;
92 +} snmp_root = { 0 };
93 +
94 +static void parse_line_pair(procfile *ff_netstat, ARL_BASE *base, size_t header_line, size_t values_line) {
95 + size_t hwords = procfile_linewords(ff_netstat, header_line);
96 + size_t vwords = procfile_linewords(ff_netstat, values_line);
97 size_t w;
98
99 if(unlikely(vwords > hwords)) {
@@ -19,7 +102,7 @@ static void parse_line_pair(procfile *ff, ARL_BASE *base, size_t header_line, si
102 }
103
104 for(w = 1; w < vwords ;w++) {
22 - if(unlikely(arl_check(base, procfile_lineword(ff, header_line, w), procfile_lineword(ff, values_line, w))))
105 + if(unlikely(arl_check(base, procfile_lineword(ff_netstat, header_line, w), procfile_lineword(ff_netstat, values_line, w))))
106 break;
107 }
108 }
@@ -31,12 +114,38 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
114 do_tcpext_reorder = -1, do_tcpext_syscookies = -1, do_tcpext_ofo = -1, do_tcpext_connaborts = -1, do_tcpext_memory = -1,
115 do_tcpext_syn_queue = -1, do_tcpext_accept_queue = -1;
116
117 + static int do_ip_packets = -1, do_ip_fragsout = -1, do_ip_fragsin = -1, do_ip_errors = -1,
118 + do_tcp_sockets = -1, do_tcp_packets = -1, do_tcp_errors = -1, do_tcp_handshake = -1, do_tcp_opens = -1,
119 + do_udp_packets = -1, do_udp_errors = -1, do_icmp_packets = -1, do_icmpmsg = -1, do_udplite_packets = -1;
120 +
121 + static int do_ip6_packets = -1, do_ip6_fragsout = -1, do_ip6_fragsin = -1, do_ip6_errors = -1,
122 + do_ip6_udplite_packets = -1, do_ip6_udplite_errors = -1, do_ip6_udp_packets = -1, do_ip6_udp_errors = -1,
123 + do_ip6_bandwidth = -1, do_ip6_mcast = -1, do_ip6_bcast = -1, do_ip6_mcast_p = -1, do_ip6_icmp = -1,
124 + do_ip6_icmp_redir = -1, do_ip6_icmp_errors = -1, do_ip6_icmp_echos = -1, do_ip6_icmp_groupmemb = -1,
125 + do_ip6_icmp_router = -1, do_ip6_icmp_neighbor = -1, do_ip6_icmp_mldv2 = -1, do_ip6_icmp_types = -1,
126 + do_ip6_ect = -1;
127 +
128 static uint32_t hash_ipext = 0, hash_tcpext = 0;
35 - static procfile *ff = NULL;
129 + static uint32_t hash_ip = 0, hash_icmp = 0, hash_tcp = 0, hash_udp = 0, hash_icmpmsg = 0, hash_udplite = 0;
130 +
131 + static procfile *ff_netstat = NULL;
132 + static procfile *ff_snmp = NULL;
133 + static procfile *ff_snmp6 = NULL;
134
135 static ARL_BASE *arl_tcpext = NULL;
136 static ARL_BASE *arl_ipext = NULL;
137
138 + static ARL_BASE *arl_ip = NULL;
139 + static ARL_BASE *arl_icmp = NULL;
140 + static ARL_BASE *arl_icmpmsg = NULL;
141 + static ARL_BASE *arl_tcp = NULL;
142 + static ARL_BASE *arl_udp = NULL;
143 + static ARL_BASE *arl_udplite = NULL;
144 +
145 + static ARL_BASE *arl_ipv6 = NULL;
146 +
147 + static const RRDVAR_ACQUIRED *tcp_max_connections_var = NULL;
148 +
149 // --------------------------------------------------------------------
150 // IP
151
@@ -111,8 +220,103 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
220 static unsigned long long tcpext_TCPReqQFullDrop = 0;
221 static unsigned long long tcpext_TCPReqQFullDoCookies = 0;
222
114 - // shared: tcpext_TCPSynRetrans
115 -
223 + static unsigned long long tcpext_TCPSynRetrans = 0;
224 +
225 + // IPv6
226 + static unsigned long long Ip6InReceives = 0ULL;
227 + static unsigned long long Ip6InHdrErrors = 0ULL;
228 + static unsigned long long Ip6InTooBigErrors = 0ULL;
229 + static unsigned long long Ip6InNoRoutes = 0ULL;
230 + static unsigned long long Ip6InAddrErrors = 0ULL;
231 + static unsigned long long Ip6InUnknownProtos = 0ULL;
232 + static unsigned long long Ip6InTruncatedPkts = 0ULL;
233 + static unsigned long long Ip6InDiscards = 0ULL;
234 + static unsigned long long Ip6InDelivers = 0ULL;
235 + static unsigned long long Ip6OutForwDatagrams = 0ULL;
236 + static unsigned long long Ip6OutRequests = 0ULL;
237 + static unsigned long long Ip6OutDiscards = 0ULL;
238 + static unsigned long long Ip6OutNoRoutes = 0ULL;
239 + static unsigned long long Ip6ReasmTimeout = 0ULL;
240 + static unsigned long long Ip6ReasmReqds = 0ULL;
241 + static unsigned long long Ip6ReasmOKs = 0ULL;
242 + static unsigned long long Ip6ReasmFails = 0ULL;
243 + static unsigned long long Ip6FragOKs = 0ULL;
244 + static unsigned long long Ip6FragFails = 0ULL;
245 + static unsigned long long Ip6FragCreates = 0ULL;
246 + static unsigned long long Ip6InMcastPkts = 0ULL;
247 + static unsigned long long Ip6OutMcastPkts = 0ULL;
248 + static unsigned long long Ip6InOctets = 0ULL;
249 + static unsigned long long Ip6OutOctets = 0ULL;
250 + static unsigned long long Ip6InMcastOctets = 0ULL;
251 + static unsigned long long Ip6OutMcastOctets = 0ULL;
252 + static unsigned long long Ip6InBcastOctets = 0ULL;
253 + static unsigned long long Ip6OutBcastOctets = 0ULL;
254 + static unsigned long long Ip6InNoECTPkts = 0ULL;
255 + static unsigned long long Ip6InECT1Pkts = 0ULL;
256 + static unsigned long long Ip6InECT0Pkts = 0ULL;
257 + static unsigned long long Ip6InCEPkts = 0ULL;
258 + static unsigned long long Icmp6InMsgs = 0ULL;
259 + static unsigned long long Icmp6InErrors = 0ULL;
260 + static unsigned long long Icmp6OutMsgs = 0ULL;
261 + static unsigned long long Icmp6OutErrors = 0ULL;
262 + static unsigned long long Icmp6InCsumErrors = 0ULL;
263 + static unsigned long long Icmp6InDestUnreachs = 0ULL;
264 + static unsigned long long Icmp6InPktTooBigs = 0ULL;
265 + static unsigned long long Icmp6InTimeExcds = 0ULL;
266 + static unsigned long long Icmp6InParmProblems = 0ULL;
267 + static unsigned long long Icmp6InEchos = 0ULL;
268 + static unsigned long long Icmp6InEchoReplies = 0ULL;
269 + static unsigned long long Icmp6InGroupMembQueries = 0ULL;
270 + static unsigned long long Icmp6InGroupMembResponses = 0ULL;
271 + static unsigned long long Icmp6InGroupMembReductions = 0ULL;
272 + static unsigned long long Icmp6InRouterSolicits = 0ULL;
273 + static unsigned long long Icmp6InRouterAdvertisements = 0ULL;
274 + static unsigned long long Icmp6InNeighborSolicits = 0ULL;
275 + static unsigned long long Icmp6InNeighborAdvertisements = 0ULL;
276 + static unsigned long long Icmp6InRedirects = 0ULL;
277 + static unsigned long long Icmp6InMLDv2Reports = 0ULL;
278 + static unsigned long long Icmp6OutDestUnreachs = 0ULL;
279 + static unsigned long long Icmp6OutPktTooBigs = 0ULL;
280 + static unsigned long long Icmp6OutTimeExcds = 0ULL;
281 + static unsigned long long Icmp6OutParmProblems = 0ULL;
282 + static unsigned long long Icmp6OutEchos = 0ULL;
283 + static unsigned long long Icmp6OutEchoReplies = 0ULL;
284 + static unsigned long long Icmp6OutGroupMembQueries = 0ULL;
285 + static unsigned long long Icmp6OutGroupMembResponses = 0ULL;
286 + static unsigned long long Icmp6OutGroupMembReductions = 0ULL;
287 + static unsigned long long Icmp6OutRouterSolicits = 0ULL;
288 + static unsigned long long Icmp6OutRouterAdvertisements = 0ULL;
289 + static unsigned long long Icmp6OutNeighborSolicits = 0ULL;
290 + static unsigned long long Icmp6OutNeighborAdvertisements = 0ULL;
291 + static unsigned long long Icmp6OutRedirects = 0ULL;
292 + static unsigned long long Icmp6OutMLDv2Reports = 0ULL;
293 + static unsigned long long Icmp6InType1 = 0ULL;
294 + static unsigned long long Icmp6InType128 = 0ULL;
295 + static unsigned long long Icmp6InType129 = 0ULL;
296 + static unsigned long long Icmp6InType136 = 0ULL;
297 + static unsigned long long Icmp6OutType1 = 0ULL;
298 + static unsigned long long Icmp6OutType128 = 0ULL;
299 + static unsigned long long Icmp6OutType129 = 0ULL;
300 + static unsigned long long Icmp6OutType133 = 0ULL;
301 + static unsigned long long Icmp6OutType135 = 0ULL;
302 + static unsigned long long Icmp6OutType143 = 0ULL;
303 + static unsigned long long Udp6InDatagrams = 0ULL;
304 + static unsigned long long Udp6NoPorts = 0ULL;
305 + static unsigned long long Udp6InErrors = 0ULL;
306 + static unsigned long long Udp6OutDatagrams = 0ULL;
307 + static unsigned long long Udp6RcvbufErrors = 0ULL;
308 + static unsigned long long Udp6SndbufErrors = 0ULL;
309 + static unsigned long long Udp6InCsumErrors = 0ULL;
310 + static unsigned long long Udp6IgnoredMulti = 0ULL;
311 + static unsigned long long UdpLite6InDatagrams = 0ULL;
312 + static unsigned long long UdpLite6NoPorts = 0ULL;
313 + static unsigned long long UdpLite6InErrors = 0ULL;
314 + static unsigned long long UdpLite6OutDatagrams = 0ULL;
315 + static unsigned long long UdpLite6RcvbufErrors = 0ULL;
316 + static unsigned long long UdpLite6SndbufErrors = 0ULL;
317 + static unsigned long long UdpLite6InCsumErrors = 0ULL;
318 +
319 + // prepare for /proc/net/netstat parsing
320
321 if(unlikely(!arl_ipext)) {
322 hash_ipext = simple_hash("IpExt");
@@ -225,644 +429,2851 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
429 arl_expect(arl_tcpext, "TCPReqQFullDoCookies", &tcpext_TCPReqQFullDoCookies);
430 }
431
228 - // shared metrics
432 arl_expect(arl_tcpext, "TCPSynRetrans", &tcpext_TCPSynRetrans);
433 }
434
232 - if(unlikely(!ff)) {
435 + // prepare for /proc/net/snmp parsing
436 +
437 + if(unlikely(!arl_ip)) {
438 + do_ip_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 packets", CONFIG_BOOLEAN_AUTO);
439 + do_ip_fragsout = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 fragments sent", CONFIG_BOOLEAN_AUTO);
440 + do_ip_fragsin = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 fragments assembly", CONFIG_BOOLEAN_AUTO);
441 + do_ip_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 errors", CONFIG_BOOLEAN_AUTO);
442 + do_tcp_sockets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 TCP connections", CONFIG_BOOLEAN_AUTO);
443 + do_tcp_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 TCP packets", CONFIG_BOOLEAN_AUTO);
444 + do_tcp_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 TCP errors", CONFIG_BOOLEAN_AUTO);
445 + do_tcp_opens = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 TCP opens", CONFIG_BOOLEAN_AUTO);
446 + do_tcp_handshake = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 TCP handshake issues", CONFIG_BOOLEAN_AUTO);
447 + do_udp_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 UDP packets", CONFIG_BOOLEAN_AUTO);
448 + do_udp_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 UDP errors", CONFIG_BOOLEAN_AUTO);
449 + do_icmp_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 ICMP packets", CONFIG_BOOLEAN_AUTO);
450 + do_icmpmsg = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 ICMP messages", CONFIG_BOOLEAN_AUTO);
451 + do_udplite_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 UDPLite packets", CONFIG_BOOLEAN_AUTO);
452 +
453 + hash_ip = simple_hash("Ip");
454 + hash_tcp = simple_hash("Tcp");
455 + hash_udp = simple_hash("Udp");
456 + hash_icmp = simple_hash("Icmp");
457 + hash_icmpmsg = simple_hash("IcmpMsg");
458 + hash_udplite = simple_hash("UdpLite");
459 +
460 + arl_ip = arl_create("snmp/Ip", arl_callback_str2kernel_uint_t, 60);
461 + // arl_expect(arl_ip, "Forwarding", &snmp_root.ip_Forwarding);
462 + arl_expect(arl_ip, "DefaultTTL", &snmp_root.ip_DefaultTTL);
463 + arl_expect(arl_ip, "InReceives", &snmp_root.ip_InReceives);
464 + arl_expect(arl_ip, "InHdrErrors", &snmp_root.ip_InHdrErrors);
465 + arl_expect(arl_ip, "InAddrErrors", &snmp_root.ip_InAddrErrors);
466 + arl_expect(arl_ip, "ForwDatagrams", &snmp_root.ip_ForwDatagrams);
467 + arl_expect(arl_ip, "InUnknownProtos", &snmp_root.ip_InUnknownProtos);
468 + arl_expect(arl_ip, "InDiscards", &snmp_root.ip_InDiscards);
469 + arl_expect(arl_ip, "InDelivers", &snmp_root.ip_InDelivers);
470 + arl_expect(arl_ip, "OutRequests", &snmp_root.ip_OutRequests);
471 + arl_expect(arl_ip, "OutDiscards", &snmp_root.ip_OutDiscards);
472 + arl_expect(arl_ip, "OutNoRoutes", &snmp_root.ip_OutNoRoutes);
473 + arl_expect(arl_ip, "ReasmTimeout", &snmp_root.ip_ReasmTimeout);
474 + arl_expect(arl_ip, "ReasmReqds", &snmp_root.ip_ReasmReqds);
475 + arl_expect(arl_ip, "ReasmOKs", &snmp_root.ip_ReasmOKs);
476 + arl_expect(arl_ip, "ReasmFails", &snmp_root.ip_ReasmFails);
477 + arl_expect(arl_ip, "FragOKs", &snmp_root.ip_FragOKs);
478 + arl_expect(arl_ip, "FragFails", &snmp_root.ip_FragFails);
479 + arl_expect(arl_ip, "FragCreates", &snmp_root.ip_FragCreates);
480 +
481 + arl_icmp = arl_create("snmp/Icmp", arl_callback_str2kernel_uint_t, 60);
482 + arl_expect(arl_icmp, "InMsgs", &snmp_root.icmp_InMsgs);
483 + arl_expect(arl_icmp, "OutMsgs", &snmp_root.icmp_OutMsgs);
484 + arl_expect(arl_icmp, "InErrors", &snmp_root.icmp_InErrors);
485 + arl_expect(arl_icmp, "OutErrors", &snmp_root.icmp_OutErrors);
486 + arl_expect(arl_icmp, "InCsumErrors", &snmp_root.icmp_InCsumErrors);
487 +
488 + arl_icmpmsg = arl_create("snmp/Icmpmsg", arl_callback_str2kernel_uint_t, 60);
489 + arl_expect(arl_icmpmsg, "InType0", &snmp_root.icmpmsg_InEchoReps);
490 + arl_expect(arl_icmpmsg, "OutType0", &snmp_root.icmpmsg_OutEchoReps);
491 + arl_expect(arl_icmpmsg, "InType3", &snmp_root.icmpmsg_InDestUnreachs);
492 + arl_expect(arl_icmpmsg, "OutType3", &snmp_root.icmpmsg_OutDestUnreachs);
493 + arl_expect(arl_icmpmsg, "InType5", &snmp_root.icmpmsg_InRedirects);
494 + arl_expect(arl_icmpmsg, "OutType5", &snmp_root.icmpmsg_OutRedirects);
495 + arl_expect(arl_icmpmsg, "InType8", &snmp_root.icmpmsg_InEchos);
496 + arl_expect(arl_icmpmsg, "OutType8", &snmp_root.icmpmsg_OutEchos);
497 + arl_expect(arl_icmpmsg, "InType9", &snmp_root.icmpmsg_InRouterAdvert);
498 + arl_expect(arl_icmpmsg, "OutType9", &snmp_root.icmpmsg_OutRouterAdvert);
499 + arl_expect(arl_icmpmsg, "InType10", &snmp_root.icmpmsg_InRouterSelect);
500 + arl_expect(arl_icmpmsg, "OutType10", &snmp_root.icmpmsg_OutRouterSelect);
501 + arl_expect(arl_icmpmsg, "InType11", &snmp_root.icmpmsg_InTimeExcds);
502 + arl_expect(arl_icmpmsg, "OutType11", &snmp_root.icmpmsg_OutTimeExcds);
503 + arl_expect(arl_icmpmsg, "InType12", &snmp_root.icmpmsg_InParmProbs);
504 + arl_expect(arl_icmpmsg, "OutType12", &snmp_root.icmpmsg_OutParmProbs);
505 + arl_expect(arl_icmpmsg, "InType13", &snmp_root.icmpmsg_InTimestamps);
506 + arl_expect(arl_icmpmsg, "OutType13", &snmp_root.icmpmsg_OutTimestamps);
507 + arl_expect(arl_icmpmsg, "InType14", &snmp_root.icmpmsg_InTimestampReps);
508 + arl_expect(arl_icmpmsg, "OutType14", &snmp_root.icmpmsg_OutTimestampReps);
509 +
510 + arl_tcp = arl_create("snmp/Tcp", arl_callback_str2kernel_uint_t, 60);
511 + // arl_expect(arl_tcp, "RtoAlgorithm", &snmp_root.tcp_RtoAlgorithm);
512 + // arl_expect(arl_tcp, "RtoMin", &snmp_root.tcp_RtoMin);
513 + // arl_expect(arl_tcp, "RtoMax", &snmp_root.tcp_RtoMax);
514 + arl_expect_custom(arl_tcp, "MaxConn", arl_callback_ssize_t, &snmp_root.tcp_MaxConn);
515 + arl_expect(arl_tcp, "ActiveOpens", &snmp_root.tcp_ActiveOpens);
516 + arl_expect(arl_tcp, "PassiveOpens", &snmp_root.tcp_PassiveOpens);
517 + arl_expect(arl_tcp, "AttemptFails", &snmp_root.tcp_AttemptFails);
518 + arl_expect(arl_tcp, "EstabResets", &snmp_root.tcp_EstabResets);
519 + arl_expect(arl_tcp, "CurrEstab", &snmp_root.tcp_CurrEstab);
520 + arl_expect(arl_tcp, "InSegs", &snmp_root.tcp_InSegs);
521 + arl_expect(arl_tcp, "OutSegs", &snmp_root.tcp_OutSegs);
522 + arl_expect(arl_tcp, "RetransSegs", &snmp_root.tcp_RetransSegs);
523 + arl_expect(arl_tcp, "InErrs", &snmp_root.tcp_InErrs);
524 + arl_expect(arl_tcp, "OutRsts", &snmp_root.tcp_OutRsts);
525 + arl_expect(arl_tcp, "InCsumErrors", &snmp_root.tcp_InCsumErrors);
526 +
527 + arl_udp = arl_create("snmp/Udp", arl_callback_str2kernel_uint_t, 60);
528 + arl_expect(arl_udp, "InDatagrams", &snmp_root.udp_InDatagrams);
529 + arl_expect(arl_udp, "NoPorts", &snmp_root.udp_NoPorts);
530 + arl_expect(arl_udp, "InErrors", &snmp_root.udp_InErrors);
531 + arl_expect(arl_udp, "OutDatagrams", &snmp_root.udp_OutDatagrams);
532 + arl_expect(arl_udp, "RcvbufErrors", &snmp_root.udp_RcvbufErrors);
533 + arl_expect(arl_udp, "SndbufErrors", &snmp_root.udp_SndbufErrors);
534 + arl_expect(arl_udp, "InCsumErrors", &snmp_root.udp_InCsumErrors);
535 + arl_expect(arl_udp, "IgnoredMulti", &snmp_root.udp_IgnoredMulti);
536 +
537 + arl_udplite = arl_create("snmp/Udplite", arl_callback_str2kernel_uint_t, 60);
538 + arl_expect(arl_udplite, "InDatagrams", &snmp_root.udplite_InDatagrams);
539 + arl_expect(arl_udplite, "NoPorts", &snmp_root.udplite_NoPorts);
540 + arl_expect(arl_udplite, "InErrors", &snmp_root.udplite_InErrors);
541 + arl_expect(arl_udplite, "OutDatagrams", &snmp_root.udplite_OutDatagrams);
542 + arl_expect(arl_udplite, "RcvbufErrors", &snmp_root.udplite_RcvbufErrors);
543 + arl_expect(arl_udplite, "SndbufErrors", &snmp_root.udplite_SndbufErrors);
544 + arl_expect(arl_udplite, "InCsumErrors", &snmp_root.udplite_InCsumErrors);
545 + arl_expect(arl_udplite, "IgnoredMulti", &snmp_root.udplite_IgnoredMulti);
546 +
547 + tcp_max_connections_var = rrdvar_custom_host_variable_add_and_acquire(localhost, "tcp_max_connections");
548 + }
549 +
550 + // prepare for /proc/net/snmp6 parsing
551 +
552 + if(unlikely(!arl_ipv6)) {
553 + do_ip6_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 packets", CONFIG_BOOLEAN_AUTO);
554 + do_ip6_fragsout = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 fragments sent", CONFIG_BOOLEAN_AUTO);
555 + do_ip6_fragsin = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 fragments assembly", CONFIG_BOOLEAN_AUTO);
556 + do_ip6_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 errors", CONFIG_BOOLEAN_AUTO);
557 + do_ip6_udp_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDP packets", CONFIG_BOOLEAN_AUTO);
558 + do_ip6_udp_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDP errors", CONFIG_BOOLEAN_AUTO);
559 + do_ip6_udplite_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDPlite packets", CONFIG_BOOLEAN_AUTO);
560 + do_ip6_udplite_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDPlite errors", CONFIG_BOOLEAN_AUTO);
561 + do_ip6_bandwidth = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "bandwidth", CONFIG_BOOLEAN_AUTO);
562 + do_ip6_mcast = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "multicast bandwidth", CONFIG_BOOLEAN_AUTO);
563 + do_ip6_bcast = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "broadcast bandwidth", CONFIG_BOOLEAN_AUTO);
564 + do_ip6_mcast_p = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "multicast packets", CONFIG_BOOLEAN_AUTO);
565 + do_ip6_icmp = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp", CONFIG_BOOLEAN_AUTO);
566 + do_ip6_icmp_redir = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp redirects", CONFIG_BOOLEAN_AUTO);
567 + do_ip6_icmp_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp errors", CONFIG_BOOLEAN_AUTO);
568 + do_ip6_icmp_echos = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp echos", CONFIG_BOOLEAN_AUTO);
569 + do_ip6_icmp_groupmemb = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp group membership", CONFIG_BOOLEAN_AUTO);
570 + do_ip6_icmp_router = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp router", CONFIG_BOOLEAN_AUTO);
571 + do_ip6_icmp_neighbor = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp neighbor", CONFIG_BOOLEAN_AUTO);
572 + do_ip6_icmp_mldv2 = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp mldv2", CONFIG_BOOLEAN_AUTO);
573 + do_ip6_icmp_types = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp types", CONFIG_BOOLEAN_AUTO);
574 + do_ip6_ect = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ect", CONFIG_BOOLEAN_AUTO);
575 +
576 + arl_ipv6 = arl_create("snmp6", NULL, 60);
577 + arl_expect(arl_ipv6, "Ip6InReceives", &Ip6InReceives);
578 + arl_expect(arl_ipv6, "Ip6InHdrErrors", &Ip6InHdrErrors);
579 + arl_expect(arl_ipv6, "Ip6InTooBigErrors", &Ip6InTooBigErrors);
580 + arl_expect(arl_ipv6, "Ip6InNoRoutes", &Ip6InNoRoutes);
581 + arl_expect(arl_ipv6, "Ip6InAddrErrors", &Ip6InAddrErrors);
582 + arl_expect(arl_ipv6, "Ip6InUnknownProtos", &Ip6InUnknownProtos);
583 + arl_expect(arl_ipv6, "Ip6InTruncatedPkts", &Ip6InTruncatedPkts);
584 + arl_expect(arl_ipv6, "Ip6InDiscards", &Ip6InDiscards);
585 + arl_expect(arl_ipv6, "Ip6InDelivers", &Ip6InDelivers);
586 + arl_expect(arl_ipv6, "Ip6OutForwDatagrams", &Ip6OutForwDatagrams);
587 + arl_expect(arl_ipv6, "Ip6OutRequests", &Ip6OutRequests);
588 + arl_expect(arl_ipv6, "Ip6OutDiscards", &Ip6OutDiscards);
589 + arl_expect(arl_ipv6, "Ip6OutNoRoutes", &Ip6OutNoRoutes);
590 + arl_expect(arl_ipv6, "Ip6ReasmTimeout", &Ip6ReasmTimeout);
591 + arl_expect(arl_ipv6, "Ip6ReasmReqds", &Ip6ReasmReqds);
592 + arl_expect(arl_ipv6, "Ip6ReasmOKs", &Ip6ReasmOKs);
593 + arl_expect(arl_ipv6, "Ip6ReasmFails", &Ip6ReasmFails);
594 + arl_expect(arl_ipv6, "Ip6FragOKs", &Ip6FragOKs);
595 + arl_expect(arl_ipv6, "Ip6FragFails", &Ip6FragFails);
596 + arl_expect(arl_ipv6, "Ip6FragCreates", &Ip6FragCreates);
597 + arl_expect(arl_ipv6, "Ip6InMcastPkts", &Ip6InMcastPkts);
598 + arl_expect(arl_ipv6, "Ip6OutMcastPkts", &Ip6OutMcastPkts);
599 + arl_expect(arl_ipv6, "Ip6InOctets", &Ip6InOctets);
600 + arl_expect(arl_ipv6, "Ip6OutOctets", &Ip6OutOctets);
601 + arl_expect(arl_ipv6, "Ip6InMcastOctets", &Ip6InMcastOctets);
602 + arl_expect(arl_ipv6, "Ip6OutMcastOctets", &Ip6OutMcastOctets);
603 + arl_expect(arl_ipv6, "Ip6InBcastOctets", &Ip6InBcastOctets);
604 + arl_expect(arl_ipv6, "Ip6OutBcastOctets", &Ip6OutBcastOctets);
605 + arl_expect(arl_ipv6, "Ip6InNoECTPkts", &Ip6InNoECTPkts);
606 + arl_expect(arl_ipv6, "Ip6InECT1Pkts", &Ip6InECT1Pkts);
607 + arl_expect(arl_ipv6, "Ip6InECT0Pkts", &Ip6InECT0Pkts);
608 + arl_expect(arl_ipv6, "Ip6InCEPkts", &Ip6InCEPkts);
609 + arl_expect(arl_ipv6, "Icmp6InMsgs", &Icmp6InMsgs);
610 + arl_expect(arl_ipv6, "Icmp6InErrors", &Icmp6InErrors);
611 + arl_expect(arl_ipv6, "Icmp6OutMsgs", &Icmp6OutMsgs);
612 + arl_expect(arl_ipv6, "Icmp6OutErrors", &Icmp6OutErrors);
613 + arl_expect(arl_ipv6, "Icmp6InCsumErrors", &Icmp6InCsumErrors);
614 + arl_expect(arl_ipv6, "Icmp6InDestUnreachs", &Icmp6InDestUnreachs);
615 + arl_expect(arl_ipv6, "Icmp6InPktTooBigs", &Icmp6InPktTooBigs);
616 + arl_expect(arl_ipv6, "Icmp6InTimeExcds", &Icmp6InTimeExcds);
617 + arl_expect(arl_ipv6, "Icmp6InParmProblems", &Icmp6InParmProblems);
618 + arl_expect(arl_ipv6, "Icmp6InEchos", &Icmp6InEchos);
619 + arl_expect(arl_ipv6, "Icmp6InEchoReplies", &Icmp6InEchoReplies);
620 + arl_expect(arl_ipv6, "Icmp6InGroupMembQueries", &Icmp6InGroupMembQueries);
621 + arl_expect(arl_ipv6, "Icmp6InGroupMembResponses", &Icmp6InGroupMembResponses);
622 + arl_expect(arl_ipv6, "Icmp6InGroupMembReductions", &Icmp6InGroupMembReductions);
623 + arl_expect(arl_ipv6, "Icmp6InRouterSolicits", &Icmp6InRouterSolicits);
624 + arl_expect(arl_ipv6, "Icmp6InRouterAdvertisements", &Icmp6InRouterAdvertisements);
625 + arl_expect(arl_ipv6, "Icmp6InNeighborSolicits", &Icmp6InNeighborSolicits);
626 + arl_expect(arl_ipv6, "Icmp6InNeighborAdvertisements", &Icmp6InNeighborAdvertisements);
627 + arl_expect(arl_ipv6, "Icmp6InRedirects", &Icmp6InRedirects);
628 + arl_expect(arl_ipv6, "Icmp6InMLDv2Reports", &Icmp6InMLDv2Reports);
629 + arl_expect(arl_ipv6, "Icmp6OutDestUnreachs", &Icmp6OutDestUnreachs);
630 + arl_expect(arl_ipv6, "Icmp6OutPktTooBigs", &Icmp6OutPktTooBigs);
631 + arl_expect(arl_ipv6, "Icmp6OutTimeExcds", &Icmp6OutTimeExcds);
632 + arl_expect(arl_ipv6, "Icmp6OutParmProblems", &Icmp6OutParmProblems);
633 + arl_expect(arl_ipv6, "Icmp6OutEchos", &Icmp6OutEchos);
634 + arl_expect(arl_ipv6, "Icmp6OutEchoReplies", &Icmp6OutEchoReplies);
635 + arl_expect(arl_ipv6, "Icmp6OutGroupMembQueries", &Icmp6OutGroupMembQueries);
636 + arl_expect(arl_ipv6, "Icmp6OutGroupMembResponses", &Icmp6OutGroupMembResponses);
637 + arl_expect(arl_ipv6, "Icmp6OutGroupMembReductions", &Icmp6OutGroupMembReductions);
638 + arl_expect(arl_ipv6, "Icmp6OutRouterSolicits", &Icmp6OutRouterSolicits);
639 + arl_expect(arl_ipv6, "Icmp6OutRouterAdvertisements", &Icmp6OutRouterAdvertisements);
640 + arl_expect(arl_ipv6, "Icmp6OutNeighborSolicits", &Icmp6OutNeighborSolicits);
641 + arl_expect(arl_ipv6, "Icmp6OutNeighborAdvertisements", &Icmp6OutNeighborAdvertisements);
642 + arl_expect(arl_ipv6, "Icmp6OutRedirects", &Icmp6OutRedirects);
643 + arl_expect(arl_ipv6, "Icmp6OutMLDv2Reports", &Icmp6OutMLDv2Reports);
644 + arl_expect(arl_ipv6, "Icmp6InType1", &Icmp6InType1);
645 + arl_expect(arl_ipv6, "Icmp6InType128", &Icmp6InType128);
646 + arl_expect(arl_ipv6, "Icmp6InType129", &Icmp6InType129);
647 + arl_expect(arl_ipv6, "Icmp6InType136", &Icmp6InType136);
648 + arl_expect(arl_ipv6, "Icmp6OutType1", &Icmp6OutType1);
649 + arl_expect(arl_ipv6, "Icmp6OutType128", &Icmp6OutType128);
650 + arl_expect(arl_ipv6, "Icmp6OutType129", &Icmp6OutType129);
651 + arl_expect(arl_ipv6, "Icmp6OutType133", &Icmp6OutType133);
652 + arl_expect(arl_ipv6, "Icmp6OutType135", &Icmp6OutType135);
653 + arl_expect(arl_ipv6, "Icmp6OutType143", &Icmp6OutType143);
654 + arl_expect(arl_ipv6, "Udp6InDatagrams", &Udp6InDatagrams);
655 + arl_expect(arl_ipv6, "Udp6NoPorts", &Udp6NoPorts);
656 + arl_expect(arl_ipv6, "Udp6InErrors", &Udp6InErrors);
657 + arl_expect(arl_ipv6, "Udp6OutDatagrams", &Udp6OutDatagrams);
658 + arl_expect(arl_ipv6, "Udp6RcvbufErrors", &Udp6RcvbufErrors);
659 + arl_expect(arl_ipv6, "Udp6SndbufErrors", &Udp6SndbufErrors);
660 + arl_expect(arl_ipv6, "Udp6InCsumErrors", &Udp6InCsumErrors);
661 + arl_expect(arl_ipv6, "Udp6IgnoredMulti", &Udp6IgnoredMulti);
662 + arl_expect(arl_ipv6, "UdpLite6InDatagrams", &UdpLite6InDatagrams);
663 + arl_expect(arl_ipv6, "UdpLite6NoPorts", &UdpLite6NoPorts);
664 + arl_expect(arl_ipv6, "UdpLite6InErrors", &UdpLite6InErrors);
665 + arl_expect(arl_ipv6, "UdpLite6OutDatagrams", &UdpLite6OutDatagrams);
666 + arl_expect(arl_ipv6, "UdpLite6RcvbufErrors", &UdpLite6RcvbufErrors);
667 + arl_expect(arl_ipv6, "UdpLite6SndbufErrors", &UdpLite6SndbufErrors);
668 + arl_expect(arl_ipv6, "UdpLite6InCsumErrors", &UdpLite6InCsumErrors);
669 + }
670 +
671 + size_t lines, l, words;
672 +
673 + // parse /proc/net/netstat
674 +
675 + if(unlikely(!ff_netstat)) {
676 char filename[FILENAME_MAX + 1];
677 snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, "/proc/net/netstat");
235 - ff = procfile_open(config_get(CONFIG_SECTION_PLUGIN_PROC_NETSTAT, "filename to monitor", filename), " \t:", PROCFILE_FLAG_DEFAULT);
236 - if(unlikely(!ff)) return 1;
678 + ff_netstat = procfile_open(config_get(CONFIG_SECTION_PLUGIN_PROC_NETSTAT, "filename to monitor", filename), " \t:", PROCFILE_FLAG_DEFAULT);
679 + if(unlikely(!ff_netstat)) return 1;
680 }
681
239 - ff = procfile_readall(ff);
240 - if(unlikely(!ff)) return 0; // we return 0, so that we will retry to open it next time
682 + ff_netstat = procfile_readall(ff_netstat);
683 + if(unlikely(!ff_netstat)) return 0; // we return 0, so that we will retry to open it next time
684
242 - size_t lines = procfile_lines(ff), l;
243 - size_t words;
685 + lines = procfile_lines(ff_netstat);
686
687 arl_begin(arl_ipext);
688 arl_begin(arl_tcpext);
689
690 for(l = 0; l < lines ;l++) {
249 - char *key = procfile_lineword(ff, l, 0);
691 + char *key = procfile_lineword(ff_netstat, l, 0);
692 uint32_t hash = simple_hash(key);
693
694 if(unlikely(hash == hash_ipext && strcmp(key, "IpExt") == 0)) {
695 size_t h = l++;
696
255 - words = procfile_linewords(ff, l);
697 + words = procfile_linewords(ff_netstat, l);
698 if(unlikely(words < 2)) {
699 error("Cannot read /proc/net/netstat IpExt line. Expected 2+ params, read %zu.", words);
700 continue;
701 }
702
261 - parse_line_pair(ff, arl_ipext, h, l);
262 -
263 - // --------------------------------------------------------------------
264 -
265 - if(do_bandwidth == CONFIG_BOOLEAN_YES || (do_bandwidth == CONFIG_BOOLEAN_AUTO &&
266 - (ipext_InOctets ||
267 - ipext_OutOctets ||
268 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
269 - do_bandwidth = CONFIG_BOOLEAN_YES;
270 - static RRDSET *st_system_ip = NULL;
271 - static RRDDIM *rd_in = NULL, *rd_out = NULL;
272 -
273 - if(unlikely(!st_system_ip)) {
274 - st_system_ip = rrdset_create_localhost(
275 - "system"
276 - , RRD_TYPE_NET_NETSTAT
277 - , NULL
278 - , "network"
279 - , NULL
280 - , "IP Bandwidth"
281 - , "kilobits/s"
282 - , PLUGIN_PROC_NAME
283 - , PLUGIN_PROC_MODULE_NETSTAT_NAME
284 - , NETDATA_CHART_PRIO_SYSTEM_IP
285 - , update_every
286 - , RRDSET_TYPE_AREA
287 - );
288 -
289 - rd_in = rrddim_add(st_system_ip, "InOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
290 - rd_out = rrddim_add(st_system_ip, "OutOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
291 - }
292 - else
293 - rrdset_next(st_system_ip);
294 -
295 - rrddim_set_by_pointer(st_system_ip, rd_in, ipext_InOctets);
296 - rrddim_set_by_pointer(st_system_ip, rd_out, ipext_OutOctets);
297 -
298 - rrdset_done(st_system_ip);
703 + parse_line_pair(ff_netstat, arl_ipext, h, l);
704 +
705 + }
706 + else if(unlikely(hash == hash_tcpext && strcmp(key, "TcpExt") == 0)) {
707 + size_t h = l++;
708 +
709 + words = procfile_linewords(ff_netstat, l);
710 + if(unlikely(words < 2)) {
711 + error("Cannot read /proc/net/netstat TcpExt line. Expected 2+ params, read %zu.", words);
712 + continue;
713 }
714
301 - // --------------------------------------------------------------------
302 -
303 - if(do_inerrors == CONFIG_BOOLEAN_YES || (do_inerrors == CONFIG_BOOLEAN_AUTO &&
304 - (ipext_InNoRoutes ||
305 - ipext_InTruncatedPkts ||
306 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
307 - do_inerrors = CONFIG_BOOLEAN_YES;
308 - static RRDSET *st_ip_inerrors = NULL;
309 - static RRDDIM *rd_noroutes = NULL, *rd_truncated = NULL, *rd_checksum = NULL;
310 -
311 - if(unlikely(!st_ip_inerrors)) {
312 - st_ip_inerrors = rrdset_create_localhost(
313 - RRD_TYPE_NET_NETSTAT
314 - , "inerrors"
315 - , NULL
316 - , "errors"
317 - , NULL
318 - , "IP Input Errors"
319 - , "packets/s"
320 - , PLUGIN_PROC_NAME
321 - , PLUGIN_PROC_MODULE_NETSTAT_NAME
322 - , NETDATA_CHART_PRIO_IP_ERRORS
323 - , update_every
324 - , RRDSET_TYPE_LINE
325 - );
326 -
327 - rrdset_flag_set(st_ip_inerrors, RRDSET_FLAG_DETAIL);
328 -
329 - rd_noroutes = rrddim_add(st_ip_inerrors, "InNoRoutes", "noroutes", 1, 1, RRD_ALGORITHM_INCREMENTAL);
330 - rd_truncated = rrddim_add(st_ip_inerrors, "InTruncatedPkts", "truncated", 1, 1, RRD_ALGORITHM_INCREMENTAL);
331 - rd_checksum = rrddim_add(st_ip_inerrors, "InCsumErrors", "checksum", 1, 1, RRD_ALGORITHM_INCREMENTAL);
332 - }
333 - else
334 - rrdset_next(st_ip_inerrors);
335 -
336 - rrddim_set_by_pointer(st_ip_inerrors, rd_noroutes, ipext_InNoRoutes);
337 - rrddim_set_by_pointer(st_ip_inerrors, rd_truncated, ipext_InTruncatedPkts);
338 - rrddim_set_by_pointer(st_ip_inerrors, rd_checksum, ipext_InCsumErrors);
339 -
340 - rrdset_done(st_ip_inerrors);
715 + parse_line_pair(ff_netstat, arl_tcpext, h, l);
716 + }
717 + }
718 +
719 + // parse /proc/net/snmp
720 +
721 + if(unlikely(!ff_snmp)) {
722 + char filename[FILENAME_MAX + 1];
723 + snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, "/proc/net/snmp");
724 + ff_snmp = procfile_open(config_get("plugin:proc:/proc/net/snmp", "filename to monitor", filename), " \t:", PROCFILE_FLAG_DEFAULT);
725 + if(unlikely(!ff_snmp)) return 1;
726 + }
727 +
728 + ff_snmp = procfile_readall(ff_snmp);
729 + if(unlikely(!ff_snmp)) return 0; // we return 0, so that we will retry to open it next time
730 +
731 + lines = procfile_lines(ff_snmp);
732 + size_t w;
733 +
734 + for(l = 0; l < lines ;l++) {
735 + char *key = procfile_lineword(ff_snmp, l, 0);
736 + uint32_t hash = simple_hash(key);
737 +
738 + if(unlikely(hash == hash_ip && strcmp(key, "Ip") == 0)) {
739 + size_t h = l++;
740 +
741 + if(strcmp(procfile_lineword(ff_snmp, l, 0), "Ip") != 0) {
742 + error("Cannot read Ip line from /proc/net/snmp.");
743 + break;
744 }
745
343 - // --------------------------------------------------------------------
746 + words = procfile_linewords(ff_snmp, l);
747 + if(words < 3) {
748 + error("Cannot read /proc/net/snmp Ip line. Expected 3+ params, read %zu.", words);
749 + continue;
750 + }
751
345 - if(do_mcast == CONFIG_BOOLEAN_YES || (do_mcast == CONFIG_BOOLEAN_AUTO &&
346 - (ipext_InMcastOctets ||
347 - ipext_OutMcastOctets ||
348 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
349 - do_mcast = CONFIG_BOOLEAN_YES;
350 - static RRDSET *st_ip_mcast = NULL;
351 - static RRDDIM *rd_in = NULL, *rd_out = NULL;
352 -
353 - if(unlikely(!st_ip_mcast)) {
354 - st_ip_mcast = rrdset_create_localhost(
355 - RRD_TYPE_NET_NETSTAT
356 - , "mcast"
357 - , NULL
358 - , "multicast"
359 - , NULL
360 - , "IP Multicast Bandwidth"
361 - , "kilobits/s"
362 - , PLUGIN_PROC_NAME
363 - , PLUGIN_PROC_MODULE_NETSTAT_NAME
364 - , NETDATA_CHART_PRIO_IP_MCAST
365 - , update_every
366 - , RRDSET_TYPE_AREA
367 - );
368 -
369 - rrdset_flag_set(st_ip_mcast, RRDSET_FLAG_DETAIL);
370 -
371 - rd_in = rrddim_add(st_ip_mcast, "InMcastOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
372 - rd_out = rrddim_add(st_ip_mcast, "OutMcastOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
373 - }
374 - else
375 - rrdset_next(st_ip_mcast);
376 -
377 - rrddim_set_by_pointer(st_ip_mcast, rd_in, ipext_InMcastOctets);
378 - rrddim_set_by_pointer(st_ip_mcast, rd_out, ipext_OutMcastOctets);
379 -
380 - rrdset_done(st_ip_mcast);
752 + arl_begin(arl_ip);
753 + for(w = 1; w < words ; w++) {
754 + if (unlikely(arl_check(arl_ip, procfile_lineword(ff_snmp, h, w), procfile_lineword(ff_snmp, l, w)) != 0))
755 + break;
756 }
757 + }
758 + else if(unlikely(hash == hash_icmp && strcmp(key, "Icmp") == 0)) {
759 + size_t h = l++;
760
383 - // --------------------------------------------------------------------
761 + if(strcmp(procfile_lineword(ff_snmp, l, 0), "Icmp") != 0) {
762 + error("Cannot read Icmp line from /proc/net/snmp.");
763 + break;
764 + }
765
385 - if(do_bcast == CONFIG_BOOLEAN_YES || (do_bcast == CONFIG_BOOLEAN_AUTO &&
386 - (ipext_InBcastOctets ||
387 - ipext_OutBcastOctets ||
388 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
389 - do_bcast = CONFIG_BOOLEAN_YES;
390 -
391 - static RRDSET *st_ip_bcast = NULL;
392 - static RRDDIM *rd_in = NULL, *rd_out = NULL;
393 -
394 - if(unlikely(!st_ip_bcast)) {
395 - st_ip_bcast = rrdset_create_localhost(
396 - RRD_TYPE_NET_NETSTAT
397 - , "bcast"
398 - , NULL
399 - , "broadcast"
400 - , NULL
401 - , "IP Broadcast Bandwidth"
402 - , "kilobits/s"
403 - , PLUGIN_PROC_NAME
404 - , PLUGIN_PROC_MODULE_NETSTAT_NAME
405 - , NETDATA_CHART_PRIO_IP_BCAST
406 - , update_every
407 - , RRDSET_TYPE_AREA
408 - );
409 -
410 - rrdset_flag_set(st_ip_bcast, RRDSET_FLAG_DETAIL);
411 -
412 - rd_in = rrddim_add(st_ip_bcast, "InBcastOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
413 - rd_out = rrddim_add(st_ip_bcast, "OutBcastOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
414 - }
415 - else
416 - rrdset_next(st_ip_bcast);
417 -
418 - rrddim_set_by_pointer(st_ip_bcast, rd_in, ipext_InBcastOctets);
419 - rrddim_set_by_pointer(st_ip_bcast, rd_out, ipext_OutBcastOctets);
420 -
421 - rrdset_done(st_ip_bcast);
766 + words = procfile_linewords(ff_snmp, l);
767 + if(words < 3) {
768 + error("Cannot read /proc/net/snmp Icmp line. Expected 3+ params, read %zu.", words);
769 + continue;
770 }
771
424 - // --------------------------------------------------------------------
772 + arl_begin(arl_icmp);
773 + for(w = 1; w < words ; w++) {
774 + if (unlikely(arl_check(arl_icmp, procfile_lineword(ff_snmp, h, w), procfile_lineword(ff_snmp, l, w)) != 0))
775 + break;
776 + }
777 + }
778 + else if(unlikely(hash == hash_icmpmsg && strcmp(key, "IcmpMsg") == 0)) {
779 + size_t h = l++;
780
426 - if(do_mcast_p == CONFIG_BOOLEAN_YES || (do_mcast_p == CONFIG_BOOLEAN_AUTO &&
427 - (ipext_InMcastPkts ||
428 - ipext_OutMcastPkts ||
429 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
430 - do_mcast_p = CONFIG_BOOLEAN_YES;
431 -
432 - static RRDSET *st_ip_mcastpkts = NULL;
433 - static RRDDIM *rd_in = NULL, *rd_out = NULL;
434 -
435 - if(unlikely(!st_ip_mcastpkts)) {
436 - st_ip_mcastpkts = rrdset_create_localhost(
437 - RRD_TYPE_NET_NETSTAT
438 - , "mcastpkts"
439 - , NULL
440 - , "multicast"
441 - , NULL
442 - , "IP Multicast Packets"
443 - , "packets/s"
444 - , PLUGIN_PROC_NAME
445 - , PLUGIN_PROC_MODULE_NETSTAT_NAME
446 - , NETDATA_CHART_PRIO_IP_MCAST_PACKETS
447 - , update_every
448 - , RRDSET_TYPE_LINE
449 - );
450 -
451 - rrdset_flag_set(st_ip_mcastpkts, RRDSET_FLAG_DETAIL);
452 -
453 - rd_in = rrddim_add(st_ip_mcastpkts, "InMcastPkts", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
454 - rd_out = rrddim_add(st_ip_mcastpkts, "OutMcastPkts", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
455 - }
456 - else rrdset_next(st_ip_mcastpkts);
457 -
458 - rrddim_set_by_pointer(st_ip_mcastpkts, rd_in, ipext_InMcastPkts);
459 - rrddim_set_by_pointer(st_ip_mcastpkts, rd_out, ipext_OutMcastPkts);
460 -
461 - rrdset_done(st_ip_mcastpkts);
781 + if(strcmp(procfile_lineword(ff_snmp, l, 0), "IcmpMsg") != 0) {
782 + error("Cannot read IcmpMsg line from /proc/net/snmp.");
783 + break;
784 + }
785 +
786 + words = procfile_linewords(ff_snmp, l);
787 + if(words < 2) {
788 + error("Cannot read /proc/net/snmp IcmpMsg line. Expected 2+ params, read %zu.", words);
789 + continue;
790 }
791
464 - // --------------------------------------------------------------------
792 + arl_begin(arl_icmpmsg);
793 + for(w = 1; w < words ; w++) {
794 + if (unlikely(arl_check(arl_icmpmsg, procfile_lineword(ff_snmp, h, w), procfile_lineword(ff_snmp, l, w)) != 0))
795 + break;
796 + }
797 + }
798 + else if(unlikely(hash == hash_tcp && strcmp(key, "Tcp") == 0)) {
799 + size_t h = l++;
800
466 - if(do_bcast_p == CONFIG_BOOLEAN_YES || (do_bcast_p == CONFIG_BOOLEAN_AUTO &&
467 - (ipext_InBcastPkts ||
468 - ipext_OutBcastPkts ||
469 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
470 - do_bcast_p = CONFIG_BOOLEAN_YES;
471 -
472 - static RRDSET *st_ip_bcastpkts = NULL;
473 - static RRDDIM *rd_in = NULL, *rd_out = NULL;
474 -
475 - if(unlikely(!st_ip_bcastpkts)) {
476 - st_ip_bcastpkts = rrdset_create_localhost(
477 - RRD_TYPE_NET_NETSTAT
478 - , "bcastpkts"
479 - , NULL
480 - , "broadcast"
481 - , NULL
482 - , "IP Broadcast Packets"
483 - , "packets/s"
484 - , PLUGIN_PROC_NAME
485 - , PLUGIN_PROC_MODULE_NETSTAT_NAME
486 - , NETDATA_CHART_PRIO_IP_BCAST_PACKETS
487 - , update_every
488 - , RRDSET_TYPE_LINE
489 - );
490 -
491 - rrdset_flag_set(st_ip_bcastpkts, RRDSET_FLAG_DETAIL);
492 -
493 - rd_in = rrddim_add(st_ip_bcastpkts, "InBcastPkts", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
494 - rd_out = rrddim_add(st_ip_bcastpkts, "OutBcastPkts", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
495 - }
496 - else
497 - rrdset_next(st_ip_bcastpkts);
498 -
499 - rrddim_set_by_pointer(st_ip_bcastpkts, rd_in, ipext_InBcastPkts);
500 - rrddim_set_by_pointer(st_ip_bcastpkts, rd_out, ipext_OutBcastPkts);
501 -
502 - rrdset_done(st_ip_bcastpkts);
801 + if(strcmp(procfile_lineword(ff_snmp, l, 0), "Tcp") != 0) {
802 + error("Cannot read Tcp line from /proc/net/snmp.");
803 + break;
804 }
805
505 - // --------------------------------------------------------------------
806 + words = procfile_linewords(ff_snmp, l);
807 + if(words < 3) {
808 + error("Cannot read /proc/net/snmp Tcp line. Expected 3+ params, read %zu.", words);
809 + continue;
810 + }
811
507 - if(do_ecn == CONFIG_BOOLEAN_YES || (do_ecn == CONFIG_BOOLEAN_AUTO &&
508 - (ipext_InCEPkts ||
509 - ipext_InECT0Pkts ||
510 - ipext_InECT1Pkts ||
511 - ipext_InNoECTPkts ||
512 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
513 - do_ecn = CONFIG_BOOLEAN_YES;
514 -
515 - static RRDSET *st_ecnpkts = NULL;
516 - static RRDDIM *rd_cep = NULL, *rd_noectp = NULL, *rd_ectp0 = NULL, *rd_ectp1 = NULL;
517 -
518 - if(unlikely(!st_ecnpkts)) {
519 - st_ecnpkts = rrdset_create_localhost(
520 - RRD_TYPE_NET_NETSTAT
521 - , "ecnpkts"
522 - , NULL
523 - , "ecn"
524 - , NULL
525 - , "IP ECN Statistics"
526 - , "packets/s"
527 - , PLUGIN_PROC_NAME
528 - , PLUGIN_PROC_MODULE_NETSTAT_NAME
529 - , NETDATA_CHART_PRIO_IP_ECN
530 - , update_every
531 - , RRDSET_TYPE_LINE
532 - );
533 -
534 - rrdset_flag_set(st_ecnpkts, RRDSET_FLAG_DETAIL);
535 -
536 - rd_cep = rrddim_add(st_ecnpkts, "InCEPkts", "CEP", 1, 1, RRD_ALGORITHM_INCREMENTAL);
537 - rd_noectp = rrddim_add(st_ecnpkts, "InNoECTPkts", "NoECTP", -1, 1, RRD_ALGORITHM_INCREMENTAL);
538 - rd_ectp0 = rrddim_add(st_ecnpkts, "InECT0Pkts", "ECTP0", 1, 1, RRD_ALGORITHM_INCREMENTAL);
539 - rd_ectp1 = rrddim_add(st_ecnpkts, "InECT1Pkts", "ECTP1", 1, 1, RRD_ALGORITHM_INCREMENTAL);
540 - }
541 - else rrdset_next(st_ecnpkts);
542 -
543 - rrddim_set_by_pointer(st_ecnpkts, rd_cep, ipext_InCEPkts);
544 - rrddim_set_by_pointer(st_ecnpkts, rd_noectp, ipext_InNoECTPkts);
545 - rrddim_set_by_pointer(st_ecnpkts, rd_ectp0, ipext_InECT0Pkts);
546 - rrddim_set_by_pointer(st_ecnpkts, rd_ectp1, ipext_InECT1Pkts);
547 -
548 - rrdset_done(st_ecnpkts);
812 + arl_begin(arl_tcp);
813 + for(w = 1; w < words ; w++) {
814 + if (unlikely(arl_check(arl_tcp, procfile_lineword(ff_snmp, h, w), procfile_lineword(ff_snmp, l, w)) != 0))
815 + break;
816 }
817 }
551 - else if(unlikely(hash == hash_tcpext && strcmp(key, "TcpExt") == 0)) {
818 + else if(unlikely(hash == hash_udp && strcmp(key, "Udp") == 0)) {
819 size_t h = l++;
820
554 - words = procfile_linewords(ff, l);
555 - if(unlikely(words < 2)) {
556 - error("Cannot read /proc/net/netstat TcpExt line. Expected 2+ params, read %zu.", words);
821 + if(strcmp(procfile_lineword(ff_snmp, l, 0), "Udp") != 0) {
822 + error("Cannot read Udp line from /proc/net/snmp.");
823 + break;
824 + }
825 +
826 + words = procfile_linewords(ff_snmp, l);
827 + if(words < 3) {
828 + error("Cannot read /proc/net/snmp Udp line. Expected 3+ params, read %zu.", words);
829 continue;
830 }
831
560 - parse_line_pair(ff, arl_tcpext, h, l);
561 -
562 - // --------------------------------------------------------------------
563 -
564 - if(do_tcpext_memory == CONFIG_BOOLEAN_YES || (do_tcpext_memory == CONFIG_BOOLEAN_AUTO &&
565 - (tcpext_TCPMemoryPressures ||
566 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
567 - do_tcpext_memory = CONFIG_BOOLEAN_YES;
568 -
569 - static RRDSET *st_tcpmemorypressures = NULL;
570 - static RRDDIM *rd_pressures = NULL;
571 -
572 - if(unlikely(!st_tcpmemorypressures)) {
573 - st_tcpmemorypressures = rrdset_create_localhost(
574 - RRD_TYPE_NET_NETSTAT
575 - , "tcpmemorypressures"
576 - , NULL
577 - , "tcp"
578 - , NULL
579 - , "TCP Memory Pressures"
580 - , "events/s"
581 - , PLUGIN_PROC_NAME
582 - , PLUGIN_PROC_MODULE_NETSTAT_NAME
583 - , NETDATA_CHART_PRIO_IP_TCP_MEM
584 - , update_every
585 - , RRDSET_TYPE_LINE
586 - );
587 -
588 - rd_pressures = rrddim_add(st_tcpmemorypressures, "TCPMemoryPressures", "pressures", 1, 1, RRD_ALGORITHM_INCREMENTAL);
589 - }
590 - else
591 - rrdset_next(st_tcpmemorypressures);
592 -
593 - rrddim_set_by_pointer(st_tcpmemorypressures, rd_pressures, tcpext_TCPMemoryPressures);
594 -
595 - rrdset_done(st_tcpmemorypressures);
832 + arl_begin(arl_udp);
833 + for(w = 1; w < words ; w++) {
834 + if (unlikely(arl_check(arl_udp, procfile_lineword(ff_snmp, h, w), procfile_lineword(ff_snmp, l, w)) != 0))
835 + break;
836 }
837 + }
838 + else if(unlikely(hash == hash_udplite && strcmp(key, "UdpLite") == 0)) {
839 + size_t h = l++;
840
598 - // --------------------------------------------------------------------
599 -
600 - if(do_tcpext_connaborts == CONFIG_BOOLEAN_YES || (do_tcpext_connaborts == CONFIG_BOOLEAN_AUTO &&
601 - (tcpext_TCPAbortOnData ||
602 - tcpext_TCPAbortOnClose ||
603 - tcpext_TCPAbortOnMemory ||
604 - tcpext_TCPAbortOnTimeout ||
605 - tcpext_TCPAbortOnLinger ||
606 - tcpext_TCPAbortFailed ||
607 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
608 - do_tcpext_connaborts = CONFIG_BOOLEAN_YES;
609 -
610 - static RRDSET *st_tcpconnaborts = NULL;
611 - static RRDDIM *rd_baddata = NULL, *rd_userclosed = NULL, *rd_nomemory = NULL, *rd_timeout = NULL, *rd_linger = NULL, *rd_failed = NULL;
612 -
613 - if(unlikely(!st_tcpconnaborts)) {
614 - st_tcpconnaborts = rrdset_create_localhost(
615 - RRD_TYPE_NET_NETSTAT
616 - , "tcpconnaborts"
617 - , NULL
618 - , "tcp"
619 - , NULL
620 - , "TCP Connection Aborts"
621 - , "connections/s"
622 - , PLUGIN_PROC_NAME
623 - , PLUGIN_PROC_MODULE_NETSTAT_NAME
624 - , NETDATA_CHART_PRIO_IP_TCP_CONNABORTS
625 - , update_every
626 - , RRDSET_TYPE_LINE
627 - );
628 -
629 - rd_baddata = rrddim_add(st_tcpconnaborts, "TCPAbortOnData", "baddata", 1, 1, RRD_ALGORITHM_INCREMENTAL);
630 - rd_userclosed = rrddim_add(st_tcpconnaborts, "TCPAbortOnClose", "userclosed", 1, 1, RRD_ALGORITHM_INCREMENTAL);
631 - rd_nomemory = rrddim_add(st_tcpconnaborts, "TCPAbortOnMemory", "nomemory", 1, 1, RRD_ALGORITHM_INCREMENTAL);
632 - rd_timeout = rrddim_add(st_tcpconnaborts, "TCPAbortOnTimeout", "timeout", 1, 1, RRD_ALGORITHM_INCREMENTAL);
633 - rd_linger = rrddim_add(st_tcpconnaborts, "TCPAbortOnLinger", "linger", 1, 1, RRD_ALGORITHM_INCREMENTAL);
634 - rd_failed = rrddim_add(st_tcpconnaborts, "TCPAbortFailed", "failed", -1, 1, RRD_ALGORITHM_INCREMENTAL);
635 - }
636 - else
637 - rrdset_next(st_tcpconnaborts);
638 -
639 - rrddim_set_by_pointer(st_tcpconnaborts, rd_baddata, tcpext_TCPAbortOnData);
640 - rrddim_set_by_pointer(st_tcpconnaborts, rd_userclosed, tcpext_TCPAbortOnClose);
641 - rrddim_set_by_pointer(st_tcpconnaborts, rd_nomemory, tcpext_TCPAbortOnMemory);
642 - rrddim_set_by_pointer(st_tcpconnaborts, rd_timeout, tcpext_TCPAbortOnTimeout);
643 - rrddim_set_by_pointer(st_tcpconnaborts, rd_linger, tcpext_TCPAbortOnLinger);
644 - rrddim_set_by_pointer(st_tcpconnaborts, rd_failed, tcpext_TCPAbortFailed);
645 -
646 - rrdset_done(st_tcpconnaborts);
841 + if(strcmp(procfile_lineword(ff_snmp, l, 0), "UdpLite") != 0) {
842 + error("Cannot read UdpLite line from /proc/net/snmp.");
843 + break;
844 }
845
649 - // --------------------------------------------------------------------
846 + words = procfile_linewords(ff_snmp, l);
847 + if(words < 3) {
848 + error("Cannot read /proc/net/snmp UdpLite line. Expected 3+ params, read %zu.", words);
849 + continue;
850 + }
851
651 - if(do_tcpext_reorder == CONFIG_BOOLEAN_YES || (do_tcpext_reorder == CONFIG_BOOLEAN_AUTO &&
652 - (tcpext_TCPRenoReorder ||
653 - tcpext_TCPFACKReorder ||
654 - tcpext_TCPSACKReorder ||
655 - tcpext_TCPTSReorder ||
656 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
657 - do_tcpext_reorder = CONFIG_BOOLEAN_YES;
658 -
659 - static RRDSET *st_tcpreorders = NULL;
660 - static RRDDIM *rd_timestamp = NULL, *rd_sack = NULL, *rd_fack = NULL, *rd_reno = NULL;
661 -
662 - if(unlikely(!st_tcpreorders)) {
663 - st_tcpreorders = rrdset_create_localhost(
664 - RRD_TYPE_NET_NETSTAT
665 - , "tcpreorders"
666 - , NULL
667 - , "tcp"
668 - , NULL
669 - , "TCP Reordered Packets by Detection Method"
670 - , "packets/s"
671 - , PLUGIN_PROC_NAME
672 - , PLUGIN_PROC_MODULE_NETSTAT_NAME
673 - , NETDATA_CHART_PRIO_IP_TCP_REORDERS
674 - , update_every
675 - , RRDSET_TYPE_LINE
676 - );
677 -
678 - rd_timestamp = rrddim_add(st_tcpreorders, "TCPTSReorder", "timestamp", 1, 1, RRD_ALGORITHM_INCREMENTAL);
679 - rd_sack = rrddim_add(st_tcpreorders, "TCPSACKReorder", "sack", 1, 1, RRD_ALGORITHM_INCREMENTAL);
680 - rd_fack = rrddim_add(st_tcpreorders, "TCPFACKReorder", "fack", 1, 1, RRD_ALGORITHM_INCREMENTAL);
681 - rd_reno = rrddim_add(st_tcpreorders, "TCPRenoReorder", "reno", 1, 1, RRD_ALGORITHM_INCREMENTAL);
682 - }
683 - else
684 - rrdset_next(st_tcpreorders);
685 -
686 - rrddim_set_by_pointer(st_tcpreorders, rd_timestamp, tcpext_TCPTSReorder);
687 - rrddim_set_by_pointer(st_tcpreorders, rd_sack, tcpext_TCPSACKReorder);
688 - rrddim_set_by_pointer(st_tcpreorders, rd_fack, tcpext_TCPFACKReorder);
689 - rrddim_set_by_pointer(st_tcpreorders, rd_reno, tcpext_TCPRenoReorder);
690 -
691 - rrdset_done(st_tcpreorders);
852 + arl_begin(arl_udplite);
853 + for(w = 1; w < words ; w++) {
854 + if (unlikely(arl_check(arl_udplite, procfile_lineword(ff_snmp, h, w), procfile_lineword(ff_snmp, l, w)) != 0))
855 + break;
856 }
857 + }
858 + }
859 +
860 + // parse /proc/net/snmp
861 +
862 + if(unlikely(!ff_snmp6)) {
863 + char filename[FILENAME_MAX + 1];
864 + snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, "/proc/net/snmp6");
865 + ff_snmp6 = procfile_open(config_get("plugin:proc:/proc/net/snmp6", "filename to monitor", filename), " \t:", PROCFILE_FLAG_DEFAULT);
866 + if(unlikely(!ff_snmp6))
867 + return 1;
868 + }
869 +
870 + ff_snmp6 = procfile_readall(ff_snmp6);
871 + if(unlikely(!ff_snmp6))
872 + return 0; // we return 0, so that we will retry to open it next time
873 +
874 + lines = procfile_lines(ff_snmp6);
875 +
876 + arl_begin(arl_ipv6);
877 +
878 + for(l = 0; l < lines ;l++) {
879 + size_t words = procfile_linewords(ff_snmp6, l);
880 + if(unlikely(words < 2)) {
881 + if(unlikely(words)) error("Cannot read /proc/net/snmp6 line %zu. Expected 2 params, read %zu.", l, words);
882 + continue;
883 + }
884 +
885 + if(unlikely(arl_check(arl_ipv6,
886 + procfile_lineword(ff_snmp6, l, 0),
887 + procfile_lineword(ff_snmp6, l, 1)))) break;
888 + }
889 +
890 + // netstat IpExt charts
891 +
892 + // --------------------------------------------------------------------
893 +
894 + if(do_bandwidth == CONFIG_BOOLEAN_YES || (do_bandwidth == CONFIG_BOOLEAN_AUTO &&
895 + (ipext_InOctets ||
896 + ipext_OutOctets ||
897 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
898 + do_bandwidth = CONFIG_BOOLEAN_YES;
899 + static RRDSET *st_system_ip = NULL;
900 + static RRDDIM *rd_in = NULL, *rd_out = NULL;
901 +
902 + if(unlikely(!st_system_ip)) {
903 + st_system_ip = rrdset_create_localhost(
904 + "system"
905 + , RRD_TYPE_NET_NETSTAT
906 + , NULL
907 + , "network"
908 + , NULL
909 + , "IP Bandwidth"
910 + , "kilobits/s"
911 + , PLUGIN_PROC_NAME
912 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
913 + , NETDATA_CHART_PRIO_SYSTEM_IP
914 + , update_every
915 + , RRDSET_TYPE_AREA
916 + );
917 +
918 + rd_in = rrddim_add(st_system_ip, "InOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
919 + rd_out = rrddim_add(st_system_ip, "OutOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
920 + }
921 + else
922 + rrdset_next(st_system_ip);
923 +
924 + rrddim_set_by_pointer(st_system_ip, rd_in, ipext_InOctets);
925 + rrddim_set_by_pointer(st_system_ip, rd_out, ipext_OutOctets);
926 +
927 + rrdset_done(st_system_ip);
928 + }
929 +
930 + // --------------------------------------------------------------------
931 +
932 + if(do_inerrors == CONFIG_BOOLEAN_YES || (do_inerrors == CONFIG_BOOLEAN_AUTO &&
933 + (ipext_InNoRoutes ||
934 + ipext_InTruncatedPkts ||
935 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
936 + do_inerrors = CONFIG_BOOLEAN_YES;
937 + static RRDSET *st_ip_inerrors = NULL;
938 + static RRDDIM *rd_noroutes = NULL, *rd_truncated = NULL, *rd_checksum = NULL;
939 +
940 + if(unlikely(!st_ip_inerrors)) {
941 + st_ip_inerrors = rrdset_create_localhost(
942 + RRD_TYPE_NET_NETSTAT
943 + , "inerrors"
944 + , NULL
945 + , "errors"
946 + , NULL
947 + , "IP Input Errors"
948 + , "packets/s"
949 + , PLUGIN_PROC_NAME
950 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
951 + , NETDATA_CHART_PRIO_IP_ERRORS
952 + , update_every
953 + , RRDSET_TYPE_LINE
954 + );
955 +
956 + rrdset_flag_set(st_ip_inerrors, RRDSET_FLAG_DETAIL);
957 +
958 + rd_noroutes = rrddim_add(st_ip_inerrors, "InNoRoutes", "noroutes", 1, 1, RRD_ALGORITHM_INCREMENTAL);
959 + rd_truncated = rrddim_add(st_ip_inerrors, "InTruncatedPkts", "truncated", 1, 1, RRD_ALGORITHM_INCREMENTAL);
960 + rd_checksum = rrddim_add(st_ip_inerrors, "InCsumErrors", "checksum", 1, 1, RRD_ALGORITHM_INCREMENTAL);
961 + }
962 + else
963 + rrdset_next(st_ip_inerrors);
964 +
965 + rrddim_set_by_pointer(st_ip_inerrors, rd_noroutes, ipext_InNoRoutes);
966 + rrddim_set_by_pointer(st_ip_inerrors, rd_truncated, ipext_InTruncatedPkts);
967 + rrddim_set_by_pointer(st_ip_inerrors, rd_checksum, ipext_InCsumErrors);
968 +
969 + rrdset_done(st_ip_inerrors);
970 + }
971 +
972 + // --------------------------------------------------------------------
973 +
974 + if(do_mcast == CONFIG_BOOLEAN_YES || (do_mcast == CONFIG_BOOLEAN_AUTO &&
975 + (ipext_InMcastOctets ||
976 + ipext_OutMcastOctets ||
977 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
978 + do_mcast = CONFIG_BOOLEAN_YES;
979 + static RRDSET *st_ip_mcast = NULL;
980 + static RRDDIM *rd_in = NULL, *rd_out = NULL;
981 +
982 + if(unlikely(!st_ip_mcast)) {
983 + st_ip_mcast = rrdset_create_localhost(
984 + RRD_TYPE_NET_NETSTAT
985 + , "mcast"
986 + , NULL
987 + , "multicast"
988 + , NULL
989 + , "IP Multicast Bandwidth"
990 + , "kilobits/s"
991 + , PLUGIN_PROC_NAME
992 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
993 + , NETDATA_CHART_PRIO_IP_MCAST
994 + , update_every
995 + , RRDSET_TYPE_AREA
996 + );
997 +
998 + rrdset_flag_set(st_ip_mcast, RRDSET_FLAG_DETAIL);
999 +
1000 + rd_in = rrddim_add(st_ip_mcast, "InMcastOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
1001 + rd_out = rrddim_add(st_ip_mcast, "OutMcastOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
1002 + }
1003 + else
1004 + rrdset_next(st_ip_mcast);
1005
694 - // --------------------------------------------------------------------
1006 + rrddim_set_by_pointer(st_ip_mcast, rd_in, ipext_InMcastOctets);
1007 + rrddim_set_by_pointer(st_ip_mcast, rd_out, ipext_OutMcastOctets);
1008
696 - if(do_tcpext_ofo == CONFIG_BOOLEAN_YES || (do_tcpext_ofo == CONFIG_BOOLEAN_AUTO &&
697 - (tcpext_TCPOFOQueue ||
698 - tcpext_TCPOFODrop ||
699 - tcpext_TCPOFOMerge ||
1009 + rrdset_done(st_ip_mcast);
1010 + }
1011 +
1012 + // --------------------------------------------------------------------
1013 +
1014 + if(do_bcast == CONFIG_BOOLEAN_YES || (do_bcast == CONFIG_BOOLEAN_AUTO &&
1015 + (ipext_InBcastOctets ||
1016 + ipext_OutBcastOctets ||
1017 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1018 + do_bcast = CONFIG_BOOLEAN_YES;
1019 +
1020 + static RRDSET *st_ip_bcast = NULL;
1021 + static RRDDIM *rd_in = NULL, *rd_out = NULL;
1022 +
1023 + if(unlikely(!st_ip_bcast)) {
1024 + st_ip_bcast = rrdset_create_localhost(
1025 + RRD_TYPE_NET_NETSTAT
1026 + , "bcast"
1027 + , NULL
1028 + , "broadcast"
1029 + , NULL
1030 + , "IP Broadcast Bandwidth"
1031 + , "kilobits/s"
1032 + , PLUGIN_PROC_NAME
1033 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1034 + , NETDATA_CHART_PRIO_IP_BCAST
1035 + , update_every
1036 + , RRDSET_TYPE_AREA
1037 + );
1038 +
1039 + rrdset_flag_set(st_ip_bcast, RRDSET_FLAG_DETAIL);
1040 +
1041 + rd_in = rrddim_add(st_ip_bcast, "InBcastOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
1042 + rd_out = rrddim_add(st_ip_bcast, "OutBcastOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
1043 + }
1044 + else
1045 + rrdset_next(st_ip_bcast);
1046 +
1047 + rrddim_set_by_pointer(st_ip_bcast, rd_in, ipext_InBcastOctets);
1048 + rrddim_set_by_pointer(st_ip_bcast, rd_out, ipext_OutBcastOctets);
1049 +
1050 + rrdset_done(st_ip_bcast);
1051 + }
1052 +
1053 + // --------------------------------------------------------------------
1054 +
1055 + if(do_mcast_p == CONFIG_BOOLEAN_YES || (do_mcast_p == CONFIG_BOOLEAN_AUTO &&
1056 + (ipext_InMcastPkts ||
1057 + ipext_OutMcastPkts ||
1058 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1059 + do_mcast_p = CONFIG_BOOLEAN_YES;
1060 +
1061 + static RRDSET *st_ip_mcastpkts = NULL;
1062 + static RRDDIM *rd_in = NULL, *rd_out = NULL;
1063 +
1064 + if(unlikely(!st_ip_mcastpkts)) {
1065 + st_ip_mcastpkts = rrdset_create_localhost(
1066 + RRD_TYPE_NET_NETSTAT
1067 + , "mcastpkts"
1068 + , NULL
1069 + , "multicast"
1070 + , NULL
1071 + , "IP Multicast Packets"
1072 + , "packets/s"
1073 + , PLUGIN_PROC_NAME
1074 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1075 + , NETDATA_CHART_PRIO_IP_MCAST_PACKETS
1076 + , update_every
1077 + , RRDSET_TYPE_LINE
1078 + );
1079 +
1080 + rrdset_flag_set(st_ip_mcastpkts, RRDSET_FLAG_DETAIL);
1081 +
1082 + rd_in = rrddim_add(st_ip_mcastpkts, "InMcastPkts", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1083 + rd_out = rrddim_add(st_ip_mcastpkts, "OutMcastPkts", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1084 + }
1085 + else rrdset_next(st_ip_mcastpkts);
1086 +
1087 + rrddim_set_by_pointer(st_ip_mcastpkts, rd_in, ipext_InMcastPkts);
1088 + rrddim_set_by_pointer(st_ip_mcastpkts, rd_out, ipext_OutMcastPkts);
1089 +
1090 + rrdset_done(st_ip_mcastpkts);
1091 + }
1092 +
1093 + // --------------------------------------------------------------------
1094 +
1095 + if(do_bcast_p == CONFIG_BOOLEAN_YES || (do_bcast_p == CONFIG_BOOLEAN_AUTO &&
1096 + (ipext_InBcastPkts ||
1097 + ipext_OutBcastPkts ||
1098 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1099 + do_bcast_p = CONFIG_BOOLEAN_YES;
1100 +
1101 + static RRDSET *st_ip_bcastpkts = NULL;
1102 + static RRDDIM *rd_in = NULL, *rd_out = NULL;
1103 +
1104 + if(unlikely(!st_ip_bcastpkts)) {
1105 + st_ip_bcastpkts = rrdset_create_localhost(
1106 + RRD_TYPE_NET_NETSTAT
1107 + , "bcastpkts"
1108 + , NULL
1109 + , "broadcast"
1110 + , NULL
1111 + , "IP Broadcast Packets"
1112 + , "packets/s"
1113 + , PLUGIN_PROC_NAME
1114 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1115 + , NETDATA_CHART_PRIO_IP_BCAST_PACKETS
1116 + , update_every
1117 + , RRDSET_TYPE_LINE
1118 + );
1119 +
1120 + rrdset_flag_set(st_ip_bcastpkts, RRDSET_FLAG_DETAIL);
1121 +
1122 + rd_in = rrddim_add(st_ip_bcastpkts, "InBcastPkts", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1123 + rd_out = rrddim_add(st_ip_bcastpkts, "OutBcastPkts", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1124 + }
1125 + else
1126 + rrdset_next(st_ip_bcastpkts);
1127 +
1128 + rrddim_set_by_pointer(st_ip_bcastpkts, rd_in, ipext_InBcastPkts);
1129 + rrddim_set_by_pointer(st_ip_bcastpkts, rd_out, ipext_OutBcastPkts);
1130 +
1131 + rrdset_done(st_ip_bcastpkts);
1132 + }
1133 +
1134 + // --------------------------------------------------------------------
1135 +
1136 + if(do_ecn == CONFIG_BOOLEAN_YES || (do_ecn == CONFIG_BOOLEAN_AUTO &&
1137 + (ipext_InCEPkts ||
1138 + ipext_InECT0Pkts ||
1139 + ipext_InECT1Pkts ||
1140 + ipext_InNoECTPkts ||
1141 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1142 + do_ecn = CONFIG_BOOLEAN_YES;
1143 +
1144 + static RRDSET *st_ecnpkts = NULL;
1145 + static RRDDIM *rd_cep = NULL, *rd_noectp = NULL, *rd_ectp0 = NULL, *rd_ectp1 = NULL;
1146 +
1147 + if(unlikely(!st_ecnpkts)) {
1148 + st_ecnpkts = rrdset_create_localhost(
1149 + RRD_TYPE_NET_NETSTAT
1150 + , "ecnpkts"
1151 + , NULL
1152 + , "ecn"
1153 + , NULL
1154 + , "IP ECN Statistics"
1155 + , "packets/s"
1156 + , PLUGIN_PROC_NAME
1157 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1158 + , NETDATA_CHART_PRIO_IP_ECN
1159 + , update_every
1160 + , RRDSET_TYPE_LINE
1161 + );
1162 +
1163 + rrdset_flag_set(st_ecnpkts, RRDSET_FLAG_DETAIL);
1164 +
1165 + rd_cep = rrddim_add(st_ecnpkts, "InCEPkts", "CEP", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1166 + rd_noectp = rrddim_add(st_ecnpkts, "InNoECTPkts", "NoECTP", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1167 + rd_ectp0 = rrddim_add(st_ecnpkts, "InECT0Pkts", "ECTP0", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1168 + rd_ectp1 = rrddim_add(st_ecnpkts, "InECT1Pkts", "ECTP1", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1169 + }
1170 + else rrdset_next(st_ecnpkts);
1171 +
1172 + rrddim_set_by_pointer(st_ecnpkts, rd_cep, ipext_InCEPkts);
1173 + rrddim_set_by_pointer(st_ecnpkts, rd_noectp, ipext_InNoECTPkts);
1174 + rrddim_set_by_pointer(st_ecnpkts, rd_ectp0, ipext_InECT0Pkts);
1175 + rrddim_set_by_pointer(st_ecnpkts, rd_ectp1, ipext_InECT1Pkts);
1176 +
1177 + rrdset_done(st_ecnpkts);
1178 + }
1179 +
1180 + // netstat TcpExt charts
1181 +
1182 + // --------------------------------------------------------------------
1183 +
1184 + if(do_tcpext_memory == CONFIG_BOOLEAN_YES || (do_tcpext_memory == CONFIG_BOOLEAN_AUTO &&
1185 + (tcpext_TCPMemoryPressures ||
1186 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1187 + do_tcpext_memory = CONFIG_BOOLEAN_YES;
1188 +
1189 + static RRDSET *st_tcpmemorypressures = NULL;
1190 + static RRDDIM *rd_pressures = NULL;
1191 +
1192 + if(unlikely(!st_tcpmemorypressures)) {
1193 + st_tcpmemorypressures = rrdset_create_localhost(
1194 + RRD_TYPE_NET_NETSTAT
1195 + , "tcpmemorypressures"
1196 + , NULL
1197 + , "tcp"
1198 + , NULL
1199 + , "TCP Memory Pressures"
1200 + , "events/s"
1201 + , PLUGIN_PROC_NAME
1202 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1203 + , NETDATA_CHART_PRIO_IP_TCP_MEM
1204 + , update_every
1205 + , RRDSET_TYPE_LINE
1206 + );
1207 +
1208 + rd_pressures = rrddim_add(st_tcpmemorypressures, "TCPMemoryPressures", "pressures", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1209 + }
1210 + else
1211 + rrdset_next(st_tcpmemorypressures);
1212 +
1213 + rrddim_set_by_pointer(st_tcpmemorypressures, rd_pressures, tcpext_TCPMemoryPressures);
1214 +
1215 + rrdset_done(st_tcpmemorypressures);
1216 + }
1217 +
1218 + // --------------------------------------------------------------------
1219 +
1220 + if(do_tcpext_connaborts == CONFIG_BOOLEAN_YES || (do_tcpext_connaborts == CONFIG_BOOLEAN_AUTO &&
1221 + (tcpext_TCPAbortOnData ||
1222 + tcpext_TCPAbortOnClose ||
1223 + tcpext_TCPAbortOnMemory ||
1224 + tcpext_TCPAbortOnTimeout ||
1225 + tcpext_TCPAbortOnLinger ||
1226 + tcpext_TCPAbortFailed ||
1227 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1228 + do_tcpext_connaborts = CONFIG_BOOLEAN_YES;
1229 +
1230 + static RRDSET *st_tcpconnaborts = NULL;
1231 + static RRDDIM *rd_baddata = NULL, *rd_userclosed = NULL, *rd_nomemory = NULL, *rd_timeout = NULL, *rd_linger = NULL, *rd_failed = NULL;
1232 +
1233 + if(unlikely(!st_tcpconnaborts)) {
1234 + st_tcpconnaborts = rrdset_create_localhost(
1235 + RRD_TYPE_NET_NETSTAT
1236 + , "tcpconnaborts"
1237 + , NULL
1238 + , "tcp"
1239 + , NULL
1240 + , "TCP Connection Aborts"
1241 + , "connections/s"
1242 + , PLUGIN_PROC_NAME
1243 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1244 + , NETDATA_CHART_PRIO_IP_TCP_CONNABORTS
1245 + , update_every
1246 + , RRDSET_TYPE_LINE
1247 + );
1248 +
1249 + rd_baddata = rrddim_add(st_tcpconnaborts, "TCPAbortOnData", "baddata", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1250 + rd_userclosed = rrddim_add(st_tcpconnaborts, "TCPAbortOnClose", "userclosed", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1251 + rd_nomemory = rrddim_add(st_tcpconnaborts, "TCPAbortOnMemory", "nomemory", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1252 + rd_timeout = rrddim_add(st_tcpconnaborts, "TCPAbortOnTimeout", "timeout", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1253 + rd_linger = rrddim_add(st_tcpconnaborts, "TCPAbortOnLinger", "linger", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1254 + rd_failed = rrddim_add(st_tcpconnaborts, "TCPAbortFailed", "failed", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1255 + }
1256 + else
1257 + rrdset_next(st_tcpconnaborts);
1258 +
1259 + rrddim_set_by_pointer(st_tcpconnaborts, rd_baddata, tcpext_TCPAbortOnData);
1260 + rrddim_set_by_pointer(st_tcpconnaborts, rd_userclosed, tcpext_TCPAbortOnClose);
1261 + rrddim_set_by_pointer(st_tcpconnaborts, rd_nomemory, tcpext_TCPAbortOnMemory);
1262 + rrddim_set_by_pointer(st_tcpconnaborts, rd_timeout, tcpext_TCPAbortOnTimeout);
1263 + rrddim_set_by_pointer(st_tcpconnaborts, rd_linger, tcpext_TCPAbortOnLinger);
1264 + rrddim_set_by_pointer(st_tcpconnaborts, rd_failed, tcpext_TCPAbortFailed);
1265 +
1266 + rrdset_done(st_tcpconnaborts);
1267 + }
1268 +
1269 + // --------------------------------------------------------------------
1270 +
1271 + if(do_tcpext_reorder == CONFIG_BOOLEAN_YES || (do_tcpext_reorder == CONFIG_BOOLEAN_AUTO &&
1272 + (tcpext_TCPRenoReorder ||
1273 + tcpext_TCPFACKReorder ||
1274 + tcpext_TCPSACKReorder ||
1275 + tcpext_TCPTSReorder ||
1276 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1277 + do_tcpext_reorder = CONFIG_BOOLEAN_YES;
1278 +
1279 + static RRDSET *st_tcpreorders = NULL;
1280 + static RRDDIM *rd_timestamp = NULL, *rd_sack = NULL, *rd_fack = NULL, *rd_reno = NULL;
1281 +
1282 + if(unlikely(!st_tcpreorders)) {
1283 + st_tcpreorders = rrdset_create_localhost(
1284 + RRD_TYPE_NET_NETSTAT
1285 + , "tcpreorders"
1286 + , NULL
1287 + , "tcp"
1288 + , NULL
1289 + , "TCP Reordered Packets by Detection Method"
1290 + , "packets/s"
1291 + , PLUGIN_PROC_NAME
1292 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1293 + , NETDATA_CHART_PRIO_IP_TCP_REORDERS
1294 + , update_every
1295 + , RRDSET_TYPE_LINE
1296 + );
1297 +
1298 + rd_timestamp = rrddim_add(st_tcpreorders, "TCPTSReorder", "timestamp", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1299 + rd_sack = rrddim_add(st_tcpreorders, "TCPSACKReorder", "sack", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1300 + rd_fack = rrddim_add(st_tcpreorders, "TCPFACKReorder", "fack", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1301 + rd_reno = rrddim_add(st_tcpreorders, "TCPRenoReorder", "reno", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1302 + }
1303 + else
1304 + rrdset_next(st_tcpreorders);
1305 +
1306 + rrddim_set_by_pointer(st_tcpreorders, rd_timestamp, tcpext_TCPTSReorder);
1307 + rrddim_set_by_pointer(st_tcpreorders, rd_sack, tcpext_TCPSACKReorder);
1308 + rrddim_set_by_pointer(st_tcpreorders, rd_fack, tcpext_TCPFACKReorder);
1309 + rrddim_set_by_pointer(st_tcpreorders, rd_reno, tcpext_TCPRenoReorder);
1310 +
1311 + rrdset_done(st_tcpreorders);
1312 + }
1313 +
1314 + // --------------------------------------------------------------------
1315 +
1316 + if(do_tcpext_ofo == CONFIG_BOOLEAN_YES || (do_tcpext_ofo == CONFIG_BOOLEAN_AUTO &&
1317 + (tcpext_TCPOFOQueue ||
1318 + tcpext_TCPOFODrop ||
1319 + tcpext_TCPOFOMerge ||
1320 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1321 + do_tcpext_ofo = CONFIG_BOOLEAN_YES;
1322 +
1323 + static RRDSET *st_ip_tcpofo = NULL;
1324 + static RRDDIM *rd_inqueue = NULL, *rd_dropped = NULL, *rd_merged = NULL, *rd_pruned = NULL;
1325 +
1326 + if(unlikely(!st_ip_tcpofo)) {
1327 +
1328 + st_ip_tcpofo = rrdset_create_localhost(
1329 + RRD_TYPE_NET_NETSTAT
1330 + , "tcpofo"
1331 + , NULL
1332 + , "tcp"
1333 + , NULL
1334 + , "TCP Out-Of-Order Queue"
1335 + , "packets/s"
1336 + , PLUGIN_PROC_NAME
1337 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1338 + , NETDATA_CHART_PRIO_IP_TCP_OFO
1339 + , update_every
1340 + , RRDSET_TYPE_LINE
1341 + );
1342 +
1343 + rd_inqueue = rrddim_add(st_ip_tcpofo, "TCPOFOQueue", "inqueue", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1344 + rd_dropped = rrddim_add(st_ip_tcpofo, "TCPOFODrop", "dropped", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1345 + rd_merged = rrddim_add(st_ip_tcpofo, "TCPOFOMerge", "merged", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1346 + rd_pruned = rrddim_add(st_ip_tcpofo, "OfoPruned", "pruned", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1347 + }
1348 + else
1349 + rrdset_next(st_ip_tcpofo);
1350 +
1351 + rrddim_set_by_pointer(st_ip_tcpofo, rd_inqueue, tcpext_TCPOFOQueue);
1352 + rrddim_set_by_pointer(st_ip_tcpofo, rd_dropped, tcpext_TCPOFODrop);
1353 + rrddim_set_by_pointer(st_ip_tcpofo, rd_merged, tcpext_TCPOFOMerge);
1354 + rrddim_set_by_pointer(st_ip_tcpofo, rd_pruned, tcpext_OfoPruned);
1355 +
1356 + rrdset_done(st_ip_tcpofo);
1357 + }
1358 +
1359 + // --------------------------------------------------------------------
1360 +
1361 + if(do_tcpext_syscookies == CONFIG_BOOLEAN_YES || (do_tcpext_syscookies == CONFIG_BOOLEAN_AUTO &&
1362 + (tcpext_SyncookiesSent ||
1363 + tcpext_SyncookiesRecv ||
1364 + tcpext_SyncookiesFailed ||
1365 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1366 + do_tcpext_syscookies = CONFIG_BOOLEAN_YES;
1367 +
1368 + static RRDSET *st_syncookies = NULL;
1369 + static RRDDIM *rd_received = NULL, *rd_sent = NULL, *rd_failed = NULL;
1370 +
1371 + if(unlikely(!st_syncookies)) {
1372 +
1373 + st_syncookies = rrdset_create_localhost(
1374 + RRD_TYPE_NET_NETSTAT
1375 + , "tcpsyncookies"
1376 + , NULL
1377 + , "tcp"
1378 + , NULL
1379 + , "TCP SYN Cookies"
1380 + , "packets/s"
1381 + , PLUGIN_PROC_NAME
1382 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1383 + , NETDATA_CHART_PRIO_IP_TCP_SYNCOOKIES
1384 + , update_every
1385 + , RRDSET_TYPE_LINE
1386 + );
1387 +
1388 + rd_received = rrddim_add(st_syncookies, "SyncookiesRecv", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1389 + rd_sent = rrddim_add(st_syncookies, "SyncookiesSent", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1390 + rd_failed = rrddim_add(st_syncookies, "SyncookiesFailed", "failed", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1391 + }
1392 + else
1393 + rrdset_next(st_syncookies);
1394 +
1395 + rrddim_set_by_pointer(st_syncookies, rd_received, tcpext_SyncookiesRecv);
1396 + rrddim_set_by_pointer(st_syncookies, rd_sent, tcpext_SyncookiesSent);
1397 + rrddim_set_by_pointer(st_syncookies, rd_failed, tcpext_SyncookiesFailed);
1398 +
1399 + rrdset_done(st_syncookies);
1400 + }
1401 +
1402 + // --------------------------------------------------------------------
1403 +
1404 + if(do_tcpext_syn_queue == CONFIG_BOOLEAN_YES || (do_tcpext_syn_queue == CONFIG_BOOLEAN_AUTO &&
1405 + (tcpext_TCPReqQFullDrop ||
1406 + tcpext_TCPReqQFullDoCookies ||
1407 netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
701 - do_tcpext_ofo = CONFIG_BOOLEAN_YES;
702 -
703 - static RRDSET *st_ip_tcpofo = NULL;
704 - static RRDDIM *rd_inqueue = NULL, *rd_dropped = NULL, *rd_merged = NULL, *rd_pruned = NULL;
705 -
706 - if(unlikely(!st_ip_tcpofo)) {
707 -
708 - st_ip_tcpofo = rrdset_create_localhost(
709 - RRD_TYPE_NET_NETSTAT
710 - , "tcpofo"
711 - , NULL
712 - , "tcp"
713 - , NULL
714 - , "TCP Out-Of-Order Queue"
715 - , "packets/s"
716 - , PLUGIN_PROC_NAME
717 - , PLUGIN_PROC_MODULE_NETSTAT_NAME
718 - , NETDATA_CHART_PRIO_IP_TCP_OFO
719 - , update_every
720 - , RRDSET_TYPE_LINE
721 - );
722 -
723 - rd_inqueue = rrddim_add(st_ip_tcpofo, "TCPOFOQueue", "inqueue", 1, 1, RRD_ALGORITHM_INCREMENTAL);
724 - rd_dropped = rrddim_add(st_ip_tcpofo, "TCPOFODrop", "dropped", -1, 1, RRD_ALGORITHM_INCREMENTAL);
725 - rd_merged = rrddim_add(st_ip_tcpofo, "TCPOFOMerge", "merged", 1, 1, RRD_ALGORITHM_INCREMENTAL);
726 - rd_pruned = rrddim_add(st_ip_tcpofo, "OfoPruned", "pruned", -1, 1, RRD_ALGORITHM_INCREMENTAL);
727 - }
728 - else
729 - rrdset_next(st_ip_tcpofo);
730 -
731 - rrddim_set_by_pointer(st_ip_tcpofo, rd_inqueue, tcpext_TCPOFOQueue);
732 - rrddim_set_by_pointer(st_ip_tcpofo, rd_dropped, tcpext_TCPOFODrop);
733 - rrddim_set_by_pointer(st_ip_tcpofo, rd_merged, tcpext_TCPOFOMerge);
734 - rrddim_set_by_pointer(st_ip_tcpofo, rd_pruned, tcpext_OfoPruned);
735 -
736 - rrdset_done(st_ip_tcpofo);
1408 + do_tcpext_syn_queue = CONFIG_BOOLEAN_YES;
1409 +
1410 + static RRDSET *st_syn_queue = NULL;
1411 + static RRDDIM
1412 + *rd_TCPReqQFullDrop = NULL,
1413 + *rd_TCPReqQFullDoCookies = NULL;
1414 +
1415 + if(unlikely(!st_syn_queue)) {
1416 +
1417 + st_syn_queue = rrdset_create_localhost(
1418 + RRD_TYPE_NET_NETSTAT
1419 + , "tcp_syn_queue"
1420 + , NULL
1421 + , "tcp"
1422 + , NULL
1423 + , "TCP SYN Queue Issues"
1424 + , "packets/s"
1425 + , PLUGIN_PROC_NAME
1426 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1427 + , NETDATA_CHART_PRIO_IP_TCP_SYN_QUEUE
1428 + , update_every
1429 + , RRDSET_TYPE_LINE
1430 + );
1431 +
1432 + rd_TCPReqQFullDrop = rrddim_add(st_syn_queue, "TCPReqQFullDrop", "drops", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1433 + rd_TCPReqQFullDoCookies = rrddim_add(st_syn_queue, "TCPReqQFullDoCookies", "cookies", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1434 + }
1435 + else
1436 + rrdset_next(st_syn_queue);
1437 +
1438 + rrddim_set_by_pointer(st_syn_queue, rd_TCPReqQFullDrop, tcpext_TCPReqQFullDrop);
1439 + rrddim_set_by_pointer(st_syn_queue, rd_TCPReqQFullDoCookies, tcpext_TCPReqQFullDoCookies);
1440 +
1441 + rrdset_done(st_syn_queue);
1442 + }
1443 +
1444 + // --------------------------------------------------------------------
1445 +
1446 + if(do_tcpext_accept_queue == CONFIG_BOOLEAN_YES || (do_tcpext_accept_queue == CONFIG_BOOLEAN_AUTO &&
1447 + (tcpext_ListenOverflows ||
1448 + tcpext_ListenDrops ||
1449 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1450 + do_tcpext_accept_queue = CONFIG_BOOLEAN_YES;
1451 +
1452 + static RRDSET *st_accept_queue = NULL;
1453 + static RRDDIM *rd_overflows = NULL,
1454 + *rd_drops = NULL;
1455 +
1456 + if(unlikely(!st_accept_queue)) {
1457 +
1458 + st_accept_queue = rrdset_create_localhost(
1459 + RRD_TYPE_NET_NETSTAT
1460 + , "tcp_accept_queue"
1461 + , NULL
1462 + , "tcp"
1463 + , NULL
1464 + , "TCP Accept Queue Issues"
1465 + , "packets/s"
1466 + , PLUGIN_PROC_NAME
1467 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1468 + , NETDATA_CHART_PRIO_IP_TCP_ACCEPT_QUEUE
1469 + , update_every
1470 + , RRDSET_TYPE_LINE
1471 + );
1472 +
1473 + rd_overflows = rrddim_add(st_accept_queue, "ListenOverflows", "overflows", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1474 + rd_drops = rrddim_add(st_accept_queue, "ListenDrops", "drops", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1475 + }
1476 + else
1477 + rrdset_next(st_accept_queue);
1478 +
1479 + rrddim_set_by_pointer(st_accept_queue, rd_overflows, tcpext_ListenOverflows);
1480 + rrddim_set_by_pointer(st_accept_queue, rd_drops, tcpext_ListenDrops);
1481 +
1482 + rrdset_done(st_accept_queue);
1483 + }
1484 +
1485 + // snmp Ip charts
1486 +
1487 + // --------------------------------------------------------------------
1488 +
1489 + if(do_ip_packets == CONFIG_BOOLEAN_YES || (do_ip_packets == CONFIG_BOOLEAN_AUTO &&
1490 + (snmp_root.ip_OutRequests ||
1491 + snmp_root.ip_InReceives ||
1492 + snmp_root.ip_ForwDatagrams ||
1493 + snmp_root.ip_InDelivers ||
1494 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1495 + do_ip_packets = CONFIG_BOOLEAN_YES;
1496 +
1497 + static RRDSET *st = NULL;
1498 + static RRDDIM *rd_InReceives = NULL,
1499 + *rd_OutRequests = NULL,
1500 + *rd_ForwDatagrams = NULL,
1501 + *rd_InDelivers = NULL;
1502 +
1503 + if(unlikely(!st)) {
1504 + st = rrdset_create_localhost(
1505 + RRD_TYPE_NET_SNMP
1506 + , "packets"
1507 + , NULL
1508 + , "packets"
1509 + , NULL
1510 + , "IPv4 Packets"
1511 + , "packets/s"
1512 + , PLUGIN_PROC_NAME
1513 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1514 + , NETDATA_CHART_PRIO_IPV4_PACKETS
1515 + , update_every
1516 + , RRDSET_TYPE_LINE
1517 + );
1518 +
1519 + rd_InReceives = rrddim_add(st, "InReceives", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1520 + rd_OutRequests = rrddim_add(st, "OutRequests", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1521 + rd_ForwDatagrams = rrddim_add(st, "ForwDatagrams", "forwarded", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1522 + rd_InDelivers = rrddim_add(st, "InDelivers", "delivered", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1523 + }
1524 + else rrdset_next(st);
1525 +
1526 + rrddim_set_by_pointer(st, rd_OutRequests, (collected_number)snmp_root.ip_OutRequests);
1527 + rrddim_set_by_pointer(st, rd_InReceives, (collected_number)snmp_root.ip_InReceives);
1528 + rrddim_set_by_pointer(st, rd_ForwDatagrams, (collected_number)snmp_root.ip_ForwDatagrams);
1529 + rrddim_set_by_pointer(st, rd_InDelivers, (collected_number)snmp_root.ip_InDelivers);
1530 + rrdset_done(st);
1531 + }
1532 +
1533 + // --------------------------------------------------------------------
1534 +
1535 + if(do_ip_fragsout == CONFIG_BOOLEAN_YES || (do_ip_fragsout == CONFIG_BOOLEAN_AUTO &&
1536 + (snmp_root.ip_FragOKs ||
1537 + snmp_root.ip_FragFails ||
1538 + snmp_root.ip_FragCreates ||
1539 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1540 + do_ip_fragsout = CONFIG_BOOLEAN_YES;
1541 +
1542 + static RRDSET *st = NULL;
1543 + static RRDDIM *rd_FragOKs = NULL,
1544 + *rd_FragFails = NULL,
1545 + *rd_FragCreates = NULL;
1546 +
1547 + if(unlikely(!st)) {
1548 + st = rrdset_create_localhost(
1549 + RRD_TYPE_NET_SNMP
1550 + , "fragsout"
1551 + , NULL
1552 + , "fragments"
1553 + , NULL
1554 + , "IPv4 Fragments Sent"
1555 + , "packets/s"
1556 + , PLUGIN_PROC_NAME
1557 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1558 + , NETDATA_CHART_PRIO_IPV4_FRAGMENTS
1559 + , update_every
1560 + , RRDSET_TYPE_LINE
1561 + );
1562 + rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
1563 +
1564 + rd_FragOKs = rrddim_add(st, "FragOKs", "ok", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1565 + rd_FragFails = rrddim_add(st, "FragFails", "failed", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1566 + rd_FragCreates = rrddim_add(st, "FragCreates", "created", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1567 + }
1568 + else rrdset_next(st);
1569 +
1570 + rrddim_set_by_pointer(st, rd_FragOKs, (collected_number)snmp_root.ip_FragOKs);
1571 + rrddim_set_by_pointer(st, rd_FragFails, (collected_number)snmp_root.ip_FragFails);
1572 + rrddim_set_by_pointer(st, rd_FragCreates, (collected_number)snmp_root.ip_FragCreates);
1573 + rrdset_done(st);
1574 + }
1575 +
1576 + // --------------------------------------------------------------------
1577 +
1578 + if(do_ip_fragsin == CONFIG_BOOLEAN_YES || (do_ip_fragsin == CONFIG_BOOLEAN_AUTO &&
1579 + (snmp_root.ip_ReasmOKs ||
1580 + snmp_root.ip_ReasmFails ||
1581 + snmp_root.ip_ReasmReqds ||
1582 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1583 + do_ip_fragsin = CONFIG_BOOLEAN_YES;
1584 +
1585 + static RRDSET *st = NULL;
1586 + static RRDDIM *rd_ReasmOKs = NULL,
1587 + *rd_ReasmFails = NULL,
1588 + *rd_ReasmReqds = NULL;
1589 +
1590 + if(unlikely(!st)) {
1591 + st = rrdset_create_localhost(
1592 + RRD_TYPE_NET_SNMP
1593 + , "fragsin"
1594 + , NULL
1595 + , "fragments"
1596 + , NULL
1597 + , "IPv4 Fragments Reassembly"
1598 + , "packets/s"
1599 + , PLUGIN_PROC_NAME
1600 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1601 + , NETDATA_CHART_PRIO_IPV4_FRAGMENTS + 1
1602 + , update_every
1603 + , RRDSET_TYPE_LINE
1604 + );
1605 + rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
1606 +
1607 + rd_ReasmOKs = rrddim_add(st, "ReasmOKs", "ok", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1608 + rd_ReasmFails = rrddim_add(st, "ReasmFails", "failed", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1609 + rd_ReasmReqds = rrddim_add(st, "ReasmReqds", "all", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1610 + }
1611 + else rrdset_next(st);
1612 +
1613 + rrddim_set_by_pointer(st, rd_ReasmOKs, (collected_number)snmp_root.ip_ReasmOKs);
1614 + rrddim_set_by_pointer(st, rd_ReasmFails, (collected_number)snmp_root.ip_ReasmFails);
1615 + rrddim_set_by_pointer(st, rd_ReasmReqds, (collected_number)snmp_root.ip_ReasmReqds);
1616 + rrdset_done(st);
1617 + }
1618 +
1619 + // --------------------------------------------------------------------
1620 +
1621 + if(do_ip_errors == CONFIG_BOOLEAN_YES || (do_ip_errors == CONFIG_BOOLEAN_AUTO &&
1622 + (snmp_root.ip_InDiscards ||
1623 + snmp_root.ip_OutDiscards ||
1624 + snmp_root.ip_InHdrErrors ||
1625 + snmp_root.ip_InAddrErrors ||
1626 + snmp_root.ip_InUnknownProtos ||
1627 + snmp_root.ip_OutNoRoutes ||
1628 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1629 + do_ip_errors = CONFIG_BOOLEAN_YES;
1630 +
1631 + static RRDSET *st = NULL;
1632 + static RRDDIM *rd_InDiscards = NULL,
1633 + *rd_OutDiscards = NULL,
1634 + *rd_InHdrErrors = NULL,
1635 + *rd_OutNoRoutes = NULL,
1636 + *rd_InAddrErrors = NULL,
1637 + *rd_InUnknownProtos = NULL;
1638 +
1639 + if(unlikely(!st)) {
1640 + st = rrdset_create_localhost(
1641 + RRD_TYPE_NET_SNMP
1642 + , "errors"
1643 + , NULL
1644 + , "errors"
1645 + , NULL
1646 + , "IPv4 Errors"
1647 + , "packets/s"
1648 + , PLUGIN_PROC_NAME
1649 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1650 + , NETDATA_CHART_PRIO_IPV4_ERRORS
1651 + , update_every
1652 + , RRDSET_TYPE_LINE
1653 + );
1654 + rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
1655 +
1656 + rd_InDiscards = rrddim_add(st, "InDiscards", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1657 + rd_OutDiscards = rrddim_add(st, "OutDiscards", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1658 +
1659 + rd_InHdrErrors = rrddim_add(st, "InHdrErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1660 + rd_OutNoRoutes = rrddim_add(st, "OutNoRoutes", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1661 +
1662 + rd_InAddrErrors = rrddim_add(st, "InAddrErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1663 + rd_InUnknownProtos = rrddim_add(st, "InUnknownProtos", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1664 + }
1665 + else rrdset_next(st);
1666 +
1667 + rrddim_set_by_pointer(st, rd_InDiscards, (collected_number)snmp_root.ip_InDiscards);
1668 + rrddim_set_by_pointer(st, rd_OutDiscards, (collected_number)snmp_root.ip_OutDiscards);
1669 + rrddim_set_by_pointer(st, rd_InHdrErrors, (collected_number)snmp_root.ip_InHdrErrors);
1670 + rrddim_set_by_pointer(st, rd_InAddrErrors, (collected_number)snmp_root.ip_InAddrErrors);
1671 + rrddim_set_by_pointer(st, rd_InUnknownProtos, (collected_number)snmp_root.ip_InUnknownProtos);
1672 + rrddim_set_by_pointer(st, rd_OutNoRoutes, (collected_number)snmp_root.ip_OutNoRoutes);
1673 + rrdset_done(st);
1674 + }
1675 +
1676 + // snmp Icmp charts
1677 +
1678 + // --------------------------------------------------------------------
1679 +
1680 + if(do_icmp_packets == CONFIG_BOOLEAN_YES || (do_icmp_packets == CONFIG_BOOLEAN_AUTO &&
1681 + (snmp_root.icmp_InMsgs ||
1682 + snmp_root.icmp_OutMsgs ||
1683 + snmp_root.icmp_InErrors ||
1684 + snmp_root.icmp_OutErrors ||
1685 + snmp_root.icmp_InCsumErrors ||
1686 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1687 + do_icmp_packets = CONFIG_BOOLEAN_YES;
1688 +
1689 + {
1690 + static RRDSET *st_packets = NULL;
1691 + static RRDDIM *rd_InMsgs = NULL,
1692 + *rd_OutMsgs = NULL;
1693 +
1694 + if(unlikely(!st_packets)) {
1695 + st_packets = rrdset_create_localhost(
1696 + RRD_TYPE_NET_SNMP
1697 + , "icmp"
1698 + , NULL
1699 + , "icmp"
1700 + , NULL
1701 + , "IPv4 ICMP Packets"
1702 + , "packets/s"
1703 + , PLUGIN_PROC_NAME
1704 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1705 + , NETDATA_CHART_PRIO_IPV4_ICMP
1706 + , update_every
1707 + , RRDSET_TYPE_LINE
1708 + );
1709 +
1710 + rd_InMsgs = rrddim_add(st_packets, "InMsgs", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1711 + rd_OutMsgs = rrddim_add(st_packets, "OutMsgs", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1712 }
1713 + else rrdset_next(st_packets);
1714
739 - // --------------------------------------------------------------------
740 -
741 - if(do_tcpext_syscookies == CONFIG_BOOLEAN_YES || (do_tcpext_syscookies == CONFIG_BOOLEAN_AUTO &&
742 - (tcpext_SyncookiesSent ||
743 - tcpext_SyncookiesRecv ||
744 - tcpext_SyncookiesFailed ||
745 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
746 - do_tcpext_syscookies = CONFIG_BOOLEAN_YES;
747 -
748 - static RRDSET *st_syncookies = NULL;
749 - static RRDDIM *rd_received = NULL, *rd_sent = NULL, *rd_failed = NULL;
750 -
751 - if(unlikely(!st_syncookies)) {
752 -
753 - st_syncookies = rrdset_create_localhost(
754 - RRD_TYPE_NET_NETSTAT
755 - , "tcpsyncookies"
756 - , NULL
757 - , "tcp"
758 - , NULL
759 - , "TCP SYN Cookies"
760 - , "packets/s"
761 - , PLUGIN_PROC_NAME
762 - , PLUGIN_PROC_MODULE_NETSTAT_NAME
763 - , NETDATA_CHART_PRIO_IP_TCP_SYNCOOKIES
764 - , update_every
765 - , RRDSET_TYPE_LINE
766 - );
767 -
768 - rd_received = rrddim_add(st_syncookies, "SyncookiesRecv", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
769 - rd_sent = rrddim_add(st_syncookies, "SyncookiesSent", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
770 - rd_failed = rrddim_add(st_syncookies, "SyncookiesFailed", "failed", -1, 1, RRD_ALGORITHM_INCREMENTAL);
771 - }
772 - else
773 - rrdset_next(st_syncookies);
774 -
775 - rrddim_set_by_pointer(st_syncookies, rd_received, tcpext_SyncookiesRecv);
776 - rrddim_set_by_pointer(st_syncookies, rd_sent, tcpext_SyncookiesSent);
777 - rrddim_set_by_pointer(st_syncookies, rd_failed, tcpext_SyncookiesFailed);
778 -
779 - rrdset_done(st_syncookies);
1715 + rrddim_set_by_pointer(st_packets, rd_InMsgs, (collected_number)snmp_root.icmp_InMsgs);
1716 + rrddim_set_by_pointer(st_packets, rd_OutMsgs, (collected_number)snmp_root.icmp_OutMsgs);
1717 +
1718 + rrdset_done(st_packets);
1719 + }
1720 +
1721 + {
1722 + static RRDSET *st_errors = NULL;
1723 + static RRDDIM *rd_InErrors = NULL,
1724 + *rd_OutErrors = NULL,
1725 + *rd_InCsumErrors = NULL;
1726 +
1727 + if(unlikely(!st_errors)) {
1728 + st_errors = rrdset_create_localhost(
1729 + RRD_TYPE_NET_SNMP
1730 + , "icmp_errors"
1731 + , NULL
1732 + , "icmp"
1733 + , NULL
1734 + , "IPv4 ICMP Errors"
1735 + , "packets/s"
1736 + , PLUGIN_PROC_NAME
1737 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1738 + , NETDATA_CHART_PRIO_IPV4_ICMP + 1
1739 + , update_every
1740 + , RRDSET_TYPE_LINE
1741 + );
1742 +
1743 + rd_InErrors = rrddim_add(st_errors, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1744 + rd_OutErrors = rrddim_add(st_errors, "OutErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1745 + rd_InCsumErrors = rrddim_add(st_errors, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1746 }
1747 + else rrdset_next(st_errors);
1748 +
1749 + rrddim_set_by_pointer(st_errors, rd_InErrors, (collected_number)snmp_root.icmp_InErrors);
1750 + rrddim_set_by_pointer(st_errors, rd_OutErrors, (collected_number)snmp_root.icmp_OutErrors);
1751 + rrddim_set_by_pointer(st_errors, rd_InCsumErrors, (collected_number)snmp_root.icmp_InCsumErrors);
1752 +
1753 + rrdset_done(st_errors);
1754 + }
1755 + }
1756 +
1757 + // snmp IcmpMsg charts
1758 +
1759 + // --------------------------------------------------------------------
1760 +
1761 + if(do_icmpmsg == CONFIG_BOOLEAN_YES || (do_icmpmsg == CONFIG_BOOLEAN_AUTO &&
1762 + (snmp_root.icmpmsg_InEchoReps ||
1763 + snmp_root.icmpmsg_OutEchoReps ||
1764 + snmp_root.icmpmsg_InDestUnreachs ||
1765 + snmp_root.icmpmsg_OutDestUnreachs ||
1766 + snmp_root.icmpmsg_InRedirects ||
1767 + snmp_root.icmpmsg_OutRedirects ||
1768 + snmp_root.icmpmsg_InEchos ||
1769 + snmp_root.icmpmsg_OutEchos ||
1770 + snmp_root.icmpmsg_InRouterAdvert ||
1771 + snmp_root.icmpmsg_OutRouterAdvert ||
1772 + snmp_root.icmpmsg_InRouterSelect ||
1773 + snmp_root.icmpmsg_OutRouterSelect ||
1774 + snmp_root.icmpmsg_InTimeExcds ||
1775 + snmp_root.icmpmsg_OutTimeExcds ||
1776 + snmp_root.icmpmsg_InParmProbs ||
1777 + snmp_root.icmpmsg_OutParmProbs ||
1778 + snmp_root.icmpmsg_InTimestamps ||
1779 + snmp_root.icmpmsg_OutTimestamps ||
1780 + snmp_root.icmpmsg_InTimestampReps ||
1781 + snmp_root.icmpmsg_OutTimestampReps ||
1782 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1783 + do_icmpmsg = CONFIG_BOOLEAN_YES;
1784 +
1785 + static RRDSET *st = NULL;
1786 + static RRDDIM *rd_InEchoReps = NULL,
1787 + *rd_OutEchoReps = NULL,
1788 + *rd_InDestUnreachs = NULL,
1789 + *rd_OutDestUnreachs = NULL,
1790 + *rd_InRedirects = NULL,
1791 + *rd_OutRedirects = NULL,
1792 + *rd_InEchos = NULL,
1793 + *rd_OutEchos = NULL,
1794 + *rd_InRouterAdvert = NULL,
1795 + *rd_OutRouterAdvert = NULL,
1796 + *rd_InRouterSelect = NULL,
1797 + *rd_OutRouterSelect = NULL,
1798 + *rd_InTimeExcds = NULL,
1799 + *rd_OutTimeExcds = NULL,
1800 + *rd_InParmProbs = NULL,
1801 + *rd_OutParmProbs = NULL,
1802 + *rd_InTimestamps = NULL,
1803 + *rd_OutTimestamps = NULL,
1804 + *rd_InTimestampReps = NULL,
1805 + *rd_OutTimestampReps = NULL;
1806 +
1807 + if(unlikely(!st)) {
1808 + st = rrdset_create_localhost(
1809 + RRD_TYPE_NET_SNMP
1810 + , "icmpmsg"
1811 + , NULL
1812 + , "icmp"
1813 + , NULL
1814 + , "IPv4 ICMP Messages"
1815 + , "packets/s"
1816 + , PLUGIN_PROC_NAME
1817 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1818 + , NETDATA_CHART_PRIO_IPV4_ICMP + 2
1819 + , update_every
1820 + , RRDSET_TYPE_LINE
1821 + );
1822 +
1823 + rd_InEchoReps = rrddim_add(st, "InType0", "InEchoReps", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1824 + rd_OutEchoReps = rrddim_add(st, "OutType0", "OutEchoReps", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1825 + rd_InDestUnreachs = rrddim_add(st, "InType3", "InDestUnreachs", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1826 + rd_OutDestUnreachs = rrddim_add(st, "OutType3", "OutDestUnreachs", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1827 + rd_InRedirects = rrddim_add(st, "InType5", "InRedirects", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1828 + rd_OutRedirects = rrddim_add(st, "OutType5", "OutRedirects", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1829 + rd_InEchos = rrddim_add(st, "InType8", "InEchos", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1830 + rd_OutEchos = rrddim_add(st, "OutType8", "OutEchos", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1831 + rd_InRouterAdvert = rrddim_add(st, "InType9", "InRouterAdvert", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1832 + rd_OutRouterAdvert = rrddim_add(st, "OutType9", "OutRouterAdvert", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1833 + rd_InRouterSelect = rrddim_add(st, "InType10", "InRouterSelect", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1834 + rd_OutRouterSelect = rrddim_add(st, "OutType10", "OutRouterSelect", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1835 + rd_InTimeExcds = rrddim_add(st, "InType11", "InTimeExcds", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1836 + rd_OutTimeExcds = rrddim_add(st, "OutType11", "OutTimeExcds", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1837 + rd_InParmProbs = rrddim_add(st, "InType12", "InParmProbs", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1838 + rd_OutParmProbs = rrddim_add(st, "OutType12", "OutParmProbs", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1839 + rd_InTimestamps = rrddim_add(st, "InType13", "InTimestamps", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1840 + rd_OutTimestamps = rrddim_add(st, "OutType13", "OutTimestamps", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1841 + rd_InTimestampReps = rrddim_add(st, "InType14", "InTimestampReps", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1842 + rd_OutTimestampReps = rrddim_add(st, "OutType14", "OutTimestampReps", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1843 + }
1844 + else rrdset_next(st);
1845 +
1846 + rrddim_set_by_pointer(st, rd_InEchoReps, (collected_number)snmp_root.icmpmsg_InEchoReps);
1847 + rrddim_set_by_pointer(st, rd_OutEchoReps, (collected_number)snmp_root.icmpmsg_OutEchoReps);
1848 + rrddim_set_by_pointer(st, rd_InDestUnreachs, (collected_number)snmp_root.icmpmsg_InDestUnreachs);
1849 + rrddim_set_by_pointer(st, rd_OutDestUnreachs, (collected_number)snmp_root.icmpmsg_OutDestUnreachs);
1850 + rrddim_set_by_pointer(st, rd_InRedirects, (collected_number)snmp_root.icmpmsg_InRedirects);
1851 + rrddim_set_by_pointer(st, rd_OutRedirects, (collected_number)snmp_root.icmpmsg_OutRedirects);
1852 + rrddim_set_by_pointer(st, rd_InEchos, (collected_number)snmp_root.icmpmsg_InEchos);
1853 + rrddim_set_by_pointer(st, rd_OutEchos, (collected_number)snmp_root.icmpmsg_OutEchos);
1854 + rrddim_set_by_pointer(st, rd_InRouterAdvert, (collected_number)snmp_root.icmpmsg_InRouterAdvert);
1855 + rrddim_set_by_pointer(st, rd_OutRouterAdvert, (collected_number)snmp_root.icmpmsg_OutRouterAdvert);
1856 + rrddim_set_by_pointer(st, rd_InRouterSelect, (collected_number)snmp_root.icmpmsg_InRouterSelect);
1857 + rrddim_set_by_pointer(st, rd_OutRouterSelect, (collected_number)snmp_root.icmpmsg_OutRouterSelect);
1858 + rrddim_set_by_pointer(st, rd_InTimeExcds, (collected_number)snmp_root.icmpmsg_InTimeExcds);
1859 + rrddim_set_by_pointer(st, rd_OutTimeExcds, (collected_number)snmp_root.icmpmsg_OutTimeExcds);
1860 + rrddim_set_by_pointer(st, rd_InParmProbs, (collected_number)snmp_root.icmpmsg_InParmProbs);
1861 + rrddim_set_by_pointer(st, rd_OutParmProbs, (collected_number)snmp_root.icmpmsg_OutParmProbs);
1862 + rrddim_set_by_pointer(st, rd_InTimestamps, (collected_number)snmp_root.icmpmsg_InTimestamps);
1863 + rrddim_set_by_pointer(st, rd_OutTimestamps, (collected_number)snmp_root.icmpmsg_OutTimestamps);
1864 + rrddim_set_by_pointer(st, rd_InTimestampReps, (collected_number)snmp_root.icmpmsg_InTimestampReps);
1865 + rrddim_set_by_pointer(st, rd_OutTimestampReps, (collected_number)snmp_root.icmpmsg_OutTimestampReps);
1866 +
1867 + rrdset_done(st);
1868 + }
1869 +
1870 + // snmp Tcp charts
1871 +
1872 + // --------------------------------------------------------------------
1873 +
1874 + // this is smart enough to update it, only when it is changed
1875 + rrdvar_custom_host_variable_set(localhost, tcp_max_connections_var, snmp_root.tcp_MaxConn);
1876 +
1877 + // --------------------------------------------------------------------
1878 +
1879 + // see http://net-snmp.sourceforge.net/docs/mibs/tcp.html
1880 + if(do_tcp_sockets == CONFIG_BOOLEAN_YES || (do_tcp_sockets == CONFIG_BOOLEAN_AUTO &&
1881 + (snmp_root.tcp_CurrEstab ||
1882 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1883 + do_tcp_sockets = CONFIG_BOOLEAN_YES;
1884 +
1885 + static RRDSET *st = NULL;
1886 + static RRDDIM *rd_CurrEstab = NULL;
1887 +
1888 + if(unlikely(!st)) {
1889 + st = rrdset_create_localhost(
1890 + RRD_TYPE_NET_SNMP
1891 + , "tcpsock"
1892 + , NULL
1893 + , "tcp"
1894 + , NULL
1895 + , "IPv4 TCP Connections"
1896 + , "active connections"
1897 + , PLUGIN_PROC_NAME
1898 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1899 + , NETDATA_CHART_PRIO_IPV4_TCP
1900 + , update_every
1901 + , RRDSET_TYPE_LINE
1902 + );
1903 +
1904 + rd_CurrEstab = rrddim_add(st, "CurrEstab", "connections", 1, 1, RRD_ALGORITHM_ABSOLUTE);
1905 + }
1906 + else rrdset_next(st);
1907 +
1908 + rrddim_set_by_pointer(st, rd_CurrEstab, (collected_number)snmp_root.tcp_CurrEstab);
1909 + rrdset_done(st);
1910 + }
1911 +
1912 + // --------------------------------------------------------------------
1913 +
1914 + if(do_tcp_packets == CONFIG_BOOLEAN_YES || (do_tcp_packets == CONFIG_BOOLEAN_AUTO &&
1915 + (snmp_root.tcp_InSegs ||
1916 + snmp_root.tcp_OutSegs ||
1917 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1918 + do_tcp_packets = CONFIG_BOOLEAN_YES;
1919 +
1920 + static RRDSET *st = NULL;
1921 + static RRDDIM *rd_InSegs = NULL,
1922 + *rd_OutSegs = NULL;
1923 +
1924 + if(unlikely(!st)) {
1925 + st = rrdset_create_localhost(
1926 + RRD_TYPE_NET_SNMP
1927 + , "tcppackets"
1928 + , NULL
1929 + , "tcp"
1930 + , NULL
1931 + , "IPv4 TCP Packets"
1932 + , "packets/s"
1933 + , PLUGIN_PROC_NAME
1934 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1935 + , NETDATA_CHART_PRIO_IPV4_TCP + 4
1936 + , update_every
1937 + , RRDSET_TYPE_LINE
1938 + );
1939 +
1940 + rd_InSegs = rrddim_add(st, "InSegs", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1941 + rd_OutSegs = rrddim_add(st, "OutSegs", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1942 + }
1943 + else rrdset_next(st);
1944 +
1945 + rrddim_set_by_pointer(st, rd_InSegs, (collected_number)snmp_root.tcp_InSegs);
1946 + rrddim_set_by_pointer(st, rd_OutSegs, (collected_number)snmp_root.tcp_OutSegs);
1947 + rrdset_done(st);
1948 + }
1949 +
1950 + // --------------------------------------------------------------------
1951 +
1952 + if(do_tcp_errors == CONFIG_BOOLEAN_YES || (do_tcp_errors == CONFIG_BOOLEAN_AUTO &&
1953 + (snmp_root.tcp_InErrs ||
1954 + snmp_root.tcp_InCsumErrors ||
1955 + snmp_root.tcp_RetransSegs ||
1956 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1957 + do_tcp_errors = CONFIG_BOOLEAN_YES;
1958 +
1959 + static RRDSET *st = NULL;
1960 + static RRDDIM *rd_InErrs = NULL,
1961 + *rd_InCsumErrors = NULL,
1962 + *rd_RetransSegs = NULL;
1963 +
1964 + if(unlikely(!st)) {
1965 + st = rrdset_create_localhost(
1966 + RRD_TYPE_NET_SNMP
1967 + , "tcperrors"
1968 + , NULL
1969 + , "tcp"
1970 + , NULL
1971 + , "IPv4 TCP Errors"
1972 + , "packets/s"
1973 + , PLUGIN_PROC_NAME
1974 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
1975 + , NETDATA_CHART_PRIO_IPV4_TCP + 20
1976 + , update_every
1977 + , RRDSET_TYPE_LINE
1978 + );
1979 + rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
1980 +
1981 + rd_InErrs = rrddim_add(st, "InErrs", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1982 + rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1983 + rd_RetransSegs = rrddim_add(st, "RetransSegs", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1984 + }
1985 + else rrdset_next(st);
1986 +
1987 + rrddim_set_by_pointer(st, rd_InErrs, (collected_number)snmp_root.tcp_InErrs);
1988 + rrddim_set_by_pointer(st, rd_InCsumErrors, (collected_number)snmp_root.tcp_InCsumErrors);
1989 + rrddim_set_by_pointer(st, rd_RetransSegs, (collected_number)snmp_root.tcp_RetransSegs);
1990 + rrdset_done(st);
1991 + }
1992 +
1993 + // --------------------------------------------------------------------
1994 +
1995 + if(do_tcp_opens == CONFIG_BOOLEAN_YES || (do_tcp_opens == CONFIG_BOOLEAN_AUTO &&
1996 + (snmp_root.tcp_ActiveOpens ||
1997 + snmp_root.tcp_PassiveOpens ||
1998 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1999 + do_tcp_opens = CONFIG_BOOLEAN_YES;
2000 +
2001 + static RRDSET *st = NULL;
2002 + static RRDDIM *rd_ActiveOpens = NULL,
2003 + *rd_PassiveOpens = NULL;
2004 +
2005 + if(unlikely(!st)) {
2006 + st = rrdset_create_localhost(
2007 + RRD_TYPE_NET_SNMP
2008 + , "tcpopens"
2009 + , NULL
2010 + , "tcp"
2011 + , NULL
2012 + , "IPv4 TCP Opens"
2013 + , "connections/s"
2014 + , PLUGIN_PROC_NAME
2015 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2016 + , NETDATA_CHART_PRIO_IPV4_TCP + 5
2017 + , update_every
2018 + , RRDSET_TYPE_LINE
2019 + );
2020 + rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
2021 +
2022 + rd_ActiveOpens = rrddim_add(st, "ActiveOpens", "active", 1, 1, RRD_ALGORITHM_INCREMENTAL);
2023 + rd_PassiveOpens = rrddim_add(st, "PassiveOpens", "passive", 1, 1, RRD_ALGORITHM_INCREMENTAL);
2024 + }
2025 + else rrdset_next(st);
2026 +
2027 + rrddim_set_by_pointer(st, rd_ActiveOpens, (collected_number)snmp_root.tcp_ActiveOpens);
2028 + rrddim_set_by_pointer(st, rd_PassiveOpens, (collected_number)snmp_root.tcp_PassiveOpens);
2029 + rrdset_done(st);
2030 + }
2031 +
2032 + // --------------------------------------------------------------------
2033 +
2034 + if(do_tcp_handshake == CONFIG_BOOLEAN_YES || (do_tcp_handshake == CONFIG_BOOLEAN_AUTO &&
2035 + (snmp_root.tcp_EstabResets ||
2036 + snmp_root.tcp_OutRsts ||
2037 + snmp_root.tcp_AttemptFails ||
2038 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2039 + do_tcp_handshake = CONFIG_BOOLEAN_YES;
2040 +
2041 + static RRDSET *st = NULL;
2042 + static RRDDIM *rd_EstabResets = NULL,
2043 + *rd_OutRsts = NULL,
2044 + *rd_AttemptFails = NULL,
2045 + *rd_TCPSynRetrans = NULL;
2046 +
2047 + if(unlikely(!st)) {
2048 + st = rrdset_create_localhost(
2049 + RRD_TYPE_NET_SNMP
2050 + , "tcphandshake"
2051 + , NULL
2052 + , "tcp"
2053 + , NULL
2054 + , "IPv4 TCP Handshake Issues"
2055 + , "events/s"
2056 + , PLUGIN_PROC_NAME
2057 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2058 + , NETDATA_CHART_PRIO_IPV4_TCP + 30
2059 + , update_every
2060 + , RRDSET_TYPE_LINE
2061 + );
2062 + rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
2063 +
2064 + rd_EstabResets = rrddim_add(st, "EstabResets", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2065 + rd_OutRsts = rrddim_add(st, "OutRsts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2066 + rd_AttemptFails = rrddim_add(st, "AttemptFails", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2067 + rd_TCPSynRetrans = rrddim_add(st, "TCPSynRetrans", "SynRetrans", 1, 1, RRD_ALGORITHM_INCREMENTAL);
2068 + }
2069 + else rrdset_next(st);
2070 +
2071 + rrddim_set_by_pointer(st, rd_EstabResets, (collected_number)snmp_root.tcp_EstabResets);
2072 + rrddim_set_by_pointer(st, rd_OutRsts, (collected_number)snmp_root.tcp_OutRsts);
2073 + rrddim_set_by_pointer(st, rd_AttemptFails, (collected_number)snmp_root.tcp_AttemptFails);
2074 + rrddim_set_by_pointer(st, rd_TCPSynRetrans, tcpext_TCPSynRetrans);
2075 + rrdset_done(st);
2076 + }
2077 +
2078 + // snmp Udp charts
2079 +
2080 + // --------------------------------------------------------------------
2081 +
2082 + // see http://net-snmp.sourceforge.net/docs/mibs/udp.html
2083 + if(do_udp_packets == CONFIG_BOOLEAN_YES || (do_udp_packets == CONFIG_BOOLEAN_AUTO &&
2084 + (snmp_root.udp_InDatagrams ||
2085 + snmp_root.udp_OutDatagrams ||
2086 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2087 + do_udp_packets = CONFIG_BOOLEAN_YES;
2088 +
2089 + static RRDSET *st = NULL;
2090 + static RRDDIM *rd_InDatagrams = NULL,
2091 + *rd_OutDatagrams = NULL;
2092 +
2093 + if(unlikely(!st)) {
2094 + st = rrdset_create_localhost(
2095 + RRD_TYPE_NET_SNMP
2096 + , "udppackets"
2097 + , NULL
2098 + , "udp"
2099 + , NULL
2100 + , "IPv4 UDP Packets"
2101 + , "packets/s"
2102 + , PLUGIN_PROC_NAME
2103 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2104 + , NETDATA_CHART_PRIO_IPV4_UDP
2105 + , update_every
2106 + , RRDSET_TYPE_LINE
2107 + );
2108 +
2109 + rd_InDatagrams = rrddim_add(st, "InDatagrams", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
2110 + rd_OutDatagrams = rrddim_add(st, "OutDatagrams", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
2111 + }
2112 + else rrdset_next(st);
2113 +
2114 + rrddim_set_by_pointer(st, rd_InDatagrams, (collected_number)snmp_root.udp_InDatagrams);
2115 + rrddim_set_by_pointer(st, rd_OutDatagrams, (collected_number)snmp_root.udp_OutDatagrams);
2116 + rrdset_done(st);
2117 + }
2118 +
2119 + // --------------------------------------------------------------------
2120 +
2121 + if(do_udp_errors == CONFIG_BOOLEAN_YES || (do_udp_errors == CONFIG_BOOLEAN_AUTO &&
2122 + (snmp_root.udp_InErrors ||
2123 + snmp_root.udp_NoPorts ||
2124 + snmp_root.udp_RcvbufErrors ||
2125 + snmp_root.udp_SndbufErrors ||
2126 + snmp_root.udp_InCsumErrors ||
2127 + snmp_root.udp_IgnoredMulti ||
2128 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2129 + do_udp_errors = CONFIG_BOOLEAN_YES;
2130 +
2131 + static RRDSET *st = NULL;
2132 + static RRDDIM *rd_RcvbufErrors = NULL,
2133 + *rd_SndbufErrors = NULL,
2134 + *rd_InErrors = NULL,
2135 + *rd_NoPorts = NULL,
2136 + *rd_InCsumErrors = NULL,
2137 + *rd_IgnoredMulti = NULL;
2138 +
2139 + if(unlikely(!st)) {
2140 + st = rrdset_create_localhost(
2141 + RRD_TYPE_NET_SNMP
2142 + , "udperrors"
2143 + , NULL
2144 + , "udp"
2145 + , NULL
2146 + , "IPv4 UDP Errors"
2147 + , "events/s"
2148 + , PLUGIN_PROC_NAME
2149 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2150 + , NETDATA_CHART_PRIO_IPV4_UDP + 10
2151 + , update_every
2152 + , RRDSET_TYPE_LINE
2153 + );
2154 + rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
2155 +
2156 + rd_RcvbufErrors = rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2157 + rd_SndbufErrors = rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2158 + rd_InErrors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2159 + rd_NoPorts = rrddim_add(st, "NoPorts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2160 + rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2161 + rd_IgnoredMulti = rrddim_add(st, "IgnoredMulti", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2162 + }
2163 + else rrdset_next(st);
2164 +
2165 + rrddim_set_by_pointer(st, rd_InErrors, (collected_number)snmp_root.udp_InErrors);
2166 + rrddim_set_by_pointer(st, rd_NoPorts, (collected_number)snmp_root.udp_NoPorts);
2167 + rrddim_set_by_pointer(st, rd_RcvbufErrors, (collected_number)snmp_root.udp_RcvbufErrors);
2168 + rrddim_set_by_pointer(st, rd_SndbufErrors, (collected_number)snmp_root.udp_SndbufErrors);
2169 + rrddim_set_by_pointer(st, rd_InCsumErrors, (collected_number)snmp_root.udp_InCsumErrors);
2170 + rrddim_set_by_pointer(st, rd_IgnoredMulti, (collected_number)snmp_root.udp_IgnoredMulti);
2171 + rrdset_done(st);
2172 + }
2173
782 - // --------------------------------------------------------------------
783 -
784 - if(do_tcpext_syn_queue == CONFIG_BOOLEAN_YES || (do_tcpext_syn_queue == CONFIG_BOOLEAN_AUTO &&
785 - (tcpext_TCPReqQFullDrop ||
786 - tcpext_TCPReqQFullDoCookies ||
787 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
788 - do_tcpext_syn_queue = CONFIG_BOOLEAN_YES;
789 -
790 - static RRDSET *st_syn_queue = NULL;
791 - static RRDDIM
792 - *rd_TCPReqQFullDrop = NULL,
793 - *rd_TCPReqQFullDoCookies = NULL;
794 -
795 - if(unlikely(!st_syn_queue)) {
796 -
797 - st_syn_queue = rrdset_create_localhost(
798 - RRD_TYPE_NET_NETSTAT
799 - , "tcp_syn_queue"
800 - , NULL
801 - , "tcp"
802 - , NULL
803 - , "TCP SYN Queue Issues"
804 - , "packets/s"
805 - , PLUGIN_PROC_NAME
806 - , PLUGIN_PROC_MODULE_NETSTAT_NAME
807 - , NETDATA_CHART_PRIO_IP_TCP_SYN_QUEUE
808 - , update_every
809 - , RRDSET_TYPE_LINE
810 - );
811 -
812 - rd_TCPReqQFullDrop = rrddim_add(st_syn_queue, "TCPReqQFullDrop", "drops", 1, 1, RRD_ALGORITHM_INCREMENTAL);
813 - rd_TCPReqQFullDoCookies = rrddim_add(st_syn_queue, "TCPReqQFullDoCookies", "cookies", 1, 1, RRD_ALGORITHM_INCREMENTAL);
814 - }
815 - else
816 - rrdset_next(st_syn_queue);
817 -
818 - rrddim_set_by_pointer(st_syn_queue, rd_TCPReqQFullDrop, tcpext_TCPReqQFullDrop);
819 - rrddim_set_by_pointer(st_syn_queue, rd_TCPReqQFullDoCookies, tcpext_TCPReqQFullDoCookies);
820 -
821 - rrdset_done(st_syn_queue);
2174 + // snmp UdpLite charts
2175 +
2176 + // --------------------------------------------------------------------
2177 +
2178 + if(do_udplite_packets == CONFIG_BOOLEAN_YES || (do_udplite_packets == CONFIG_BOOLEAN_AUTO &&
2179 + (snmp_root.udplite_InDatagrams ||
2180 + snmp_root.udplite_OutDatagrams ||
2181 + snmp_root.udplite_NoPorts ||
2182 + snmp_root.udplite_InErrors ||
2183 + snmp_root.udplite_InCsumErrors ||
2184 + snmp_root.udplite_RcvbufErrors ||
2185 + snmp_root.udplite_SndbufErrors ||
2186 + snmp_root.udplite_IgnoredMulti ||
2187 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2188 + do_udplite_packets = CONFIG_BOOLEAN_YES;
2189 +
2190 + {
2191 + static RRDSET *st = NULL;
2192 + static RRDDIM *rd_InDatagrams = NULL,
2193 + *rd_OutDatagrams = NULL;
2194 +
2195 + if(unlikely(!st)) {
2196 + st = rrdset_create_localhost(
2197 + RRD_TYPE_NET_SNMP
2198 + , "udplite"
2199 + , NULL
2200 + , "udplite"
2201 + , NULL
2202 + , "IPv4 UDPLite Packets"
2203 + , "packets/s"
2204 + , PLUGIN_PROC_NAME
2205 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2206 + , NETDATA_CHART_PRIO_IPV4_UDPLITE
2207 + , update_every
2208 + , RRDSET_TYPE_LINE
2209 + );
2210 +
2211 + rd_InDatagrams = rrddim_add(st, "InDatagrams", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
2212 + rd_OutDatagrams = rrddim_add(st, "OutDatagrams", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
2213 }
2214 + else rrdset_next(st);
2215
824 - // --------------------------------------------------------------------
825 -
826 - if(do_tcpext_accept_queue == CONFIG_BOOLEAN_YES || (do_tcpext_accept_queue == CONFIG_BOOLEAN_AUTO &&
827 - (tcpext_ListenOverflows ||
828 - tcpext_ListenDrops ||
829 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
830 - do_tcpext_accept_queue = CONFIG_BOOLEAN_YES;
831 -
832 - static RRDSET *st_accept_queue = NULL;
833 - static RRDDIM *rd_overflows = NULL,
834 - *rd_drops = NULL;
835 -
836 - if(unlikely(!st_accept_queue)) {
837 -
838 - st_accept_queue = rrdset_create_localhost(
839 - RRD_TYPE_NET_NETSTAT
840 - , "tcp_accept_queue"
841 - , NULL
842 - , "tcp"
843 - , NULL
844 - , "TCP Accept Queue Issues"
845 - , "packets/s"
846 - , PLUGIN_PROC_NAME
847 - , PLUGIN_PROC_MODULE_NETSTAT_NAME
848 - , NETDATA_CHART_PRIO_IP_TCP_ACCEPT_QUEUE
849 - , update_every
850 - , RRDSET_TYPE_LINE
851 - );
852 -
853 - rd_overflows = rrddim_add(st_accept_queue, "ListenOverflows", "overflows", 1, 1, RRD_ALGORITHM_INCREMENTAL);
854 - rd_drops = rrddim_add(st_accept_queue, "ListenDrops", "drops", 1, 1, RRD_ALGORITHM_INCREMENTAL);
855 - }
856 - else
857 - rrdset_next(st_accept_queue);
858 -
859 - rrddim_set_by_pointer(st_accept_queue, rd_overflows, tcpext_ListenOverflows);
860 - rrddim_set_by_pointer(st_accept_queue, rd_drops, tcpext_ListenDrops);
861 -
862 - rrdset_done(st_accept_queue);
2216 + rrddim_set_by_pointer(st, rd_InDatagrams, (collected_number)snmp_root.udplite_InDatagrams);
2217 + rrddim_set_by_pointer(st, rd_OutDatagrams, (collected_number)snmp_root.udplite_OutDatagrams);
2218 + rrdset_done(st);
2219 + }
2220 +
2221 + {
2222 + static RRDSET *st = NULL;
2223 + static RRDDIM *rd_RcvbufErrors = NULL,
2224 + *rd_SndbufErrors = NULL,
2225 + *rd_InErrors = NULL,
2226 + *rd_NoPorts = NULL,
2227 + *rd_InCsumErrors = NULL,
2228 + *rd_IgnoredMulti = NULL;
2229 +
2230 + if(unlikely(!st)) {
2231 + st = rrdset_create_localhost(
2232 + RRD_TYPE_NET_SNMP
2233 + , "udplite_errors"
2234 + , NULL
2235 + , "udplite"
2236 + , NULL
2237 + , "IPv4 UDPLite Errors"
2238 + , "packets/s"
2239 + , PLUGIN_PROC_NAME
2240 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2241 + , NETDATA_CHART_PRIO_IPV4_UDPLITE + 10
2242 + , update_every
2243 + , RRDSET_TYPE_LINE);
2244 +
2245 + rd_RcvbufErrors = rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2246 + rd_SndbufErrors = rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2247 + rd_InErrors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2248 + rd_NoPorts = rrddim_add(st, "NoPorts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2249 + rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2250 + rd_IgnoredMulti = rrddim_add(st, "IgnoredMulti", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2251 }
2252 + else rrdset_next(st);
2253 +
2254 + rrddim_set_by_pointer(st, rd_NoPorts, (collected_number)snmp_root.udplite_NoPorts);
2255 + rrddim_set_by_pointer(st, rd_InErrors, (collected_number)snmp_root.udplite_InErrors);
2256 + rrddim_set_by_pointer(st, rd_InCsumErrors, (collected_number)snmp_root.udplite_InCsumErrors);
2257 + rrddim_set_by_pointer(st, rd_RcvbufErrors, (collected_number)snmp_root.udplite_RcvbufErrors);
2258 + rrddim_set_by_pointer(st, rd_SndbufErrors, (collected_number)snmp_root.udplite_SndbufErrors);
2259 + rrddim_set_by_pointer(st, rd_IgnoredMulti, (collected_number)snmp_root.udplite_IgnoredMulti);
2260 + rrdset_done(st);
2261 + }
2262 + }
2263 +
2264 + // snmp6 charts
2265 +
2266 + // --------------------------------------------------------------------
2267 +
2268 + if(do_ip6_bandwidth == CONFIG_BOOLEAN_YES || (do_ip6_bandwidth == CONFIG_BOOLEAN_AUTO &&
2269 + (Ip6InOctets ||
2270 + Ip6OutOctets ||
2271 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2272 + do_ip6_bandwidth = CONFIG_BOOLEAN_YES;
2273 + static RRDSET *st = NULL;
2274 + static RRDDIM *rd_received = NULL,
2275 + *rd_sent = NULL;
2276 +
2277 + if(unlikely(!st)) {
2278 + st = rrdset_create_localhost(
2279 + "system"
2280 + , "ipv6"
2281 + , NULL
2282 + , "network"
2283 + , NULL
2284 + , "IPv6 Bandwidth"
2285 + , "kilobits/s"
2286 + , PLUGIN_PROC_NAME
2287 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2288 + , NETDATA_CHART_PRIO_SYSTEM_IPV6
2289 + , update_every
2290 + , RRDSET_TYPE_AREA
2291 + );
2292 +
2293 + rd_received = rrddim_add(st, "InOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
2294 + rd_sent = rrddim_add(st, "OutOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
2295 + }
2296 + else rrdset_next(st);
2297 +
2298 + rrddim_set_by_pointer(st, rd_received, Ip6InOctets);
2299 + rrddim_set_by_pointer(st, rd_sent, Ip6OutOctets);
2300 + rrdset_done(st);
2301 + }
2302 +
2303 + // --------------------------------------------------------------------
2304 +
2305 + if(do_ip6_packets == CONFIG_BOOLEAN_YES || (do_ip6_packets == CONFIG_BOOLEAN_AUTO &&
2306 + (Ip6InReceives ||
2307 + Ip6OutRequests ||
2308 + Ip6InDelivers ||
2309 + Ip6OutForwDatagrams ||
2310 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2311 + do_ip6_packets = CONFIG_BOOLEAN_YES;
2312 + static RRDSET *st = NULL;
2313 + static RRDDIM *rd_received = NULL,
2314 + *rd_sent = NULL,
2315 + *rd_forwarded = NULL,
2316 + *rd_delivers = NULL;
2317 +
2318 + if(unlikely(!st)) {
2319 + st = rrdset_create_localhost(
2320 + RRD_TYPE_NET_SNMP6
2321 + , "packets"
2322 + , NULL
2323 + , "packets"
2324 + , NULL
2325 + , "IPv6 Packets"
2326 + , "packets/s"
2327 + , PLUGIN_PROC_NAME
2328 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2329 + , NETDATA_CHART_PRIO_IPV6_PACKETS
2330 + , update_every
2331 + , RRDSET_TYPE_LINE
2332 + );
2333 +
2334 + rd_received = rrddim_add(st, "InReceives", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
2335 + rd_sent = rrddim_add(st, "OutRequests", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
2336 + rd_forwarded = rrddim_add(st, "OutForwDatagrams", "forwarded", -1, 1, RRD_ALGORITHM_INCREMENTAL);
2337 + rd_delivers = rrddim_add(st, "InDelivers", "delivers", 1, 1, RRD_ALGORITHM_INCREMENTAL);
2338 + }
2339 + else rrdset_next(st);
2340 +
2341 + rrddim_set_by_pointer(st, rd_received, Ip6InReceives);
2342 + rrddim_set_by_pointer(st, rd_sent, Ip6OutRequests);
2343 + rrddim_set_by_pointer(st, rd_forwarded, Ip6OutForwDatagrams);
2344 + rrddim_set_by_pointer(st, rd_delivers, Ip6InDelivers);
2345 + rrdset_done(st);
2346 + }
2347 +
2348 + // --------------------------------------------------------------------
2349 +
2350 + if(do_ip6_fragsout == CONFIG_BOOLEAN_YES || (do_ip6_fragsout == CONFIG_BOOLEAN_AUTO &&
2351 + (Ip6FragOKs ||
2352 + Ip6FragFails ||
2353 + Ip6FragCreates ||
2354 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2355 + do_ip6_fragsout = CONFIG_BOOLEAN_YES;
2356 + static RRDSET *st = NULL;
2357 + static RRDDIM *rd_ok = NULL,
2358 + *rd_failed = NULL,
2359 + *rd_all = NULL;
2360 +
2361 + if(unlikely(!st)) {
2362 + st = rrdset_create_localhost(
2363 + RRD_TYPE_NET_SNMP6
2364 + , "fragsout"
2365 + , NULL
2366 + , "fragments6"
2367 + , NULL
2368 + , "IPv6 Fragments Sent"
2369 + , "packets/s"
2370 + , PLUGIN_PROC_NAME
2371 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2372 + , NETDATA_CHART_PRIO_IPV6_FRAGSOUT
2373 + , update_every
2374 + , RRDSET_TYPE_LINE
2375 + );
2376 + rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
2377 +
2378 + rd_ok = rrddim_add(st, "FragOKs", "ok", 1, 1, RRD_ALGORITHM_INCREMENTAL);
2379 + rd_failed = rrddim_add(st, "FragFails", "failed", -1, 1, RRD_ALGORITHM_INCREMENTAL);
2380 + rd_all = rrddim_add(st, "FragCreates", "all", 1, 1, RRD_ALGORITHM_INCREMENTAL);
2381 + }
2382 + else rrdset_next(st);
2383 +
2384 + rrddim_set_by_pointer(st, rd_ok, Ip6FragOKs);
2385 + rrddim_set_by_pointer(st, rd_failed, Ip6FragFails);
2386 + rrddim_set_by_pointer(st, rd_all, Ip6FragCreates);
2387 + rrdset_done(st);
2388 + }
2389 +
2390 + // --------------------------------------------------------------------
2391 +
2392 + if(do_ip6_fragsin == CONFIG_BOOLEAN_YES || (do_ip6_fragsin == CONFIG_BOOLEAN_AUTO &&
2393 + (Ip6ReasmOKs ||
2394 + Ip6ReasmFails ||
2395 + Ip6ReasmTimeout ||
2396 + Ip6ReasmReqds ||
2397 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2398 + do_ip6_fragsin = CONFIG_BOOLEAN_YES;
2399 +
2400 + static RRDSET *st = NULL;
2401 + static RRDDIM *rd_ok = NULL,
2402 + *rd_failed = NULL,
2403 + *rd_timeout = NULL,
2404 + *rd_all = NULL;
2405 +
2406 + if(unlikely(!st)) {
2407 + st = rrdset_create_localhost(
2408 + RRD_TYPE_NET_SNMP6
2409 + , "fragsin"
2410 + , NULL
2411 + , "fragments6"
2412 + , NULL
2413 + , "IPv6 Fragments Reassembly"
2414 + , "packets/s"
2415 + , PLUGIN_PROC_NAME
2416 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2417 + , NETDATA_CHART_PRIO_IPV6_FRAGSIN
2418 + , update_every
2419 + , RRDSET_TYPE_LINE);
2420 + rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
2421 +
2422 + rd_ok = rrddim_add(st, "ReasmOKs", "ok", 1, 1, RRD_ALGORITHM_INCREMENTAL);
2423 + rd_failed = rrddim_add(st, "ReasmFails", "failed", -1, 1, RRD_ALGORITHM_INCREMENTAL);
2424 + rd_timeout = rrddim_add(st, "ReasmTimeout", "timeout", -1, 1, RRD_ALGORITHM_INCREMENTAL);
2425 + rd_all = rrddim_add(st, "ReasmReqds", "all", 1, 1, RRD_ALGORITHM_INCREMENTAL);
2426 + }
2427 + else rrdset_next(st);
2428 +
2429 + rrddim_set_by_pointer(st, rd_ok, Ip6ReasmOKs);
2430 + rrddim_set_by_pointer(st, rd_failed, Ip6ReasmFails);
2431 + rrddim_set_by_pointer(st, rd_timeout, Ip6ReasmTimeout);
2432 + rrddim_set_by_pointer(st, rd_all, Ip6ReasmReqds);
2433 + rrdset_done(st);
2434 + }
2435 +
2436 + // --------------------------------------------------------------------
2437
2438 + if(do_ip6_errors == CONFIG_BOOLEAN_YES || (do_ip6_errors == CONFIG_BOOLEAN_AUTO &&
2439 + (Ip6InDiscards ||
2440 + Ip6OutDiscards ||
2441 + Ip6InHdrErrors ||
2442 + Ip6InAddrErrors ||
2443 + Ip6InUnknownProtos ||
2444 + Ip6InTooBigErrors ||
2445 + Ip6InTruncatedPkts ||
2446 + Ip6InNoRoutes ||
2447 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2448 + do_ip6_errors = CONFIG_BOOLEAN_YES;
2449 + static RRDSET *st = NULL;
2450 + static RRDDIM *rd_InDiscards = NULL,
2451 + *rd_OutDiscards = NULL,
2452 + *rd_InHdrErrors = NULL,
2453 + *rd_InAddrErrors = NULL,
2454 + *rd_InUnknownProtos = NULL,
2455 + *rd_InTooBigErrors = NULL,
2456 + *rd_InTruncatedPkts = NULL,
2457 + *rd_InNoRoutes = NULL,
2458 + *rd_OutNoRoutes = NULL;
2459 +
2460 + if(unlikely(!st)) {
2461 + st = rrdset_create_localhost(
2462 + RRD_TYPE_NET_SNMP6
2463 + , "errors"
2464 + , NULL
2465 + , "errors"
2466 + , NULL
2467 + , "IPv6 Errors"
2468 + , "packets/s"
2469 + , PLUGIN_PROC_NAME
2470 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2471 + , NETDATA_CHART_PRIO_IPV6_ERRORS
2472 + , update_every
2473 + , RRDSET_TYPE_LINE
2474 + );
2475 + rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
2476 +
2477 + rd_InDiscards = rrddim_add(st, "InDiscards", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2478 + rd_OutDiscards = rrddim_add(st, "OutDiscards", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2479 + rd_InHdrErrors = rrddim_add(st, "InHdrErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2480 + rd_InAddrErrors = rrddim_add(st, "InAddrErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2481 + rd_InUnknownProtos = rrddim_add(st, "InUnknownProtos", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2482 + rd_InTooBigErrors = rrddim_add(st, "InTooBigErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2483 + rd_InTruncatedPkts = rrddim_add(st, "InTruncatedPkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2484 + rd_InNoRoutes = rrddim_add(st, "InNoRoutes", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2485 + rd_OutNoRoutes = rrddim_add(st, "OutNoRoutes", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2486 }
2487 + else rrdset_next(st);
2488 +
2489 + rrddim_set_by_pointer(st, rd_InDiscards, Ip6InDiscards);
2490 + rrddim_set_by_pointer(st, rd_OutDiscards, Ip6OutDiscards);
2491 + rrddim_set_by_pointer(st, rd_InHdrErrors, Ip6InHdrErrors);
2492 + rrddim_set_by_pointer(st, rd_InAddrErrors, Ip6InAddrErrors);
2493 + rrddim_set_by_pointer(st, rd_InUnknownProtos, Ip6InUnknownProtos);
2494 + rrddim_set_by_pointer(st, rd_InTooBigErrors, Ip6InTooBigErrors);
2495 + rrddim_set_by_pointer(st, rd_InTruncatedPkts, Ip6InTruncatedPkts);
2496 + rrddim_set_by_pointer(st, rd_InNoRoutes, Ip6InNoRoutes);
2497 + rrddim_set_by_pointer(st, rd_OutNoRoutes, Ip6OutNoRoutes);
2498 + rrdset_done(st);
2499 + }
2500 +
2501 + // --------------------------------------------------------------------
2502 +
2503 + if(do_ip6_udp_packets == CONFIG_BOOLEAN_YES || (do_ip6_udp_packets == CONFIG_BOOLEAN_AUTO &&
2504 + (Udp6InDatagrams ||
2505 + Udp6OutDatagrams ||
2506 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2507 + do_udp_packets = CONFIG_BOOLEAN_YES;
2508 + static RRDSET *st = NULL;
2509 + static RRDDIM *rd_received = NULL,
2510 + *rd_sent = NULL;
2511 +
2512 + if(unlikely(!st)) {
2513 + st = rrdset_create_localhost(
2514 + RRD_TYPE_NET_SNMP6
2515 + , "udppackets"
2516 + , NULL
2517 + , "udp6"
2518 + , NULL
2519 + , "IPv6 UDP Packets"
2520 + , "packets/s"
2521 + , PLUGIN_PROC_NAME
2522 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2523 + , NETDATA_CHART_PRIO_IPV6_UDP_PACKETS
2524 + , update_every
2525 + , RRDSET_TYPE_LINE
2526 + );
2527 +
2528 + rd_received = rrddim_add(st, "InDatagrams", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
2529 + rd_sent = rrddim_add(st, "OutDatagrams", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
2530 + }
2531 + else rrdset_next(st);
2532 +
2533 + rrddim_set_by_pointer(st, rd_received, Udp6InDatagrams);
2534 + rrddim_set_by_pointer(st, rd_sent, Udp6OutDatagrams);
2535 + rrdset_done(st);
2536 + }
2537 +
2538 + // --------------------------------------------------------------------
2539 +
2540 + if(do_ip6_udp_errors == CONFIG_BOOLEAN_YES || (do_ip6_udp_errors == CONFIG_BOOLEAN_AUTO &&
2541 + (Udp6InErrors ||
2542 + Udp6NoPorts ||
2543 + Udp6RcvbufErrors ||
2544 + Udp6SndbufErrors ||
2545 + Udp6InCsumErrors ||
2546 + Udp6IgnoredMulti ||
2547 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2548 + do_ip6_udp_errors = CONFIG_BOOLEAN_YES;
2549 + static RRDSET *st = NULL;
2550 + static RRDDIM *rd_RcvbufErrors = NULL,
2551 + *rd_SndbufErrors = NULL,
2552 + *rd_InErrors = NULL,
2553 + *rd_NoPorts = NULL,
2554 + *rd_InCsumErrors = NULL,
2555 + *rd_IgnoredMulti = NULL;
2556 +
2557 + if(unlikely(!st)) {
2558 + st = rrdset_create_localhost(
2559 + RRD_TYPE_NET_SNMP6
2560 + , "udperrors"
2561 + , NULL
2562 + , "udp6"
2563 + , NULL
2564 + , "IPv6 UDP Errors"
2565 + , "events/s"
2566 + , PLUGIN_PROC_NAME
2567 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2568 + , NETDATA_CHART_PRIO_IPV6_UDP_ERRORS
2569 + , update_every
2570 + , RRDSET_TYPE_LINE
2571 + );
2572 + rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
2573 +
2574 + rd_RcvbufErrors = rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2575 + rd_SndbufErrors = rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2576 + rd_InErrors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2577 + rd_NoPorts = rrddim_add(st, "NoPorts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2578 + rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2579 + rd_IgnoredMulti = rrddim_add(st, "IgnoredMulti", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2580 + }
2581 + else rrdset_next(st);
2582 +
2583 + rrddim_set_by_pointer(st, rd_RcvbufErrors, Udp6RcvbufErrors);
2584 + rrddim_set_by_pointer(st, rd_SndbufErrors, Udp6SndbufErrors);
2585 + rrddim_set_by_pointer(st, rd_InErrors, Udp6InErrors);
2586 + rrddim_set_by_pointer(st, rd_NoPorts, Udp6NoPorts);
2587 + rrddim_set_by_pointer(st, rd_InCsumErrors, Udp6InCsumErrors);
2588 + rrddim_set_by_pointer(st, rd_IgnoredMulti, Udp6IgnoredMulti);
2589 + rrdset_done(st);
2590 + }
2591 +
2592 + // --------------------------------------------------------------------
2593 +
2594 + if(do_ip6_udplite_packets == CONFIG_BOOLEAN_YES || (do_ip6_udplite_packets == CONFIG_BOOLEAN_AUTO &&
2595 + (UdpLite6InDatagrams ||
2596 + UdpLite6OutDatagrams ||
2597 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2598 + do_udplite_packets = CONFIG_BOOLEAN_YES;
2599 + static RRDSET *st = NULL;
2600 + static RRDDIM *rd_received = NULL,
2601 + *rd_sent = NULL;
2602 +
2603 + if(unlikely(!st)) {
2604 + st = rrdset_create_localhost(
2605 + RRD_TYPE_NET_SNMP6
2606 + , "udplitepackets"
2607 + , NULL
2608 + , "udplite6"
2609 + , NULL
2610 + , "IPv6 UDPlite Packets"
2611 + , "packets/s"
2612 + , PLUGIN_PROC_NAME
2613 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2614 + , NETDATA_CHART_PRIO_IPV6_UDPLITE_PACKETS
2615 + , update_every
2616 + , RRDSET_TYPE_LINE
2617 + );
2618 +
2619 + rd_received = rrddim_add(st, "InDatagrams", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
2620 + rd_sent = rrddim_add(st, "OutDatagrams", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
2621 + }
2622 + else rrdset_next(st);
2623 +
2624 + rrddim_set_by_pointer(st, rd_received, UdpLite6InDatagrams);
2625 + rrddim_set_by_pointer(st, rd_sent, UdpLite6OutDatagrams);
2626 + rrdset_done(st);
2627 + }
2628 +
2629 + // --------------------------------------------------------------------
2630 +
2631 + if(do_ip6_udplite_errors == CONFIG_BOOLEAN_YES || (do_ip6_udplite_errors == CONFIG_BOOLEAN_AUTO &&
2632 + (UdpLite6InErrors ||
2633 + UdpLite6NoPorts ||
2634 + UdpLite6RcvbufErrors ||
2635 + UdpLite6SndbufErrors ||
2636 + Udp6InCsumErrors ||
2637 + UdpLite6InCsumErrors ||
2638 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2639 + do_ip6_udplite_errors = CONFIG_BOOLEAN_YES;
2640 + static RRDSET *st = NULL;
2641 + static RRDDIM *rd_RcvbufErrors = NULL,
2642 + *rd_SndbufErrors = NULL,
2643 + *rd_InErrors = NULL,
2644 + *rd_NoPorts = NULL,
2645 + *rd_InCsumErrors = NULL;
2646 +
2647 + if(unlikely(!st)) {
2648 + st = rrdset_create_localhost(
2649 + RRD_TYPE_NET_SNMP6
2650 + , "udpliteerrors"
2651 + , NULL
2652 + , "udplite6"
2653 + , NULL
2654 + , "IPv6 UDP Lite Errors"
2655 + , "events/s"
2656 + , PLUGIN_PROC_NAME
2657 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2658 + , NETDATA_CHART_PRIO_IPV6_UDPLITE_ERRORS
2659 + , update_every
2660 + , RRDSET_TYPE_LINE
2661 + );
2662 + rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
2663 +
2664 + rd_RcvbufErrors = rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2665 + rd_SndbufErrors = rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2666 + rd_InErrors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2667 + rd_NoPorts = rrddim_add(st, "NoPorts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2668 + rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2669 + }
2670 + else rrdset_next(st);
2671 +
2672 + rrddim_set_by_pointer(st, rd_InErrors, UdpLite6InErrors);
2673 + rrddim_set_by_pointer(st, rd_NoPorts, UdpLite6NoPorts);
2674 + rrddim_set_by_pointer(st, rd_RcvbufErrors, UdpLite6RcvbufErrors);
2675 + rrddim_set_by_pointer(st, rd_SndbufErrors, UdpLite6SndbufErrors);
2676 + rrddim_set_by_pointer(st, rd_InCsumErrors, UdpLite6InCsumErrors);
2677 + rrdset_done(st);
2678 + }
2679 +
2680 + // --------------------------------------------------------------------
2681 +
2682 + if(do_ip6_mcast == CONFIG_BOOLEAN_YES || (do_ip6_mcast == CONFIG_BOOLEAN_AUTO &&
2683 + (Ip6OutMcastOctets ||
2684 + Ip6InMcastOctets ||
2685 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2686 + do_ip6_mcast = CONFIG_BOOLEAN_YES;
2687 + static RRDSET *st = NULL;
2688 + static RRDDIM *rd_Ip6InMcastOctets = NULL,
2689 + *rd_Ip6OutMcastOctets = NULL;
2690 +
2691 + if(unlikely(!st)) {
2692 + st = rrdset_create_localhost(
2693 + RRD_TYPE_NET_SNMP6
2694 + , "mcast"
2695 + , NULL
2696 + , "multicast6"
2697 + , NULL
2698 + , "IPv6 Multicast Bandwidth"
2699 + , "kilobits/s"
2700 + , PLUGIN_PROC_NAME
2701 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2702 + , NETDATA_CHART_PRIO_IPV6_MCAST
2703 + , update_every
2704 + , RRDSET_TYPE_AREA
2705 + );
2706 + rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
2707 +
2708 + rd_Ip6InMcastOctets = rrddim_add(st, "InMcastOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
2709 + rd_Ip6OutMcastOctets = rrddim_add(st, "OutMcastOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
2710 + }
2711 + else rrdset_next(st);
2712 +
2713 + rrddim_set_by_pointer(st, rd_Ip6InMcastOctets, Ip6InMcastOctets);
2714 + rrddim_set_by_pointer(st, rd_Ip6OutMcastOctets, Ip6OutMcastOctets);
2715 + rrdset_done(st);
2716 + }
2717 +
2718 + // --------------------------------------------------------------------
2719 +
2720 + if(do_ip6_bcast == CONFIG_BOOLEAN_YES || (do_ip6_bcast == CONFIG_BOOLEAN_AUTO &&
2721 + (Ip6OutBcastOctets ||
2722 + Ip6InBcastOctets ||
2723 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2724 + do_ip6_bcast = CONFIG_BOOLEAN_YES;
2725 + static RRDSET *st = NULL;
2726 + static RRDDIM *rd_Ip6InBcastOctets = NULL,
2727 + *rd_Ip6OutBcastOctets = NULL;
2728 +
2729 + if(unlikely(!st)) {
2730 + st = rrdset_create_localhost(
2731 + RRD_TYPE_NET_SNMP6
2732 + , "bcast"
2733 + , NULL
2734 + , "broadcast6"
2735 + , NULL
2736 + , "IPv6 Broadcast Bandwidth"
2737 + , "kilobits/s"
2738 + , PLUGIN_PROC_NAME
2739 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2740 + , NETDATA_CHART_PRIO_IPV6_BCAST
2741 + , update_every
2742 + , RRDSET_TYPE_AREA
2743 + );
2744 + rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
2745 +
2746 + rd_Ip6InBcastOctets = rrddim_add(st, "InBcastOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
2747 + rd_Ip6OutBcastOctets = rrddim_add(st, "OutBcastOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
2748 + }
2749 + else rrdset_next(st);
2750 +
2751 + rrddim_set_by_pointer(st, rd_Ip6InBcastOctets, Ip6InBcastOctets);
2752 + rrddim_set_by_pointer(st, rd_Ip6OutBcastOctets, Ip6OutBcastOctets);
2753 + rrdset_done(st);
2754 + }
2755 +
2756 + // --------------------------------------------------------------------
2757 +
2758 + if(do_ip6_mcast_p == CONFIG_BOOLEAN_YES || (do_ip6_mcast_p == CONFIG_BOOLEAN_AUTO &&
2759 + (Ip6OutMcastPkts ||
2760 + Ip6InMcastPkts ||
2761 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2762 + do_ip6_mcast_p = CONFIG_BOOLEAN_YES;
2763 + static RRDSET *st = NULL;
2764 + static RRDDIM *rd_Ip6InMcastPkts = NULL,
2765 + *rd_Ip6OutMcastPkts = NULL;
2766 +
2767 + if(unlikely(!st)) {
2768 + st = rrdset_create_localhost(
2769 + RRD_TYPE_NET_SNMP6
2770 + , "mcastpkts"
2771 + , NULL
2772 + , "multicast6"
2773 + , NULL
2774 + , "IPv6 Multicast Packets"
2775 + , "packets/s"
2776 + , PLUGIN_PROC_NAME
2777 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2778 + , NETDATA_CHART_PRIO_IPV6_MCAST_PACKETS
2779 + , update_every
2780 + , RRDSET_TYPE_LINE
2781 + );
2782 + rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
2783 +
2784 + rd_Ip6InMcastPkts = rrddim_add(st, "InMcastPkts", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
2785 + rd_Ip6OutMcastPkts = rrddim_add(st, "OutMcastPkts", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
2786 + }
2787 + else rrdset_next(st);
2788 +
2789 + rrddim_set_by_pointer(st, rd_Ip6InMcastPkts, Ip6InMcastPkts);
2790 + rrddim_set_by_pointer(st, rd_Ip6OutMcastPkts, Ip6OutMcastPkts);
2791 + rrdset_done(st);
2792 + }
2793 +
2794 + // --------------------------------------------------------------------
2795 +
2796 + if(do_ip6_icmp == CONFIG_BOOLEAN_YES || (do_ip6_icmp == CONFIG_BOOLEAN_AUTO &&
2797 + (Icmp6InMsgs ||
2798 + Icmp6OutMsgs ||
2799 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2800 + do_ip6_icmp = CONFIG_BOOLEAN_YES;
2801 + static RRDSET *st = NULL;
2802 + static RRDDIM *rd_Icmp6InMsgs = NULL,
2803 + *rd_Icmp6OutMsgs = NULL;
2804 +
2805 + if(unlikely(!st)) {
2806 + st = rrdset_create_localhost(
2807 + RRD_TYPE_NET_SNMP6
2808 + , "icmp"
2809 + , NULL
2810 + , "icmp6"
2811 + , NULL
2812 + , "IPv6 ICMP Messages"
2813 + , "messages/s"
2814 + , PLUGIN_PROC_NAME
2815 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2816 + , NETDATA_CHART_PRIO_IPV6_ICMP
2817 + , update_every
2818 + , RRDSET_TYPE_LINE
2819 + );
2820 +
2821 + rd_Icmp6InMsgs = rrddim_add(st, "InMsgs", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
2822 + rd_Icmp6OutMsgs = rrddim_add(st, "OutMsgs", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
2823 + }
2824 + else rrdset_next(st);
2825 +
2826 + rrddim_set_by_pointer(st, rd_Icmp6InMsgs, Icmp6InMsgs);
2827 + rrddim_set_by_pointer(st, rd_Icmp6OutMsgs, Icmp6OutMsgs);
2828 + rrdset_done(st);
2829 + }
2830 +
2831 + // --------------------------------------------------------------------
2832 +
2833 + if(do_ip6_icmp_redir == CONFIG_BOOLEAN_YES || (do_ip6_icmp_redir == CONFIG_BOOLEAN_AUTO &&
2834 + (Icmp6InRedirects ||
2835 + Icmp6OutRedirects ||
2836 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2837 + do_ip6_icmp_redir = CONFIG_BOOLEAN_YES;
2838 + static RRDSET *st = NULL;
2839 + static RRDDIM *rd_Icmp6InRedirects = NULL,
2840 + *rd_Icmp6OutRedirects = NULL;
2841 +
2842 + if(unlikely(!st)) {
2843 + st = rrdset_create_localhost(
2844 + RRD_TYPE_NET_SNMP6
2845 + , "icmpredir"
2846 + , NULL
2847 + , "icmp6"
2848 + , NULL
2849 + , "IPv6 ICMP Redirects"
2850 + , "redirects/s"
2851 + , PLUGIN_PROC_NAME
2852 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2853 + , NETDATA_CHART_PRIO_IPV6_ICMP_REDIR
2854 + , update_every
2855 + , RRDSET_TYPE_LINE
2856 + );
2857 +
2858 + rd_Icmp6InRedirects = rrddim_add(st, "InRedirects", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
2859 + rd_Icmp6OutRedirects = rrddim_add(st, "OutRedirects", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
2860 + }
2861 + else rrdset_next(st);
2862 +
2863 + rrddim_set_by_pointer(st, rd_Icmp6InRedirects, Icmp6InRedirects);
2864 + rrddim_set_by_pointer(st, rd_Icmp6OutRedirects, Icmp6OutRedirects);
2865 + rrdset_done(st);
2866 + }
2867 +
2868 + // --------------------------------------------------------------------
2869 +
2870 + if(do_ip6_icmp_errors == CONFIG_BOOLEAN_YES || (do_ip6_icmp_errors == CONFIG_BOOLEAN_AUTO &&
2871 + (Icmp6InErrors ||
2872 + Icmp6OutErrors ||
2873 + Icmp6InCsumErrors ||
2874 + Icmp6InDestUnreachs ||
2875 + Icmp6InPktTooBigs ||
2876 + Icmp6InTimeExcds ||
2877 + Icmp6InParmProblems ||
2878 + Icmp6OutDestUnreachs ||
2879 + Icmp6OutPktTooBigs ||
2880 + Icmp6OutTimeExcds ||
2881 + Icmp6OutParmProblems ||
2882 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2883 + do_ip6_icmp_errors = CONFIG_BOOLEAN_YES;
2884 + static RRDSET *st = NULL;
2885 + static RRDDIM *rd_InErrors = NULL,
2886 + *rd_OutErrors = NULL,
2887 + *rd_InCsumErrors = NULL,
2888 + *rd_InDestUnreachs = NULL,
2889 + *rd_InPktTooBigs = NULL,
2890 + *rd_InTimeExcds = NULL,
2891 + *rd_InParmProblems = NULL,
2892 + *rd_OutDestUnreachs = NULL,
2893 + *rd_OutPktTooBigs = NULL,
2894 + *rd_OutTimeExcds = NULL,
2895 + *rd_OutParmProblems = NULL;
2896 +
2897 + if(unlikely(!st)) {
2898 + st = rrdset_create_localhost(
2899 + RRD_TYPE_NET_SNMP6
2900 + , "icmperrors"
2901 + , NULL
2902 + , "icmp6"
2903 + , NULL
2904 + , "IPv6 ICMP Errors"
2905 + , "errors/s"
2906 + , PLUGIN_PROC_NAME
2907 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2908 + , NETDATA_CHART_PRIO_IPV6_ICMP_ERRORS
2909 + , update_every
2910 + , RRDSET_TYPE_LINE
2911 + );
2912 +
2913 + rd_InErrors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2914 + rd_OutErrors = rrddim_add(st, "OutErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2915 + rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2916 + rd_InDestUnreachs = rrddim_add(st, "InDestUnreachs", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2917 + rd_InPktTooBigs = rrddim_add(st, "InPktTooBigs", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2918 + rd_InTimeExcds = rrddim_add(st, "InTimeExcds", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2919 + rd_InParmProblems = rrddim_add(st, "InParmProblems", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2920 + rd_OutDestUnreachs = rrddim_add(st, "OutDestUnreachs", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2921 + rd_OutPktTooBigs = rrddim_add(st, "OutPktTooBigs", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2922 + rd_OutTimeExcds = rrddim_add(st, "OutTimeExcds", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2923 + rd_OutParmProblems = rrddim_add(st, "OutParmProblems", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2924 + }
2925 + else rrdset_next(st);
2926 +
2927 + rrddim_set_by_pointer(st, rd_InErrors, Icmp6InErrors);
2928 + rrddim_set_by_pointer(st, rd_OutErrors, Icmp6OutErrors);
2929 + rrddim_set_by_pointer(st, rd_InCsumErrors, Icmp6InCsumErrors);
2930 + rrddim_set_by_pointer(st, rd_InDestUnreachs, Icmp6InDestUnreachs);
2931 + rrddim_set_by_pointer(st, rd_InPktTooBigs, Icmp6InPktTooBigs);
2932 + rrddim_set_by_pointer(st, rd_InTimeExcds, Icmp6InTimeExcds);
2933 + rrddim_set_by_pointer(st, rd_InParmProblems, Icmp6InParmProblems);
2934 + rrddim_set_by_pointer(st, rd_OutDestUnreachs, Icmp6OutDestUnreachs);
2935 + rrddim_set_by_pointer(st, rd_OutPktTooBigs, Icmp6OutPktTooBigs);
2936 + rrddim_set_by_pointer(st, rd_OutTimeExcds, Icmp6OutTimeExcds);
2937 + rrddim_set_by_pointer(st, rd_OutParmProblems, Icmp6OutParmProblems);
2938 + rrdset_done(st);
2939 + }
2940 +
2941 + // --------------------------------------------------------------------
2942 +
2943 + if(do_ip6_icmp_echos == CONFIG_BOOLEAN_YES || (do_ip6_icmp_echos == CONFIG_BOOLEAN_AUTO &&
2944 + (Icmp6InEchos ||
2945 + Icmp6OutEchos ||
2946 + Icmp6InEchoReplies ||
2947 + Icmp6OutEchoReplies ||
2948 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2949 + do_ip6_icmp_echos = CONFIG_BOOLEAN_YES;
2950 + static RRDSET *st = NULL;
2951 + static RRDDIM *rd_InEchos = NULL,
2952 + *rd_OutEchos = NULL,
2953 + *rd_InEchoReplies = NULL,
2954 + *rd_OutEchoReplies = NULL;
2955 +
2956 + if(unlikely(!st)) {
2957 + st = rrdset_create_localhost(
2958 + RRD_TYPE_NET_SNMP6
2959 + , "icmpechos"
2960 + , NULL
2961 + , "icmp6"
2962 + , NULL
2963 + , "IPv6 ICMP Echo"
2964 + , "messages/s"
2965 + , PLUGIN_PROC_NAME
2966 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
2967 + , NETDATA_CHART_PRIO_IPV6_ICMP_ECHOS
2968 + , update_every
2969 + , RRDSET_TYPE_LINE
2970 + );
2971 +
2972 + rd_InEchos = rrddim_add(st, "InEchos", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2973 + rd_OutEchos = rrddim_add(st, "OutEchos", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2974 + rd_InEchoReplies = rrddim_add(st, "InEchoReplies", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
2975 + rd_OutEchoReplies = rrddim_add(st, "OutEchoReplies", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
2976 + }
2977 + else rrdset_next(st);
2978 +
2979 + rrddim_set_by_pointer(st, rd_InEchos, Icmp6InEchos);
2980 + rrddim_set_by_pointer(st, rd_OutEchos, Icmp6OutEchos);
2981 + rrddim_set_by_pointer(st, rd_InEchoReplies, Icmp6InEchoReplies);
2982 + rrddim_set_by_pointer(st, rd_OutEchoReplies, Icmp6OutEchoReplies);
2983 + rrdset_done(st);
2984 + }
2985 +
2986 + // --------------------------------------------------------------------
2987 +
2988 + if(do_ip6_icmp_groupmemb == CONFIG_BOOLEAN_YES || (do_ip6_icmp_groupmemb == CONFIG_BOOLEAN_AUTO &&
2989 + (Icmp6InGroupMembQueries ||
2990 + Icmp6OutGroupMembQueries ||
2991 + Icmp6InGroupMembResponses ||
2992 + Icmp6OutGroupMembResponses ||
2993 + Icmp6InGroupMembReductions ||
2994 + Icmp6OutGroupMembReductions ||
2995 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
2996 + do_ip6_icmp_groupmemb = CONFIG_BOOLEAN_YES;
2997 + static RRDSET *st = NULL;
2998 + static RRDDIM *rd_InQueries = NULL,
2999 + *rd_OutQueries = NULL,
3000 + *rd_InResponses = NULL,
3001 + *rd_OutResponses = NULL,
3002 + *rd_InReductions = NULL,
3003 + *rd_OutReductions = NULL;
3004 +
3005 + if(unlikely(!st)) {
3006 + st = rrdset_create_localhost(
3007 + RRD_TYPE_NET_SNMP6
3008 + , "groupmemb"
3009 + , NULL
3010 + , "icmp6"
3011 + , NULL
3012 + , "IPv6 ICMP Group Membership"
3013 + , "messages/s"
3014 + , PLUGIN_PROC_NAME
3015 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
3016 + , NETDATA_CHART_PRIO_IPV6_ICMP_GROUPMEMB
3017 + , update_every
3018 + , RRDSET_TYPE_LINE);
3019 +
3020 + rd_InQueries = rrddim_add(st, "InQueries", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
3021 + rd_OutQueries = rrddim_add(st, "OutQueries", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
3022 + rd_InResponses = rrddim_add(st, "InResponses", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
3023 + rd_OutResponses = rrddim_add(st, "OutResponses", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
3024 + rd_InReductions = rrddim_add(st, "InReductions", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
3025 + rd_OutReductions = rrddim_add(st, "OutReductions", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
3026 + }
3027 + else rrdset_next(st);
3028 +
3029 + rrddim_set_by_pointer(st, rd_InQueries, Icmp6InGroupMembQueries);
3030 + rrddim_set_by_pointer(st, rd_OutQueries, Icmp6OutGroupMembQueries);
3031 + rrddim_set_by_pointer(st, rd_InResponses, Icmp6InGroupMembResponses);
3032 + rrddim_set_by_pointer(st, rd_OutResponses, Icmp6OutGroupMembResponses);
3033 + rrddim_set_by_pointer(st, rd_InReductions, Icmp6InGroupMembReductions);
3034 + rrddim_set_by_pointer(st, rd_OutReductions, Icmp6OutGroupMembReductions);
3035 + rrdset_done(st);
3036 + }
3037 +
3038 + // --------------------------------------------------------------------
3039 +
3040 + if(do_ip6_icmp_router == CONFIG_BOOLEAN_YES || (do_ip6_icmp_router == CONFIG_BOOLEAN_AUTO &&
3041 + (Icmp6InRouterSolicits ||
3042 + Icmp6OutRouterSolicits ||
3043 + Icmp6InRouterAdvertisements ||
3044 + Icmp6OutRouterAdvertisements ||
3045 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
3046 + do_ip6_icmp_router = CONFIG_BOOLEAN_YES;
3047 + static RRDSET *st = NULL;
3048 + static RRDDIM *rd_InSolicits = NULL,
3049 + *rd_OutSolicits = NULL,
3050 + *rd_InAdvertisements = NULL,
3051 + *rd_OutAdvertisements = NULL;
3052 +
3053 + if(unlikely(!st)) {
3054 + st = rrdset_create_localhost(
3055 + RRD_TYPE_NET_SNMP6
3056 + , "icmprouter"
3057 + , NULL
3058 + , "icmp6"
3059 + , NULL
3060 + , "IPv6 Router Messages"
3061 + , "messages/s"
3062 + , PLUGIN_PROC_NAME
3063 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
3064 + , NETDATA_CHART_PRIO_IPV6_ICMP_ROUTER
3065 + , update_every
3066 + , RRDSET_TYPE_LINE
3067 + );
3068 +
3069 + rd_InSolicits = rrddim_add(st, "InSolicits", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
3070 + rd_OutSolicits = rrddim_add(st, "OutSolicits", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
3071 + rd_InAdvertisements = rrddim_add(st, "InAdvertisements", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
3072 + rd_OutAdvertisements = rrddim_add(st, "OutAdvertisements", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
3073 + }
3074 + else rrdset_next(st);
3075 +
3076 + rrddim_set_by_pointer(st, rd_InSolicits, Icmp6InRouterSolicits);
3077 + rrddim_set_by_pointer(st, rd_OutSolicits, Icmp6OutRouterSolicits);
3078 + rrddim_set_by_pointer(st, rd_InAdvertisements, Icmp6InRouterAdvertisements);
3079 + rrddim_set_by_pointer(st, rd_OutAdvertisements, Icmp6OutRouterAdvertisements);
3080 + rrdset_done(st);
3081 + }
3082 +
3083 + // --------------------------------------------------------------------
3084 +
3085 + if(do_ip6_icmp_neighbor == CONFIG_BOOLEAN_YES || (do_ip6_icmp_neighbor == CONFIG_BOOLEAN_AUTO &&
3086 + (Icmp6InNeighborSolicits ||
3087 + Icmp6OutNeighborSolicits ||
3088 + Icmp6InNeighborAdvertisements ||
3089 + Icmp6OutNeighborAdvertisements ||
3090 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
3091 + do_ip6_icmp_neighbor = CONFIG_BOOLEAN_YES;
3092 + static RRDSET *st = NULL;
3093 + static RRDDIM *rd_InSolicits = NULL,
3094 + *rd_OutSolicits = NULL,
3095 + *rd_InAdvertisements = NULL,
3096 + *rd_OutAdvertisements = NULL;
3097 +
3098 + if(unlikely(!st)) {
3099 + st = rrdset_create_localhost(
3100 + RRD_TYPE_NET_SNMP6
3101 + , "icmpneighbor"
3102 + , NULL
3103 + , "icmp6"
3104 + , NULL
3105 + , "IPv6 Neighbor Messages"
3106 + , "messages/s"
3107 + , PLUGIN_PROC_NAME
3108 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
3109 + , NETDATA_CHART_PRIO_IPV6_ICMP_NEIGHBOR
3110 + , update_every
3111 + , RRDSET_TYPE_LINE
3112 + );
3113 +
3114 + rd_InSolicits = rrddim_add(st, "InSolicits", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
3115 + rd_OutSolicits = rrddim_add(st, "OutSolicits", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
3116 + rd_InAdvertisements = rrddim_add(st, "InAdvertisements", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
3117 + rd_OutAdvertisements = rrddim_add(st, "OutAdvertisements", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
3118 + }
3119 + else rrdset_next(st);
3120 +
3121 + rrddim_set_by_pointer(st, rd_InSolicits, Icmp6InNeighborSolicits);
3122 + rrddim_set_by_pointer(st, rd_OutSolicits, Icmp6OutNeighborSolicits);
3123 + rrddim_set_by_pointer(st, rd_InAdvertisements, Icmp6InNeighborAdvertisements);
3124 + rrddim_set_by_pointer(st, rd_OutAdvertisements, Icmp6OutNeighborAdvertisements);
3125 + rrdset_done(st);
3126 + }
3127 +
3128 + // --------------------------------------------------------------------
3129 +
3130 + if(do_ip6_icmp_mldv2 == CONFIG_BOOLEAN_YES || (do_ip6_icmp_mldv2 == CONFIG_BOOLEAN_AUTO &&
3131 + (Icmp6InMLDv2Reports ||
3132 + Icmp6OutMLDv2Reports ||
3133 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
3134 + do_ip6_icmp_mldv2 = CONFIG_BOOLEAN_YES;
3135 + static RRDSET *st = NULL;
3136 + static RRDDIM *rd_InMLDv2Reports = NULL,
3137 + *rd_OutMLDv2Reports = NULL;
3138 +
3139 + if(unlikely(!st)) {
3140 + st = rrdset_create_localhost(
3141 + RRD_TYPE_NET_SNMP6
3142 + , "icmpmldv2"
3143 + , NULL
3144 + , "icmp6"
3145 + , NULL
3146 + , "IPv6 ICMP MLDv2 Reports"
3147 + , "reports/s"
3148 + , PLUGIN_PROC_NAME
3149 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
3150 + , NETDATA_CHART_PRIO_IPV6_ICMP_LDV2
3151 + , update_every
3152 + , RRDSET_TYPE_LINE
3153 + );
3154 +
3155 + rd_InMLDv2Reports = rrddim_add(st, "InMLDv2Reports", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
3156 + rd_OutMLDv2Reports = rrddim_add(st, "OutMLDv2Reports", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
3157 + }
3158 + else rrdset_next(st);
3159 +
3160 + rrddim_set_by_pointer(st, rd_InMLDv2Reports, Icmp6InMLDv2Reports);
3161 + rrddim_set_by_pointer(st, rd_OutMLDv2Reports, Icmp6OutMLDv2Reports);
3162 + rrdset_done(st);
3163 + }
3164 +
3165 + // --------------------------------------------------------------------
3166 +
3167 + if(do_ip6_icmp_types == CONFIG_BOOLEAN_YES || (do_ip6_icmp_types == CONFIG_BOOLEAN_AUTO &&
3168 + (Icmp6InType1 ||
3169 + Icmp6InType128 ||
3170 + Icmp6InType129 ||
3171 + Icmp6InType136 ||
3172 + Icmp6OutType1 ||
3173 + Icmp6OutType128 ||
3174 + Icmp6OutType129 ||
3175 + Icmp6OutType133 ||
3176 + Icmp6OutType135 ||
3177 + Icmp6OutType143 ||
3178 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
3179 + do_ip6_icmp_types = CONFIG_BOOLEAN_YES;
3180 + static RRDSET *st = NULL;
3181 + static RRDDIM *rd_InType1 = NULL,
3182 + *rd_InType128 = NULL,
3183 + *rd_InType129 = NULL,
3184 + *rd_InType136 = NULL,
3185 + *rd_OutType1 = NULL,
3186 + *rd_OutType128 = NULL,
3187 + *rd_OutType129 = NULL,
3188 + *rd_OutType133 = NULL,
3189 + *rd_OutType135 = NULL,
3190 + *rd_OutType143 = NULL;
3191 +
3192 + if(unlikely(!st)) {
3193 + st = rrdset_create_localhost(
3194 + RRD_TYPE_NET_SNMP6
3195 + , "icmptypes"
3196 + , NULL
3197 + , "icmp6"
3198 + , NULL
3199 + , "IPv6 ICMP Types"
3200 + , "messages/s"
3201 + , PLUGIN_PROC_NAME
3202 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
3203 + , NETDATA_CHART_PRIO_IPV6_ICMP_TYPES
3204 + , update_every
3205 + , RRDSET_TYPE_LINE
3206 + );
3207 +
3208 + rd_InType1 = rrddim_add(st, "InType1", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
3209 + rd_InType128 = rrddim_add(st, "InType128", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
3210 + rd_InType129 = rrddim_add(st, "InType129", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
3211 + rd_InType136 = rrddim_add(st, "InType136", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
3212 + rd_OutType1 = rrddim_add(st, "OutType1", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
3213 + rd_OutType128 = rrddim_add(st, "OutType128", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
3214 + rd_OutType129 = rrddim_add(st, "OutType129", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
3215 + rd_OutType133 = rrddim_add(st, "OutType133", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
3216 + rd_OutType135 = rrddim_add(st, "OutType135", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
3217 + rd_OutType143 = rrddim_add(st, "OutType143", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
3218 + }
3219 + else rrdset_next(st);
3220 +
3221 + rrddim_set_by_pointer(st, rd_InType1, Icmp6InType1);
3222 + rrddim_set_by_pointer(st, rd_InType128, Icmp6InType128);
3223 + rrddim_set_by_pointer(st, rd_InType129, Icmp6InType129);
3224 + rrddim_set_by_pointer(st, rd_InType136, Icmp6InType136);
3225 + rrddim_set_by_pointer(st, rd_OutType1, Icmp6OutType1);
3226 + rrddim_set_by_pointer(st, rd_OutType128, Icmp6OutType128);
3227 + rrddim_set_by_pointer(st, rd_OutType129, Icmp6OutType129);
3228 + rrddim_set_by_pointer(st, rd_OutType133, Icmp6OutType133);
3229 + rrddim_set_by_pointer(st, rd_OutType135, Icmp6OutType135);
3230 + rrddim_set_by_pointer(st, rd_OutType143, Icmp6OutType143);
3231 + rrdset_done(st);
3232 + }
3233 +
3234 + // --------------------------------------------------------------------
3235 +
3236 + if(do_ip6_ect == CONFIG_BOOLEAN_YES || (do_ip6_ect == CONFIG_BOOLEAN_AUTO &&
3237 + (Ip6InNoECTPkts ||
3238 + Ip6InECT1Pkts ||
3239 + Ip6InECT0Pkts ||
3240 + Ip6InCEPkts ||
3241 + netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
3242 + do_ip6_ect = CONFIG_BOOLEAN_YES;
3243 + static RRDSET *st = NULL;
3244 + static RRDDIM *rd_InNoECTPkts = NULL,
3245 + *rd_InECT1Pkts = NULL,
3246 + *rd_InECT0Pkts = NULL,
3247 + *rd_InCEPkts = NULL;
3248 +
3249 + if(unlikely(!st)) {
3250 + st = rrdset_create_localhost(
3251 + RRD_TYPE_NET_SNMP6
3252 + , "ect"
3253 + , NULL
3254 + , "packets"
3255 + , NULL
3256 + , "IPv6 ECT Packets"
3257 + , "packets/s"
3258 + , PLUGIN_PROC_NAME
3259 + , PLUGIN_PROC_MODULE_NETSTAT_NAME
3260 + , NETDATA_CHART_PRIO_IPV6_ECT
3261 + , update_every
3262 + , RRDSET_TYPE_LINE
3263 + );
3264 +
3265 + rd_InNoECTPkts = rrddim_add(st, "InNoECTPkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
3266 + rd_InECT1Pkts = rrddim_add(st, "InECT1Pkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
3267 + rd_InECT0Pkts = rrddim_add(st, "InECT0Pkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
3268 + rd_InCEPkts = rrddim_add(st, "InCEPkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
3269 + }
3270 + else rrdset_next(st);
3271 +
3272 + rrddim_set_by_pointer(st, rd_InNoECTPkts, Ip6InNoECTPkts);
3273 + rrddim_set_by_pointer(st, rd_InECT1Pkts, Ip6InECT1Pkts);
3274 + rrddim_set_by_pointer(st, rd_InECT0Pkts, Ip6InECT0Pkts);
3275 + rrddim_set_by_pointer(st, rd_InCEPkts, Ip6InCEPkts);
3276 + rrdset_done(st);
3277 }
3278
3279 return 0;
collectors/proc.plugin/proc_net_snmp.c deleted
-1130
@@ -1,1130 +0,0 @@
1 -// SPDX-License-Identifier: GPL-3.0-or-later
2 -
3 -#include "plugin_proc.h"
4 -#define PLUGIN_PROC_MODULE_NET_SNMP_NAME "/proc/net/snmp"
5 -
6 -#define RRD_TYPE_NET_SNMP "ipv4"
7 -
8 -static struct proc_net_snmp {
9 - // kernel_uint_t ip_Forwarding;
10 - kernel_uint_t ip_DefaultTTL;
11 - kernel_uint_t ip_InReceives;
12 - kernel_uint_t ip_InHdrErrors;
13 - kernel_uint_t ip_InAddrErrors;
14 - kernel_uint_t ip_ForwDatagrams;
15 - kernel_uint_t ip_InUnknownProtos;
16 - kernel_uint_t ip_InDiscards;
17 - kernel_uint_t ip_InDelivers;
18 - kernel_uint_t ip_OutRequests;
19 - kernel_uint_t ip_OutDiscards;
20 - kernel_uint_t ip_OutNoRoutes;
21 - kernel_uint_t ip_ReasmTimeout;
22 - kernel_uint_t ip_ReasmReqds;
23 - kernel_uint_t ip_ReasmOKs;
24 - kernel_uint_t ip_ReasmFails;
25 - kernel_uint_t ip_FragOKs;
26 - kernel_uint_t ip_FragFails;
27 - kernel_uint_t ip_FragCreates;
28 -
29 - kernel_uint_t icmp_InMsgs;
30 - kernel_uint_t icmp_OutMsgs;
31 - kernel_uint_t icmp_InErrors;
32 - kernel_uint_t icmp_OutErrors;
33 - kernel_uint_t icmp_InCsumErrors;
34 -
35 - kernel_uint_t icmpmsg_InEchoReps;
36 - kernel_uint_t icmpmsg_OutEchoReps;
37 - kernel_uint_t icmpmsg_InDestUnreachs;
38 - kernel_uint_t icmpmsg_OutDestUnreachs;
39 - kernel_uint_t icmpmsg_InRedirects;
40 - kernel_uint_t icmpmsg_OutRedirects;
41 - kernel_uint_t icmpmsg_InEchos;
42 - kernel_uint_t icmpmsg_OutEchos;
43 - kernel_uint_t icmpmsg_InRouterAdvert;
44 - kernel_uint_t icmpmsg_OutRouterAdvert;
45 - kernel_uint_t icmpmsg_InRouterSelect;
46 - kernel_uint_t icmpmsg_OutRouterSelect;
47 - kernel_uint_t icmpmsg_InTimeExcds;
48 - kernel_uint_t icmpmsg_OutTimeExcds;
49 - kernel_uint_t icmpmsg_InParmProbs;
50 - kernel_uint_t icmpmsg_OutParmProbs;
51 - kernel_uint_t icmpmsg_InTimestamps;
52 - kernel_uint_t icmpmsg_OutTimestamps;
53 - kernel_uint_t icmpmsg_InTimestampReps;
54 - kernel_uint_t icmpmsg_OutTimestampReps;
55 -
56 - //kernel_uint_t tcp_RtoAlgorithm;
57 - //kernel_uint_t tcp_RtoMin;
58 - //kernel_uint_t tcp_RtoMax;
59 - ssize_t tcp_MaxConn;
60 - kernel_uint_t tcp_ActiveOpens;
61 - kernel_uint_t tcp_PassiveOpens;
62 - kernel_uint_t tcp_AttemptFails;
63 - kernel_uint_t tcp_EstabResets;
64 - kernel_uint_t tcp_CurrEstab;
65 - kernel_uint_t tcp_InSegs;
66 - kernel_uint_t tcp_OutSegs;
67 - kernel_uint_t tcp_RetransSegs;
68 - kernel_uint_t tcp_InErrs;
69 - kernel_uint_t tcp_OutRsts;
70 - kernel_uint_t tcp_InCsumErrors;
71 -
72 - kernel_uint_t udp_InDatagrams;
73 - kernel_uint_t udp_NoPorts;
74 - kernel_uint_t udp_InErrors;
75 - kernel_uint_t udp_OutDatagrams;
76 - kernel_uint_t udp_RcvbufErrors;
77 - kernel_uint_t udp_SndbufErrors;
78 - kernel_uint_t udp_InCsumErrors;
79 - kernel_uint_t udp_IgnoredMulti;
80 -
81 - kernel_uint_t udplite_InDatagrams;
82 - kernel_uint_t udplite_NoPorts;
83 - kernel_uint_t udplite_InErrors;
84 - kernel_uint_t udplite_OutDatagrams;
85 - kernel_uint_t udplite_RcvbufErrors;
86 - kernel_uint_t udplite_SndbufErrors;
87 - kernel_uint_t udplite_InCsumErrors;
88 - kernel_uint_t udplite_IgnoredMulti;
89 -} snmp_root = { 0 };
90 -
91 -int do_proc_net_snmp(int update_every, usec_t dt) {
92 - (void)dt;
93 -
94 - static procfile *ff = NULL;
95 - static int do_ip_packets = -1, do_ip_fragsout = -1, do_ip_fragsin = -1, do_ip_errors = -1,
96 - do_tcp_sockets = -1, do_tcp_packets = -1, do_tcp_errors = -1, do_tcp_handshake = -1, do_tcp_opens = -1,
97 - do_udp_packets = -1, do_udp_errors = -1, do_icmp_packets = -1, do_icmpmsg = -1, do_udplite_packets = -1;
98 - static uint32_t hash_ip = 0, hash_icmp = 0, hash_tcp = 0, hash_udp = 0, hash_icmpmsg = 0, hash_udplite = 0;
99 -
100 - static ARL_BASE *arl_ip = NULL,
101 - *arl_icmp = NULL,
102 - *arl_icmpmsg = NULL,
103 - *arl_tcp = NULL,
104 - *arl_udp = NULL,
105 - *arl_udplite = NULL;
106 -
107 - static const RRDVAR_ACQUIRED *tcp_max_connections_var = NULL;
108 -
109 - if(unlikely(!arl_ip)) {
110 - do_ip_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 packets", CONFIG_BOOLEAN_AUTO);
111 - do_ip_fragsout = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 fragments sent", CONFIG_BOOLEAN_AUTO);
112 - do_ip_fragsin = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 fragments assembly", CONFIG_BOOLEAN_AUTO);
113 - do_ip_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 errors", CONFIG_BOOLEAN_AUTO);
114 - do_tcp_sockets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 TCP connections", CONFIG_BOOLEAN_AUTO);
115 - do_tcp_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 TCP packets", CONFIG_BOOLEAN_AUTO);
116 - do_tcp_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 TCP errors", CONFIG_BOOLEAN_AUTO);
117 - do_tcp_opens = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 TCP opens", CONFIG_BOOLEAN_AUTO);
118 - do_tcp_handshake = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 TCP handshake issues", CONFIG_BOOLEAN_AUTO);
119 - do_udp_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 UDP packets", CONFIG_BOOLEAN_AUTO);
120 - do_udp_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 UDP errors", CONFIG_BOOLEAN_AUTO);
121 - do_icmp_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 ICMP packets", CONFIG_BOOLEAN_AUTO);
122 - do_icmpmsg = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 ICMP messages", CONFIG_BOOLEAN_AUTO);
123 - do_udplite_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp", "ipv4 UDPLite packets", CONFIG_BOOLEAN_AUTO);
124 -
125 - hash_ip = simple_hash("Ip");
126 - hash_tcp = simple_hash("Tcp");
127 - hash_udp = simple_hash("Udp");
128 - hash_icmp = simple_hash("Icmp");
129 - hash_icmpmsg = simple_hash("IcmpMsg");
130 - hash_udplite = simple_hash("UdpLite");
131 -
132 - arl_ip = arl_create("snmp/Ip", arl_callback_str2kernel_uint_t, 60);
133 - // arl_expect(arl_ip, "Forwarding", &snmp_root.ip_Forwarding);
134 - arl_expect(arl_ip, "DefaultTTL", &snmp_root.ip_DefaultTTL);
135 - arl_expect(arl_ip, "InReceives", &snmp_root.ip_InReceives);
136 - arl_expect(arl_ip, "InHdrErrors", &snmp_root.ip_InHdrErrors);
137 - arl_expect(arl_ip, "InAddrErrors", &snmp_root.ip_InAddrErrors);
138 - arl_expect(arl_ip, "ForwDatagrams", &snmp_root.ip_ForwDatagrams);
139 - arl_expect(arl_ip, "InUnknownProtos", &snmp_root.ip_InUnknownProtos);
140 - arl_expect(arl_ip, "InDiscards", &snmp_root.ip_InDiscards);
141 - arl_expect(arl_ip, "InDelivers", &snmp_root.ip_InDelivers);
142 - arl_expect(arl_ip, "OutRequests", &snmp_root.ip_OutRequests);
143 - arl_expect(arl_ip, "OutDiscards", &snmp_root.ip_OutDiscards);
144 - arl_expect(arl_ip, "OutNoRoutes", &snmp_root.ip_OutNoRoutes);
145 - arl_expect(arl_ip, "ReasmTimeout", &snmp_root.ip_ReasmTimeout);
146 - arl_expect(arl_ip, "ReasmReqds", &snmp_root.ip_ReasmReqds);
147 - arl_expect(arl_ip, "ReasmOKs", &snmp_root.ip_ReasmOKs);
148 - arl_expect(arl_ip, "ReasmFails", &snmp_root.ip_ReasmFails);
149 - arl_expect(arl_ip, "FragOKs", &snmp_root.ip_FragOKs);
150 - arl_expect(arl_ip, "FragFails", &snmp_root.ip_FragFails);
151 - arl_expect(arl_ip, "FragCreates", &snmp_root.ip_FragCreates);
152 -
153 - arl_icmp = arl_create("snmp/Icmp", arl_callback_str2kernel_uint_t, 60);
154 - arl_expect(arl_icmp, "InMsgs", &snmp_root.icmp_InMsgs);
155 - arl_expect(arl_icmp, "OutMsgs", &snmp_root.icmp_OutMsgs);
156 - arl_expect(arl_icmp, "InErrors", &snmp_root.icmp_InErrors);
157 - arl_expect(arl_icmp, "OutErrors", &snmp_root.icmp_OutErrors);
158 - arl_expect(arl_icmp, "InCsumErrors", &snmp_root.icmp_InCsumErrors);
159 -
160 - arl_icmpmsg = arl_create("snmp/Icmpmsg", arl_callback_str2kernel_uint_t, 60);
161 - arl_expect(arl_icmpmsg, "InType0", &snmp_root.icmpmsg_InEchoReps);
162 - arl_expect(arl_icmpmsg, "OutType0", &snmp_root.icmpmsg_OutEchoReps);
163 - arl_expect(arl_icmpmsg, "InType3", &snmp_root.icmpmsg_InDestUnreachs);
164 - arl_expect(arl_icmpmsg, "OutType3", &snmp_root.icmpmsg_OutDestUnreachs);
165 - arl_expect(arl_icmpmsg, "InType5", &snmp_root.icmpmsg_InRedirects);
166 - arl_expect(arl_icmpmsg, "OutType5", &snmp_root.icmpmsg_OutRedirects);
167 - arl_expect(arl_icmpmsg, "InType8", &snmp_root.icmpmsg_InEchos);
168 - arl_expect(arl_icmpmsg, "OutType8", &snmp_root.icmpmsg_OutEchos);
169 - arl_expect(arl_icmpmsg, "InType9", &snmp_root.icmpmsg_InRouterAdvert);
170 - arl_expect(arl_icmpmsg, "OutType9", &snmp_root.icmpmsg_OutRouterAdvert);
171 - arl_expect(arl_icmpmsg, "InType10", &snmp_root.icmpmsg_InRouterSelect);
172 - arl_expect(arl_icmpmsg, "OutType10", &snmp_root.icmpmsg_OutRouterSelect);
173 - arl_expect(arl_icmpmsg, "InType11", &snmp_root.icmpmsg_InTimeExcds);
174 - arl_expect(arl_icmpmsg, "OutType11", &snmp_root.icmpmsg_OutTimeExcds);
175 - arl_expect(arl_icmpmsg, "InType12", &snmp_root.icmpmsg_InParmProbs);
176 - arl_expect(arl_icmpmsg, "OutType12", &snmp_root.icmpmsg_OutParmProbs);
177 - arl_expect(arl_icmpmsg, "InType13", &snmp_root.icmpmsg_InTimestamps);
178 - arl_expect(arl_icmpmsg, "OutType13", &snmp_root.icmpmsg_OutTimestamps);
179 - arl_expect(arl_icmpmsg, "InType14", &snmp_root.icmpmsg_InTimestampReps);
180 - arl_expect(arl_icmpmsg, "OutType14", &snmp_root.icmpmsg_OutTimestampReps);
181 -
182 - arl_tcp = arl_create("snmp/Tcp", arl_callback_str2kernel_uint_t, 60);
183 - // arl_expect(arl_tcp, "RtoAlgorithm", &snmp_root.tcp_RtoAlgorithm);
184 - // arl_expect(arl_tcp, "RtoMin", &snmp_root.tcp_RtoMin);
185 - // arl_expect(arl_tcp, "RtoMax", &snmp_root.tcp_RtoMax);
186 - arl_expect_custom(arl_tcp, "MaxConn", arl_callback_ssize_t, &snmp_root.tcp_MaxConn);
187 - arl_expect(arl_tcp, "ActiveOpens", &snmp_root.tcp_ActiveOpens);
188 - arl_expect(arl_tcp, "PassiveOpens", &snmp_root.tcp_PassiveOpens);
189 - arl_expect(arl_tcp, "AttemptFails", &snmp_root.tcp_AttemptFails);
190 - arl_expect(arl_tcp, "EstabResets", &snmp_root.tcp_EstabResets);
191 - arl_expect(arl_tcp, "CurrEstab", &snmp_root.tcp_CurrEstab);
192 - arl_expect(arl_tcp, "InSegs", &snmp_root.tcp_InSegs);
193 - arl_expect(arl_tcp, "OutSegs", &snmp_root.tcp_OutSegs);
194 - arl_expect(arl_tcp, "RetransSegs", &snmp_root.tcp_RetransSegs);
195 - arl_expect(arl_tcp, "InErrs", &snmp_root.tcp_InErrs);
196 - arl_expect(arl_tcp, "OutRsts", &snmp_root.tcp_OutRsts);
197 - arl_expect(arl_tcp, "InCsumErrors", &snmp_root.tcp_InCsumErrors);
198 -
199 - arl_udp = arl_create("snmp/Udp", arl_callback_str2kernel_uint_t, 60);
200 - arl_expect(arl_udp, "InDatagrams", &snmp_root.udp_InDatagrams);
201 - arl_expect(arl_udp, "NoPorts", &snmp_root.udp_NoPorts);
202 - arl_expect(arl_udp, "InErrors", &snmp_root.udp_InErrors);
203 - arl_expect(arl_udp, "OutDatagrams", &snmp_root.udp_OutDatagrams);
204 - arl_expect(arl_udp, "RcvbufErrors", &snmp_root.udp_RcvbufErrors);
205 - arl_expect(arl_udp, "SndbufErrors", &snmp_root.udp_SndbufErrors);
206 - arl_expect(arl_udp, "InCsumErrors", &snmp_root.udp_InCsumErrors);
207 - arl_expect(arl_udp, "IgnoredMulti", &snmp_root.udp_IgnoredMulti);
208 -
209 - arl_udplite = arl_create("snmp/Udplite", arl_callback_str2kernel_uint_t, 60);
210 - arl_expect(arl_udplite, "InDatagrams", &snmp_root.udplite_InDatagrams);
211 - arl_expect(arl_udplite, "NoPorts", &snmp_root.udplite_NoPorts);
212 - arl_expect(arl_udplite, "InErrors", &snmp_root.udplite_InErrors);
213 - arl_expect(arl_udplite, "OutDatagrams", &snmp_root.udplite_OutDatagrams);
214 - arl_expect(arl_udplite, "RcvbufErrors", &snmp_root.udplite_RcvbufErrors);
215 - arl_expect(arl_udplite, "SndbufErrors", &snmp_root.udplite_SndbufErrors);
216 - arl_expect(arl_udplite, "InCsumErrors", &snmp_root.udplite_InCsumErrors);
217 - arl_expect(arl_udplite, "IgnoredMulti", &snmp_root.udplite_IgnoredMulti);
218 -
219 - tcp_max_connections_var = rrdvar_custom_host_variable_add_and_acquire(localhost, "tcp_max_connections");
220 - }
221 -
222 - if(unlikely(!ff)) {
223 - char filename[FILENAME_MAX + 1];
224 - snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, "/proc/net/snmp");
225 - ff = procfile_open(config_get("plugin:proc:/proc/net/snmp", "filename to monitor", filename), " \t:", PROCFILE_FLAG_DEFAULT);
226 - if(unlikely(!ff)) return 1;
227 - }
228 -
229 - ff = procfile_readall(ff);
230 - if(unlikely(!ff)) return 0; // we return 0, so that we will retry to open it next time
231 -
232 - size_t lines = procfile_lines(ff), l;
233 - size_t words, w;
234 -
235 - for(l = 0; l < lines ;l++) {
236 - char *key = procfile_lineword(ff, l, 0);
237 - uint32_t hash = simple_hash(key);
238 -
239 - if(unlikely(hash == hash_ip && strcmp(key, "Ip") == 0)) {
240 - size_t h = l++;
241 -
242 - if(strcmp(procfile_lineword(ff, l, 0), "Ip") != 0) {
243 - error("Cannot read Ip line from /proc/net/snmp.");
244 - break;
245 - }
246 -
247 - words = procfile_linewords(ff, l);
248 - if(words < 3) {
249 - error("Cannot read /proc/net/snmp Ip line. Expected 3+ params, read %zu.", words);
250 - continue;
251 - }
252 -
253 - arl_begin(arl_ip);
254 - for(w = 1; w < words ; w++) {
255 - if (unlikely(arl_check(arl_ip, procfile_lineword(ff, h, w), procfile_lineword(ff, l, w)) != 0))
256 - break;
257 - }
258 -
259 - // --------------------------------------------------------------------
260 -
261 - if(do_ip_packets == CONFIG_BOOLEAN_YES || (do_ip_packets == CONFIG_BOOLEAN_AUTO &&
262 - (snmp_root.ip_OutRequests ||
263 - snmp_root.ip_InReceives ||
264 - snmp_root.ip_ForwDatagrams ||
265 - snmp_root.ip_InDelivers ||
266 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
267 - do_ip_packets = CONFIG_BOOLEAN_YES;
268 -
269 - static RRDSET *st = NULL;
270 - static RRDDIM *rd_InReceives = NULL,
271 - *rd_OutRequests = NULL,
272 - *rd_ForwDatagrams = NULL,
273 - *rd_InDelivers = NULL;
274 -
275 - if(unlikely(!st)) {
276 - st = rrdset_create_localhost(
277 - RRD_TYPE_NET_SNMP
278 - , "packets"
279 - , NULL
280 - , "packets"
281 - , NULL
282 - , "IPv4 Packets"
283 - , "packets/s"
284 - , PLUGIN_PROC_NAME
285 - , PLUGIN_PROC_MODULE_NET_SNMP_NAME
286 - , NETDATA_CHART_PRIO_IPV4_PACKETS
287 - , update_every
288 - , RRDSET_TYPE_LINE
289 - );
290 -
291 - rd_InReceives = rrddim_add(st, "InReceives", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
292 - rd_OutRequests = rrddim_add(st, "OutRequests", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
293 - rd_ForwDatagrams = rrddim_add(st, "ForwDatagrams", "forwarded", 1, 1, RRD_ALGORITHM_INCREMENTAL);
294 - rd_InDelivers = rrddim_add(st, "InDelivers", "delivered", 1, 1, RRD_ALGORITHM_INCREMENTAL);
295 - }
296 - else rrdset_next(st);
297 -
298 - rrddim_set_by_pointer(st, rd_OutRequests, (collected_number)snmp_root.ip_OutRequests);
299 - rrddim_set_by_pointer(st, rd_InReceives, (collected_number)snmp_root.ip_InReceives);
300 - rrddim_set_by_pointer(st, rd_ForwDatagrams, (collected_number)snmp_root.ip_ForwDatagrams);
301 - rrddim_set_by_pointer(st, rd_InDelivers, (collected_number)snmp_root.ip_InDelivers);
302 - rrdset_done(st);
303 - }
304 -
305 - // --------------------------------------------------------------------
306 -
307 - if(do_ip_fragsout == CONFIG_BOOLEAN_YES || (do_ip_fragsout == CONFIG_BOOLEAN_AUTO &&
308 - (snmp_root.ip_FragOKs ||
309 - snmp_root.ip_FragFails ||
310 - snmp_root.ip_FragCreates ||
311 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
312 - do_ip_fragsout = CONFIG_BOOLEAN_YES;
313 -
314 - static RRDSET *st = NULL;
315 - static RRDDIM *rd_FragOKs = NULL,
316 - *rd_FragFails = NULL,
317 - *rd_FragCreates = NULL;
318 -
319 - if(unlikely(!st)) {
320 - st = rrdset_create_localhost(
321 - RRD_TYPE_NET_SNMP
322 - , "fragsout"
323 - , NULL
324 - , "fragments"
325 - , NULL
326 - , "IPv4 Fragments Sent"
327 - , "packets/s"
328 - , PLUGIN_PROC_NAME
329 - , PLUGIN_PROC_MODULE_NET_SNMP_NAME
330 - , NETDATA_CHART_PRIO_IPV4_FRAGMENTS
331 - , update_every
332 - , RRDSET_TYPE_LINE
333 - );
334 - rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
335 -
336 - rd_FragOKs = rrddim_add(st, "FragOKs", "ok", 1, 1, RRD_ALGORITHM_INCREMENTAL);
337 - rd_FragFails = rrddim_add(st, "FragFails", "failed", -1, 1, RRD_ALGORITHM_INCREMENTAL);
338 - rd_FragCreates = rrddim_add(st, "FragCreates", "created", 1, 1, RRD_ALGORITHM_INCREMENTAL);
339 - }
340 - else rrdset_next(st);
341 -
342 - rrddim_set_by_pointer(st, rd_FragOKs, (collected_number)snmp_root.ip_FragOKs);
343 - rrddim_set_by_pointer(st, rd_FragFails, (collected_number)snmp_root.ip_FragFails);
344 - rrddim_set_by_pointer(st, rd_FragCreates, (collected_number)snmp_root.ip_FragCreates);
345 - rrdset_done(st);
346 - }
347 -
348 - // --------------------------------------------------------------------
349 -
350 - if(do_ip_fragsin == CONFIG_BOOLEAN_YES || (do_ip_fragsin == CONFIG_BOOLEAN_AUTO &&
351 - (snmp_root.ip_ReasmOKs ||
352 - snmp_root.ip_ReasmFails ||
353 - snmp_root.ip_ReasmReqds ||
354 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
355 - do_ip_fragsin = CONFIG_BOOLEAN_YES;
356 -
357 - static RRDSET *st = NULL;
358 - static RRDDIM *rd_ReasmOKs = NULL,
359 - *rd_ReasmFails = NULL,
360 - *rd_ReasmReqds = NULL;
361 -
362 - if(unlikely(!st)) {
363 - st = rrdset_create_localhost(
364 - RRD_TYPE_NET_SNMP
365 - , "fragsin"
366 - , NULL
367 - , "fragments"
368 - , NULL
369 - , "IPv4 Fragments Reassembly"
370 - , "packets/s"
371 - , PLUGIN_PROC_NAME
372 - , PLUGIN_PROC_MODULE_NET_SNMP_NAME
373 - , NETDATA_CHART_PRIO_IPV4_FRAGMENTS + 1
374 - , update_every
375 - , RRDSET_TYPE_LINE
376 - );
377 - rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
378 -
379 - rd_ReasmOKs = rrddim_add(st, "ReasmOKs", "ok", 1, 1, RRD_ALGORITHM_INCREMENTAL);
380 - rd_ReasmFails = rrddim_add(st, "ReasmFails", "failed", -1, 1, RRD_ALGORITHM_INCREMENTAL);
381 - rd_ReasmReqds = rrddim_add(st, "ReasmReqds", "all", 1, 1, RRD_ALGORITHM_INCREMENTAL);
382 - }
383 - else rrdset_next(st);
384 -
385 - rrddim_set_by_pointer(st, rd_ReasmOKs, (collected_number)snmp_root.ip_ReasmOKs);
386 - rrddim_set_by_pointer(st, rd_ReasmFails, (collected_number)snmp_root.ip_ReasmFails);
387 - rrddim_set_by_pointer(st, rd_ReasmReqds, (collected_number)snmp_root.ip_ReasmReqds);
388 - rrdset_done(st);
389 - }
390 -
391 - // --------------------------------------------------------------------
392 -
393 - if(do_ip_errors == CONFIG_BOOLEAN_YES || (do_ip_errors == CONFIG_BOOLEAN_AUTO &&
394 - (snmp_root.ip_InDiscards ||
395 - snmp_root.ip_OutDiscards ||
396 - snmp_root.ip_InHdrErrors ||
397 - snmp_root.ip_InAddrErrors ||
398 - snmp_root.ip_InUnknownProtos ||
399 - snmp_root.ip_OutNoRoutes ||
400 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
401 - do_ip_errors = CONFIG_BOOLEAN_YES;
402 -
403 - static RRDSET *st = NULL;
404 - static RRDDIM *rd_InDiscards = NULL,
405 - *rd_OutDiscards = NULL,
406 - *rd_InHdrErrors = NULL,
407 - *rd_OutNoRoutes = NULL,
408 - *rd_InAddrErrors = NULL,
409 - *rd_InUnknownProtos = NULL;
410 -
411 - if(unlikely(!st)) {
412 - st = rrdset_create_localhost(
413 - RRD_TYPE_NET_SNMP
414 - , "errors"
415 - , NULL
416 - , "errors"
417 - , NULL
418 - , "IPv4 Errors"
419 - , "packets/s"
420 - , PLUGIN_PROC_NAME
421 - , PLUGIN_PROC_MODULE_NET_SNMP_NAME
422 - , NETDATA_CHART_PRIO_IPV4_ERRORS
423 - , update_every
424 - , RRDSET_TYPE_LINE
425 - );
426 - rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
427 -
428 - rd_InDiscards = rrddim_add(st, "InDiscards", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
429 - rd_OutDiscards = rrddim_add(st, "OutDiscards", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
430 -
431 - rd_InHdrErrors = rrddim_add(st, "InHdrErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
432 - rd_OutNoRoutes = rrddim_add(st, "OutNoRoutes", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
433 -
434 - rd_InAddrErrors = rrddim_add(st, "InAddrErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
435 - rd_InUnknownProtos = rrddim_add(st, "InUnknownProtos", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
436 - }
437 - else rrdset_next(st);
438 -
439 - rrddim_set_by_pointer(st, rd_InDiscards, (collected_number)snmp_root.ip_InDiscards);
440 - rrddim_set_by_pointer(st, rd_OutDiscards, (collected_number)snmp_root.ip_OutDiscards);
441 - rrddim_set_by_pointer(st, rd_InHdrErrors, (collected_number)snmp_root.ip_InHdrErrors);
442 - rrddim_set_by_pointer(st, rd_InAddrErrors, (collected_number)snmp_root.ip_InAddrErrors);
443 - rrddim_set_by_pointer(st, rd_InUnknownProtos, (collected_number)snmp_root.ip_InUnknownProtos);
444 - rrddim_set_by_pointer(st, rd_OutNoRoutes, (collected_number)snmp_root.ip_OutNoRoutes);
445 - rrdset_done(st);
446 - }
447 - }
448 - else if(unlikely(hash == hash_icmp && strcmp(key, "Icmp") == 0)) {
449 - size_t h = l++;
450 -
451 - if(strcmp(procfile_lineword(ff, l, 0), "Icmp") != 0) {
452 - error("Cannot read Icmp line from /proc/net/snmp.");
453 - break;
454 - }
455 -
456 - words = procfile_linewords(ff, l);
457 - if(words < 3) {
458 - error("Cannot read /proc/net/snmp Icmp line. Expected 3+ params, read %zu.", words);
459 - continue;
460 - }
461 -
462 - arl_begin(arl_icmp);
463 - for(w = 1; w < words ; w++) {
464 - if (unlikely(arl_check(arl_icmp, procfile_lineword(ff, h, w), procfile_lineword(ff, l, w)) != 0))
465 - break;
466 - }
467 -
468 - // --------------------------------------------------------------------
469 -
470 - if(do_icmp_packets == CONFIG_BOOLEAN_YES || (do_icmp_packets == CONFIG_BOOLEAN_AUTO &&
471 - (snmp_root.icmp_InMsgs ||
472 - snmp_root.icmp_OutMsgs ||
473 - snmp_root.icmp_InErrors ||
474 - snmp_root.icmp_OutErrors ||
475 - snmp_root.icmp_InCsumErrors ||
476 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
477 - do_icmp_packets = CONFIG_BOOLEAN_YES;
478 -
479 - {
480 - static RRDSET *st_packets = NULL;
481 - static RRDDIM *rd_InMsgs = NULL,
482 - *rd_OutMsgs = NULL;
483 -
484 - if(unlikely(!st_packets)) {
485 - st_packets = rrdset_create_localhost(
486 - RRD_TYPE_NET_SNMP
487 - , "icmp"
488 - , NULL
489 - , "icmp"
490 - , NULL
491 - , "IPv4 ICMP Packets"
492 - , "packets/s"
493 - , PLUGIN_PROC_NAME
494 - , PLUGIN_PROC_MODULE_NET_SNMP_NAME
495 - , NETDATA_CHART_PRIO_IPV4_ICMP
496 - , update_every
497 - , RRDSET_TYPE_LINE
498 - );
499 -
500 - rd_InMsgs = rrddim_add(st_packets, "InMsgs", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
501 - rd_OutMsgs = rrddim_add(st_packets, "OutMsgs", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
502 - }
503 - else rrdset_next(st_packets);
504 -
505 - rrddim_set_by_pointer(st_packets, rd_InMsgs, (collected_number)snmp_root.icmp_InMsgs);
506 - rrddim_set_by_pointer(st_packets, rd_OutMsgs, (collected_number)snmp_root.icmp_OutMsgs);
507 -
508 - rrdset_done(st_packets);
509 - }
510 -
511 - {
512 - static RRDSET *st_errors = NULL;
513 - static RRDDIM *rd_InErrors = NULL,
514 - *rd_OutErrors = NULL,
515 - *rd_InCsumErrors = NULL;
516 -
517 - if(unlikely(!st_errors)) {
518 - st_errors = rrdset_create_localhost(
519 - RRD_TYPE_NET_SNMP
520 - , "icmp_errors"
521 - , NULL
522 - , "icmp"
523 - , NULL
524 - , "IPv4 ICMP Errors"
525 - , "packets/s"
526 - , PLUGIN_PROC_NAME
527 - , PLUGIN_PROC_MODULE_NET_SNMP_NAME
528 - , NETDATA_CHART_PRIO_IPV4_ICMP + 1
529 - , update_every
530 - , RRDSET_TYPE_LINE
531 - );
532 -
533 - rd_InErrors = rrddim_add(st_errors, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
534 - rd_OutErrors = rrddim_add(st_errors, "OutErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
535 - rd_InCsumErrors = rrddim_add(st_errors, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
536 - }
537 - else rrdset_next(st_errors);
538 -
539 - rrddim_set_by_pointer(st_errors, rd_InErrors, (collected_number)snmp_root.icmp_InErrors);
540 - rrddim_set_by_pointer(st_errors, rd_OutErrors, (collected_number)snmp_root.icmp_OutErrors);
541 - rrddim_set_by_pointer(st_errors, rd_InCsumErrors, (collected_number)snmp_root.icmp_InCsumErrors);
542 -
543 - rrdset_done(st_errors);
544 - }
545 - }
546 - }
547 - else if(unlikely(hash == hash_icmpmsg && strcmp(key, "IcmpMsg") == 0)) {
548 - size_t h = l++;
549 -
550 - if(strcmp(procfile_lineword(ff, l, 0), "IcmpMsg") != 0) {
551 - error("Cannot read IcmpMsg line from /proc/net/snmp.");
552 - break;
553 - }
554 -
555 - words = procfile_linewords(ff, l);
556 - if(words < 2) {
557 - error("Cannot read /proc/net/snmp IcmpMsg line. Expected 2+ params, read %zu.", words);
558 - continue;
559 - }
560 -
561 - arl_begin(arl_icmpmsg);
562 - for(w = 1; w < words ; w++) {
563 - if (unlikely(arl_check(arl_icmpmsg, procfile_lineword(ff, h, w), procfile_lineword(ff, l, w)) != 0))
564 - break;
565 - }
566 -
567 - // --------------------------------------------------------------------
568 -
569 - if(do_icmpmsg == CONFIG_BOOLEAN_YES || (do_icmpmsg == CONFIG_BOOLEAN_AUTO &&
570 - (snmp_root.icmpmsg_InEchoReps ||
571 - snmp_root.icmpmsg_OutEchoReps ||
572 - snmp_root.icmpmsg_InDestUnreachs ||
573 - snmp_root.icmpmsg_OutDestUnreachs ||
574 - snmp_root.icmpmsg_InRedirects ||
575 - snmp_root.icmpmsg_OutRedirects ||
576 - snmp_root.icmpmsg_InEchos ||
577 - snmp_root.icmpmsg_OutEchos ||
578 - snmp_root.icmpmsg_InRouterAdvert ||
579 - snmp_root.icmpmsg_OutRouterAdvert ||
580 - snmp_root.icmpmsg_InRouterSelect ||
581 - snmp_root.icmpmsg_OutRouterSelect ||
582 - snmp_root.icmpmsg_InTimeExcds ||
583 - snmp_root.icmpmsg_OutTimeExcds ||
584 - snmp_root.icmpmsg_InParmProbs ||
585 - snmp_root.icmpmsg_OutParmProbs ||
586 - snmp_root.icmpmsg_InTimestamps ||
587 - snmp_root.icmpmsg_OutTimestamps ||
588 - snmp_root.icmpmsg_InTimestampReps ||
589 - snmp_root.icmpmsg_OutTimestampReps ||
590 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
591 - do_icmpmsg = CONFIG_BOOLEAN_YES;
592 -
593 - static RRDSET *st = NULL;
594 - static RRDDIM *rd_InEchoReps = NULL,
595 - *rd_OutEchoReps = NULL,
596 - *rd_InDestUnreachs = NULL,
597 - *rd_OutDestUnreachs = NULL,
598 - *rd_InRedirects = NULL,
599 - *rd_OutRedirects = NULL,
600 - *rd_InEchos = NULL,
601 - *rd_OutEchos = NULL,
602 - *rd_InRouterAdvert = NULL,
603 - *rd_OutRouterAdvert = NULL,
604 - *rd_InRouterSelect = NULL,
605 - *rd_OutRouterSelect = NULL,
606 - *rd_InTimeExcds = NULL,
607 - *rd_OutTimeExcds = NULL,
608 - *rd_InParmProbs = NULL,
609 - *rd_OutParmProbs = NULL,
610 - *rd_InTimestamps = NULL,
611 - *rd_OutTimestamps = NULL,
612 - *rd_InTimestampReps = NULL,
613 - *rd_OutTimestampReps = NULL;
614 -
615 - if(unlikely(!st)) {
616 - st = rrdset_create_localhost(
617 - RRD_TYPE_NET_SNMP
618 - , "icmpmsg"
619 - , NULL
620 - , "icmp"
621 - , NULL
622 - , "IPv4 ICMP Messages"
623 - , "packets/s"
624 - , PLUGIN_PROC_NAME
625 - , PLUGIN_PROC_MODULE_NET_SNMP_NAME
626 - , NETDATA_CHART_PRIO_IPV4_ICMP + 2
627 - , update_every
628 - , RRDSET_TYPE_LINE
629 - );
630 -
631 - rd_InEchoReps = rrddim_add(st, "InType0", "InEchoReps", 1, 1, RRD_ALGORITHM_INCREMENTAL);
632 - rd_OutEchoReps = rrddim_add(st, "OutType0", "OutEchoReps", -1, 1, RRD_ALGORITHM_INCREMENTAL);
633 - rd_InDestUnreachs = rrddim_add(st, "InType3", "InDestUnreachs", 1, 1, RRD_ALGORITHM_INCREMENTAL);
634 - rd_OutDestUnreachs = rrddim_add(st, "OutType3", "OutDestUnreachs", -1, 1, RRD_ALGORITHM_INCREMENTAL);
635 - rd_InRedirects = rrddim_add(st, "InType5", "InRedirects", 1, 1, RRD_ALGORITHM_INCREMENTAL);
636 - rd_OutRedirects = rrddim_add(st, "OutType5", "OutRedirects", -1, 1, RRD_ALGORITHM_INCREMENTAL);
637 - rd_InEchos = rrddim_add(st, "InType8", "InEchos", 1, 1, RRD_ALGORITHM_INCREMENTAL);
638 - rd_OutEchos = rrddim_add(st, "OutType8", "OutEchos", -1, 1, RRD_ALGORITHM_INCREMENTAL);
639 - rd_InRouterAdvert = rrddim_add(st, "InType9", "InRouterAdvert", 1, 1, RRD_ALGORITHM_INCREMENTAL);
640 - rd_OutRouterAdvert = rrddim_add(st, "OutType9", "OutRouterAdvert", -1, 1, RRD_ALGORITHM_INCREMENTAL);
641 - rd_InRouterSelect = rrddim_add(st, "InType10", "InRouterSelect", 1, 1, RRD_ALGORITHM_INCREMENTAL);
642 - rd_OutRouterSelect = rrddim_add(st, "OutType10", "OutRouterSelect", -1, 1, RRD_ALGORITHM_INCREMENTAL);
643 - rd_InTimeExcds = rrddim_add(st, "InType11", "InTimeExcds", 1, 1, RRD_ALGORITHM_INCREMENTAL);
644 - rd_OutTimeExcds = rrddim_add(st, "OutType11", "OutTimeExcds", -1, 1, RRD_ALGORITHM_INCREMENTAL);
645 - rd_InParmProbs = rrddim_add(st, "InType12", "InParmProbs", 1, 1, RRD_ALGORITHM_INCREMENTAL);
646 - rd_OutParmProbs = rrddim_add(st, "OutType12", "OutParmProbs", -1, 1, RRD_ALGORITHM_INCREMENTAL);
647 - rd_InTimestamps = rrddim_add(st, "InType13", "InTimestamps", 1, 1, RRD_ALGORITHM_INCREMENTAL);
648 - rd_OutTimestamps = rrddim_add(st, "OutType13", "OutTimestamps", -1, 1, RRD_ALGORITHM_INCREMENTAL);
649 - rd_InTimestampReps = rrddim_add(st, "InType14", "InTimestampReps", 1, 1, RRD_ALGORITHM_INCREMENTAL);
650 - rd_OutTimestampReps = rrddim_add(st, "OutType14", "OutTimestampReps", -1, 1, RRD_ALGORITHM_INCREMENTAL);
651 - }
652 - else rrdset_next(st);
653 -
654 - rrddim_set_by_pointer(st, rd_InEchoReps, (collected_number)snmp_root.icmpmsg_InEchoReps);
655 - rrddim_set_by_pointer(st, rd_OutEchoReps, (collected_number)snmp_root.icmpmsg_OutEchoReps);
656 - rrddim_set_by_pointer(st, rd_InDestUnreachs, (collected_number)snmp_root.icmpmsg_InDestUnreachs);
657 - rrddim_set_by_pointer(st, rd_OutDestUnreachs, (collected_number)snmp_root.icmpmsg_OutDestUnreachs);
658 - rrddim_set_by_pointer(st, rd_InRedirects, (collected_number)snmp_root.icmpmsg_InRedirects);
659 - rrddim_set_by_pointer(st, rd_OutRedirects, (collected_number)snmp_root.icmpmsg_OutRedirects);
660 - rrddim_set_by_pointer(st, rd_InEchos, (collected_number)snmp_root.icmpmsg_InEchos);
661 - rrddim_set_by_pointer(st, rd_OutEchos, (collected_number)snmp_root.icmpmsg_OutEchos);
662 - rrddim_set_by_pointer(st, rd_InRouterAdvert, (collected_number)snmp_root.icmpmsg_InRouterAdvert);
663 - rrddim_set_by_pointer(st, rd_OutRouterAdvert, (collected_number)snmp_root.icmpmsg_OutRouterAdvert);
664 - rrddim_set_by_pointer(st, rd_InRouterSelect, (collected_number)snmp_root.icmpmsg_InRouterSelect);
665 - rrddim_set_by_pointer(st, rd_OutRouterSelect, (collected_number)snmp_root.icmpmsg_OutRouterSelect);
666 - rrddim_set_by_pointer(st, rd_InTimeExcds, (collected_number)snmp_root.icmpmsg_InTimeExcds);
667 - rrddim_set_by_pointer(st, rd_OutTimeExcds, (collected_number)snmp_root.icmpmsg_OutTimeExcds);
668 - rrddim_set_by_pointer(st, rd_InParmProbs, (collected_number)snmp_root.icmpmsg_InParmProbs);
669 - rrddim_set_by_pointer(st, rd_OutParmProbs, (collected_number)snmp_root.icmpmsg_OutParmProbs);
670 - rrddim_set_by_pointer(st, rd_InTimestamps, (collected_number)snmp_root.icmpmsg_InTimestamps);
671 - rrddim_set_by_pointer(st, rd_OutTimestamps, (collected_number)snmp_root.icmpmsg_OutTimestamps);
672 - rrddim_set_by_pointer(st, rd_InTimestampReps, (collected_number)snmp_root.icmpmsg_InTimestampReps);
673 - rrddim_set_by_pointer(st, rd_OutTimestampReps, (collected_number)snmp_root.icmpmsg_OutTimestampReps);
674 -
675 - rrdset_done(st);
676 - }
677 - }
678 - else if(unlikely(hash == hash_tcp && strcmp(key, "Tcp") == 0)) {
679 - size_t h = l++;
680 -
681 - if(strcmp(procfile_lineword(ff, l, 0), "Tcp") != 0) {
682 - error("Cannot read Tcp line from /proc/net/snmp.");
683 - break;
684 - }
685 -
686 - words = procfile_linewords(ff, l);
687 - if(words < 3) {
688 - error("Cannot read /proc/net/snmp Tcp line. Expected 3+ params, read %zu.", words);
689 - continue;
690 - }
691 -
692 - arl_begin(arl_tcp);
693 - for(w = 1; w < words ; w++) {
694 - if (unlikely(arl_check(arl_tcp, procfile_lineword(ff, h, w), procfile_lineword(ff, l, w)) != 0))
695 - break;
696 - }
697 -
698 - // --------------------------------------------------------------------
699 -
700 - // this is smart enough to update it, only when it is changed
701 - rrdvar_custom_host_variable_set(localhost, tcp_max_connections_var, snmp_root.tcp_MaxConn);
702 -
703 - // --------------------------------------------------------------------
704 -
705 - // see http://net-snmp.sourceforge.net/docs/mibs/tcp.html
706 - if(do_tcp_sockets == CONFIG_BOOLEAN_YES || (do_tcp_sockets == CONFIG_BOOLEAN_AUTO &&
707 - (snmp_root.tcp_CurrEstab ||
708 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
709 - do_tcp_sockets = CONFIG_BOOLEAN_YES;
710 -
711 - static RRDSET *st = NULL;
712 - static RRDDIM *rd_CurrEstab = NULL;
713 -
714 - if(unlikely(!st)) {
715 - st = rrdset_create_localhost(
716 - RRD_TYPE_NET_SNMP
717 - , "tcpsock"
718 - , NULL
719 - , "tcp"
720 - , NULL
721 - , "IPv4 TCP Connections"
722 - , "active connections"
723 - , PLUGIN_PROC_NAME
724 - , PLUGIN_PROC_MODULE_NET_SNMP_NAME
725 - , NETDATA_CHART_PRIO_IPV4_TCP
726 - , update_every
727 - , RRDSET_TYPE_LINE
728 - );
729 -
730 - rd_CurrEstab = rrddim_add(st, "CurrEstab", "connections", 1, 1, RRD_ALGORITHM_ABSOLUTE);
731 - }
732 - else rrdset_next(st);
733 -
734 - rrddim_set_by_pointer(st, rd_CurrEstab, (collected_number)snmp_root.tcp_CurrEstab);
735 - rrdset_done(st);
736 - }
737 -
738 - // --------------------------------------------------------------------
739 -
740 - if(do_tcp_packets == CONFIG_BOOLEAN_YES || (do_tcp_packets == CONFIG_BOOLEAN_AUTO &&
741 - (snmp_root.tcp_InSegs ||
742 - snmp_root.tcp_OutSegs ||
743 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
744 - do_tcp_packets = CONFIG_BOOLEAN_YES;
745 -
746 - static RRDSET *st = NULL;
747 - static RRDDIM *rd_InSegs = NULL,
748 - *rd_OutSegs = NULL;
749 -
750 - if(unlikely(!st)) {
751 - st = rrdset_create_localhost(
752 - RRD_TYPE_NET_SNMP
753 - , "tcppackets"
754 - , NULL
755 - , "tcp"
756 - , NULL
757 - , "IPv4 TCP Packets"
758 - , "packets/s"
759 - , PLUGIN_PROC_NAME
760 - , PLUGIN_PROC_MODULE_NET_SNMP_NAME
761 - , NETDATA_CHART_PRIO_IPV4_TCP + 4
762 - , update_every
763 - , RRDSET_TYPE_LINE
764 - );
765 -
766 - rd_InSegs = rrddim_add(st, "InSegs", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
767 - rd_OutSegs = rrddim_add(st, "OutSegs", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
768 - }
769 - else rrdset_next(st);
770 -
771 - rrddim_set_by_pointer(st, rd_InSegs, (collected_number)snmp_root.tcp_InSegs);
772 - rrddim_set_by_pointer(st, rd_OutSegs, (collected_number)snmp_root.tcp_OutSegs);
773 - rrdset_done(st);
774 - }
775 -
776 - // --------------------------------------------------------------------
777 -
778 - if(do_tcp_errors == CONFIG_BOOLEAN_YES || (do_tcp_errors == CONFIG_BOOLEAN_AUTO &&
779 - (snmp_root.tcp_InErrs ||
780 - snmp_root.tcp_InCsumErrors ||
781 - snmp_root.tcp_RetransSegs ||
782 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
783 - do_tcp_errors = CONFIG_BOOLEAN_YES;
784 -
785 - static RRDSET *st = NULL;
786 - static RRDDIM *rd_InErrs = NULL,
787 - *rd_InCsumErrors = NULL,
788 - *rd_RetransSegs = NULL;
789 -
790 - if(unlikely(!st)) {
791 - st = rrdset_create_localhost(
792 - RRD_TYPE_NET_SNMP
793 - , "tcperrors"
794 - , NULL
795 - , "tcp"
796 - , NULL
797 - , "IPv4 TCP Errors"
798 - , "packets/s"
799 - , PLUGIN_PROC_NAME
800 - , PLUGIN_PROC_MODULE_NET_SNMP_NAME
801 - , NETDATA_CHART_PRIO_IPV4_TCP + 20
802 - , update_every
803 - , RRDSET_TYPE_LINE
804 - );
805 - rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
806 -
807 - rd_InErrs = rrddim_add(st, "InErrs", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
808 - rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
809 - rd_RetransSegs = rrddim_add(st, "RetransSegs", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
810 - }
811 - else rrdset_next(st);
812 -
813 - rrddim_set_by_pointer(st, rd_InErrs, (collected_number)snmp_root.tcp_InErrs);
814 - rrddim_set_by_pointer(st, rd_InCsumErrors, (collected_number)snmp_root.tcp_InCsumErrors);
815 - rrddim_set_by_pointer(st, rd_RetransSegs, (collected_number)snmp_root.tcp_RetransSegs);
816 - rrdset_done(st);
817 - }
818 -
819 - // --------------------------------------------------------------------
820 -
821 - if(do_tcp_opens == CONFIG_BOOLEAN_YES || (do_tcp_opens == CONFIG_BOOLEAN_AUTO &&
822 - (snmp_root.tcp_ActiveOpens ||
823 - snmp_root.tcp_PassiveOpens ||
824 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
825 - do_tcp_opens = CONFIG_BOOLEAN_YES;
826 -
827 - static RRDSET *st = NULL;
828 - static RRDDIM *rd_ActiveOpens = NULL,
829 - *rd_PassiveOpens = NULL;
830 -
831 - if(unlikely(!st)) {
832 - st = rrdset_create_localhost(
833 - RRD_TYPE_NET_SNMP
834 - , "tcpopens"
835 - , NULL
836 - , "tcp"
837 - , NULL
838 - , "IPv4 TCP Opens"
839 - , "connections/s"
840 - , PLUGIN_PROC_NAME
841 - , PLUGIN_PROC_MODULE_NET_SNMP_NAME
842 - , NETDATA_CHART_PRIO_IPV4_TCP + 5
843 - , update_every
844 - , RRDSET_TYPE_LINE
845 - );
846 - rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
847 -
848 - rd_ActiveOpens = rrddim_add(st, "ActiveOpens", "active", 1, 1, RRD_ALGORITHM_INCREMENTAL);
849 - rd_PassiveOpens = rrddim_add(st, "PassiveOpens", "passive", 1, 1, RRD_ALGORITHM_INCREMENTAL);
850 - }
851 - else rrdset_next(st);
852 -
853 - rrddim_set_by_pointer(st, rd_ActiveOpens, (collected_number)snmp_root.tcp_ActiveOpens);
854 - rrddim_set_by_pointer(st, rd_PassiveOpens, (collected_number)snmp_root.tcp_PassiveOpens);
855 - rrdset_done(st);
856 - }
857 -
858 - // --------------------------------------------------------------------
859 -
860 - if(do_tcp_handshake == CONFIG_BOOLEAN_YES || (do_tcp_handshake == CONFIG_BOOLEAN_AUTO &&
861 - (snmp_root.tcp_EstabResets ||
862 - snmp_root.tcp_OutRsts ||
863 - snmp_root.tcp_AttemptFails ||
864 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
865 - do_tcp_handshake = CONFIG_BOOLEAN_YES;
866 -
867 - static RRDSET *st = NULL;
868 - static RRDDIM *rd_EstabResets = NULL,
869 - *rd_OutRsts = NULL,
870 - *rd_AttemptFails = NULL,
871 - *rd_TCPSynRetrans = NULL;
872 -
873 - if(unlikely(!st)) {
874 - st = rrdset_create_localhost(
875 - RRD_TYPE_NET_SNMP
876 - , "tcphandshake"
877 - , NULL
878 - , "tcp"
879 - , NULL
880 - , "IPv4 TCP Handshake Issues"
881 - , "events/s"
882 - , PLUGIN_PROC_NAME
883 - , PLUGIN_PROC_MODULE_NET_SNMP_NAME
884 - , NETDATA_CHART_PRIO_IPV4_TCP + 30
885 - , update_every
886 - , RRDSET_TYPE_LINE
887 - );
888 - rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
889 -
890 - rd_EstabResets = rrddim_add(st, "EstabResets", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
891 - rd_OutRsts = rrddim_add(st, "OutRsts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
892 - rd_AttemptFails = rrddim_add(st, "AttemptFails", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
893 - rd_TCPSynRetrans = rrddim_add(st, "TCPSynRetrans", "SynRetrans", 1, 1, RRD_ALGORITHM_INCREMENTAL);
894 - }
895 - else rrdset_next(st);
896 -
897 - rrddim_set_by_pointer(st, rd_EstabResets, (collected_number)snmp_root.tcp_EstabResets);
898 - rrddim_set_by_pointer(st, rd_OutRsts, (collected_number)snmp_root.tcp_OutRsts);
899 - rrddim_set_by_pointer(st, rd_AttemptFails, (collected_number)snmp_root.tcp_AttemptFails);
900 - rrddim_set_by_pointer(st, rd_TCPSynRetrans, tcpext_TCPSynRetrans);
901 - rrdset_done(st);
902 - }
903 - }
904 - else if(unlikely(hash == hash_udp && strcmp(key, "Udp") == 0)) {
905 - size_t h = l++;
906 -
907 - if(strcmp(procfile_lineword(ff, l, 0), "Udp") != 0) {
908 - error("Cannot read Udp line from /proc/net/snmp.");
909 - break;
910 - }
911 -
912 - words = procfile_linewords(ff, l);
913 - if(words < 3) {
914 - error("Cannot read /proc/net/snmp Udp line. Expected 3+ params, read %zu.", words);
915 - continue;
916 - }
917 -
918 - arl_begin(arl_udp);
919 - for(w = 1; w < words ; w++) {
920 - if (unlikely(arl_check(arl_udp, procfile_lineword(ff, h, w), procfile_lineword(ff, l, w)) != 0))
921 - break;
922 - }
923 -
924 - // --------------------------------------------------------------------
925 -
926 - // see http://net-snmp.sourceforge.net/docs/mibs/udp.html
927 - if(do_udp_packets == CONFIG_BOOLEAN_YES || (do_udp_packets == CONFIG_BOOLEAN_AUTO &&
928 - (snmp_root.udp_InDatagrams ||
929 - snmp_root.udp_OutDatagrams ||
930 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
931 - do_udp_packets = CONFIG_BOOLEAN_YES;
932 -
933 - static RRDSET *st = NULL;
934 - static RRDDIM *rd_InDatagrams = NULL,
935 - *rd_OutDatagrams = NULL;
936 -
937 - if(unlikely(!st)) {
938 - st = rrdset_create_localhost(
939 - RRD_TYPE_NET_SNMP
940 - , "udppackets"
941 - , NULL
942 - , "udp"
943 - , NULL
944 - , "IPv4 UDP Packets"
945 - , "packets/s"
946 - , PLUGIN_PROC_NAME
947 - , PLUGIN_PROC_MODULE_NET_SNMP_NAME
948 - , NETDATA_CHART_PRIO_IPV4_UDP
949 - , update_every
950 - , RRDSET_TYPE_LINE
951 - );
952 -
953 - rd_InDatagrams = rrddim_add(st, "InDatagrams", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
954 - rd_OutDatagrams = rrddim_add(st, "OutDatagrams", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
955 - }
956 - else rrdset_next(st);
957 -
958 - rrddim_set_by_pointer(st, rd_InDatagrams, (collected_number)snmp_root.udp_InDatagrams);
959 - rrddim_set_by_pointer(st, rd_OutDatagrams, (collected_number)snmp_root.udp_OutDatagrams);
960 - rrdset_done(st);
961 - }
962 -
963 - // --------------------------------------------------------------------
964 -
965 - if(do_udp_errors == CONFIG_BOOLEAN_YES || (do_udp_errors == CONFIG_BOOLEAN_AUTO &&
966 - (snmp_root.udp_InErrors ||
967 - snmp_root.udp_NoPorts ||
968 - snmp_root.udp_RcvbufErrors ||
969 - snmp_root.udp_SndbufErrors ||
970 - snmp_root.udp_InCsumErrors ||
971 - snmp_root.udp_IgnoredMulti ||
972 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
973 - do_udp_errors = CONFIG_BOOLEAN_YES;
974 -
975 - static RRDSET *st = NULL;
976 - static RRDDIM *rd_RcvbufErrors = NULL,
977 - *rd_SndbufErrors = NULL,
978 - *rd_InErrors = NULL,
979 - *rd_NoPorts = NULL,
980 - *rd_InCsumErrors = NULL,
981 - *rd_IgnoredMulti = NULL;
982 -
983 - if(unlikely(!st)) {
984 - st = rrdset_create_localhost(
985 - RRD_TYPE_NET_SNMP
986 - , "udperrors"
987 - , NULL
988 - , "udp"
989 - , NULL
990 - , "IPv4 UDP Errors"
991 - , "events/s"
992 - , PLUGIN_PROC_NAME
993 - , PLUGIN_PROC_MODULE_NET_SNMP_NAME
994 - , NETDATA_CHART_PRIO_IPV4_UDP + 10
995 - , update_every
996 - , RRDSET_TYPE_LINE
997 - );
998 - rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
999 -
1000 - rd_RcvbufErrors = rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1001 - rd_SndbufErrors = rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1002 - rd_InErrors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1003 - rd_NoPorts = rrddim_add(st, "NoPorts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1004 - rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1005 - rd_IgnoredMulti = rrddim_add(st, "IgnoredMulti", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1006 - }
1007 - else rrdset_next(st);
1008 -
1009 - rrddim_set_by_pointer(st, rd_InErrors, (collected_number)snmp_root.udp_InErrors);
1010 - rrddim_set_by_pointer(st, rd_NoPorts, (collected_number)snmp_root.udp_NoPorts);
1011 - rrddim_set_by_pointer(st, rd_RcvbufErrors, (collected_number)snmp_root.udp_RcvbufErrors);
1012 - rrddim_set_by_pointer(st, rd_SndbufErrors, (collected_number)snmp_root.udp_SndbufErrors);
1013 - rrddim_set_by_pointer(st, rd_InCsumErrors, (collected_number)snmp_root.udp_InCsumErrors);
1014 - rrddim_set_by_pointer(st, rd_IgnoredMulti, (collected_number)snmp_root.udp_IgnoredMulti);
1015 - rrdset_done(st);
1016 - }
1017 - }
1018 - else if(unlikely(hash == hash_udplite && strcmp(key, "UdpLite") == 0)) {
1019 - size_t h = l++;
1020 -
1021 - if(strcmp(procfile_lineword(ff, l, 0), "UdpLite") != 0) {
1022 - error("Cannot read UdpLite line from /proc/net/snmp.");
1023 - break;
1024 - }
1025 -
1026 - words = procfile_linewords(ff, l);
1027 - if(words < 3) {
1028 - error("Cannot read /proc/net/snmp UdpLite line. Expected 3+ params, read %zu.", words);
1029 - continue;
1030 - }
1031 -
1032 - arl_begin(arl_udplite);
1033 - for(w = 1; w < words ; w++) {
1034 - if (unlikely(arl_check(arl_udplite, procfile_lineword(ff, h, w), procfile_lineword(ff, l, w)) != 0))
1035 - break;
1036 - }
1037 -
1038 - // --------------------------------------------------------------------
1039 -
1040 - if(do_udplite_packets == CONFIG_BOOLEAN_YES || (do_udplite_packets == CONFIG_BOOLEAN_AUTO &&
1041 - (snmp_root.udplite_InDatagrams ||
1042 - snmp_root.udplite_OutDatagrams ||
1043 - snmp_root.udplite_NoPorts ||
1044 - snmp_root.udplite_InErrors ||
1045 - snmp_root.udplite_InCsumErrors ||
1046 - snmp_root.udplite_RcvbufErrors ||
1047 - snmp_root.udplite_SndbufErrors ||
1048 - snmp_root.udplite_IgnoredMulti ||
1049 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1050 - do_udplite_packets = CONFIG_BOOLEAN_YES;
1051 -
1052 - {
1053 - static RRDSET *st = NULL;
1054 - static RRDDIM *rd_InDatagrams = NULL,
1055 - *rd_OutDatagrams = NULL;
1056 -
1057 - if(unlikely(!st)) {
1058 - st = rrdset_create_localhost(
1059 - RRD_TYPE_NET_SNMP
1060 - , "udplite"
1061 - , NULL
1062 - , "udplite"
1063 - , NULL
1064 - , "IPv4 UDPLite Packets"
1065 - , "packets/s"
1066 - , PLUGIN_PROC_NAME
1067 - , PLUGIN_PROC_MODULE_NET_SNMP_NAME
1068 - , NETDATA_CHART_PRIO_IPV4_UDPLITE
1069 - , update_every
1070 - , RRDSET_TYPE_LINE
1071 - );
1072 -
1073 - rd_InDatagrams = rrddim_add(st, "InDatagrams", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1074 - rd_OutDatagrams = rrddim_add(st, "OutDatagrams", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1075 - }
1076 - else rrdset_next(st);
1077 -
1078 - rrddim_set_by_pointer(st, rd_InDatagrams, (collected_number)snmp_root.udplite_InDatagrams);
1079 - rrddim_set_by_pointer(st, rd_OutDatagrams, (collected_number)snmp_root.udplite_OutDatagrams);
1080 - rrdset_done(st);
1081 - }
1082 -
1083 - {
1084 - static RRDSET *st = NULL;
1085 - static RRDDIM *rd_RcvbufErrors = NULL,
1086 - *rd_SndbufErrors = NULL,
1087 - *rd_InErrors = NULL,
1088 - *rd_NoPorts = NULL,
1089 - *rd_InCsumErrors = NULL,
1090 - *rd_IgnoredMulti = NULL;
1091 -
1092 - if(unlikely(!st)) {
1093 - st = rrdset_create_localhost(
1094 - RRD_TYPE_NET_SNMP
1095 - , "udplite_errors"
1096 - , NULL
1097 - , "udplite"
1098 - , NULL
1099 - , "IPv4 UDPLite Errors"
1100 - , "packets/s"
1101 - , PLUGIN_PROC_NAME
1102 - , PLUGIN_PROC_MODULE_NET_SNMP_NAME
1103 - , NETDATA_CHART_PRIO_IPV4_UDPLITE + 10
1104 - , update_every
1105 - , RRDSET_TYPE_LINE);
1106 -
1107 - rd_RcvbufErrors = rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1108 - rd_SndbufErrors = rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1109 - rd_InErrors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1110 - rd_NoPorts = rrddim_add(st, "NoPorts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1111 - rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1112 - rd_IgnoredMulti = rrddim_add(st, "IgnoredMulti", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1113 - }
1114 - else rrdset_next(st);
1115 -
1116 - rrddim_set_by_pointer(st, rd_NoPorts, (collected_number)snmp_root.udplite_NoPorts);
1117 - rrddim_set_by_pointer(st, rd_InErrors, (collected_number)snmp_root.udplite_InErrors);
1118 - rrddim_set_by_pointer(st, rd_InCsumErrors, (collected_number)snmp_root.udplite_InCsumErrors);
1119 - rrddim_set_by_pointer(st, rd_RcvbufErrors, (collected_number)snmp_root.udplite_RcvbufErrors);
1120 - rrddim_set_by_pointer(st, rd_SndbufErrors, (collected_number)snmp_root.udplite_SndbufErrors);
1121 - rrddim_set_by_pointer(st, rd_IgnoredMulti, (collected_number)snmp_root.udplite_IgnoredMulti);
1122 - rrdset_done(st);
1123 - }
1124 - }
1125 - }
1126 - }
1127 -
1128 - return 0;
1129 -}
1130 -
collectors/proc.plugin/proc_net_snmp6.c deleted
-1293
@@ -1,1293 +0,0 @@
1 -// SPDX-License-Identifier: GPL-3.0-or-later
2 -
3 -#include "plugin_proc.h"
4 -
5 -#define RRD_TYPE_NET_SNMP6 "ipv6"
6 -#define PLUGIN_PROC_MODULE_NET_SNMP6_NAME "/proc/net/snmp6"
7 -
8 -int do_proc_net_snmp6(int update_every, usec_t dt) {
9 - (void)dt;
10 -
11 - static procfile *ff = NULL;
12 -
13 - static int do_ip_packets = -1,
14 - do_ip_fragsout = -1,
15 - do_ip_fragsin = -1,
16 - do_ip_errors = -1,
17 - do_udplite_packets = -1,
18 - do_udplite_errors = -1,
19 - do_udp_packets = -1,
20 - do_udp_errors = -1,
21 - do_bandwidth = -1,
22 - do_mcast = -1,
23 - do_bcast = -1,
24 - do_mcast_p = -1,
25 - do_icmp = -1,
26 - do_icmp_redir = -1,
27 - do_icmp_errors = -1,
28 - do_icmp_echos = -1,
29 - do_icmp_groupmemb = -1,
30 - do_icmp_router = -1,
31 - do_icmp_neighbor = -1,
32 - do_icmp_mldv2 = -1,
33 - do_icmp_types = -1,
34 - do_ect = -1;
35 -
36 - static ARL_BASE *arl_base = NULL;
37 -
38 - static unsigned long long Ip6InReceives = 0ULL;
39 - static unsigned long long Ip6InHdrErrors = 0ULL;
40 - static unsigned long long Ip6InTooBigErrors = 0ULL;
41 - static unsigned long long Ip6InNoRoutes = 0ULL;
42 - static unsigned long long Ip6InAddrErrors = 0ULL;
43 - static unsigned long long Ip6InUnknownProtos = 0ULL;
44 - static unsigned long long Ip6InTruncatedPkts = 0ULL;
45 - static unsigned long long Ip6InDiscards = 0ULL;
46 - static unsigned long long Ip6InDelivers = 0ULL;
47 - static unsigned long long Ip6OutForwDatagrams = 0ULL;
48 - static unsigned long long Ip6OutRequests = 0ULL;
49 - static unsigned long long Ip6OutDiscards = 0ULL;
50 - static unsigned long long Ip6OutNoRoutes = 0ULL;
51 - static unsigned long long Ip6ReasmTimeout = 0ULL;
52 - static unsigned long long Ip6ReasmReqds = 0ULL;
53 - static unsigned long long Ip6ReasmOKs = 0ULL;
54 - static unsigned long long Ip6ReasmFails = 0ULL;
55 - static unsigned long long Ip6FragOKs = 0ULL;
56 - static unsigned long long Ip6FragFails = 0ULL;
57 - static unsigned long long Ip6FragCreates = 0ULL;
58 - static unsigned long long Ip6InMcastPkts = 0ULL;
59 - static unsigned long long Ip6OutMcastPkts = 0ULL;
60 - static unsigned long long Ip6InOctets = 0ULL;
61 - static unsigned long long Ip6OutOctets = 0ULL;
62 - static unsigned long long Ip6InMcastOctets = 0ULL;
63 - static unsigned long long Ip6OutMcastOctets = 0ULL;
64 - static unsigned long long Ip6InBcastOctets = 0ULL;
65 - static unsigned long long Ip6OutBcastOctets = 0ULL;
66 - static unsigned long long Ip6InNoECTPkts = 0ULL;
67 - static unsigned long long Ip6InECT1Pkts = 0ULL;
68 - static unsigned long long Ip6InECT0Pkts = 0ULL;
69 - static unsigned long long Ip6InCEPkts = 0ULL;
70 - static unsigned long long Icmp6InMsgs = 0ULL;
71 - static unsigned long long Icmp6InErrors = 0ULL;
72 - static unsigned long long Icmp6OutMsgs = 0ULL;
73 - static unsigned long long Icmp6OutErrors = 0ULL;
74 - static unsigned long long Icmp6InCsumErrors = 0ULL;
75 - static unsigned long long Icmp6InDestUnreachs = 0ULL;
76 - static unsigned long long Icmp6InPktTooBigs = 0ULL;
77 - static unsigned long long Icmp6InTimeExcds = 0ULL;
78 - static unsigned long long Icmp6InParmProblems = 0ULL;
79 - static unsigned long long Icmp6InEchos = 0ULL;
80 - static unsigned long long Icmp6InEchoReplies = 0ULL;
81 - static unsigned long long Icmp6InGroupMembQueries = 0ULL;
82 - static unsigned long long Icmp6InGroupMembResponses = 0ULL;
83 - static unsigned long long Icmp6InGroupMembReductions = 0ULL;
84 - static unsigned long long Icmp6InRouterSolicits = 0ULL;
85 - static unsigned long long Icmp6InRouterAdvertisements = 0ULL;
86 - static unsigned long long Icmp6InNeighborSolicits = 0ULL;
87 - static unsigned long long Icmp6InNeighborAdvertisements = 0ULL;
88 - static unsigned long long Icmp6InRedirects = 0ULL;
89 - static unsigned long long Icmp6InMLDv2Reports = 0ULL;
90 - static unsigned long long Icmp6OutDestUnreachs = 0ULL;
91 - static unsigned long long Icmp6OutPktTooBigs = 0ULL;
92 - static unsigned long long Icmp6OutTimeExcds = 0ULL;
93 - static unsigned long long Icmp6OutParmProblems = 0ULL;
94 - static unsigned long long Icmp6OutEchos = 0ULL;
95 - static unsigned long long Icmp6OutEchoReplies = 0ULL;
96 - static unsigned long long Icmp6OutGroupMembQueries = 0ULL;
97 - static unsigned long long Icmp6OutGroupMembResponses = 0ULL;
98 - static unsigned long long Icmp6OutGroupMembReductions = 0ULL;
99 - static unsigned long long Icmp6OutRouterSolicits = 0ULL;
100 - static unsigned long long Icmp6OutRouterAdvertisements = 0ULL;
101 - static unsigned long long Icmp6OutNeighborSolicits = 0ULL;
102 - static unsigned long long Icmp6OutNeighborAdvertisements = 0ULL;
103 - static unsigned long long Icmp6OutRedirects = 0ULL;
104 - static unsigned long long Icmp6OutMLDv2Reports = 0ULL;
105 - static unsigned long long Icmp6InType1 = 0ULL;
106 - static unsigned long long Icmp6InType128 = 0ULL;
107 - static unsigned long long Icmp6InType129 = 0ULL;
108 - static unsigned long long Icmp6InType136 = 0ULL;
109 - static unsigned long long Icmp6OutType1 = 0ULL;
110 - static unsigned long long Icmp6OutType128 = 0ULL;
111 - static unsigned long long Icmp6OutType129 = 0ULL;
112 - static unsigned long long Icmp6OutType133 = 0ULL;
113 - static unsigned long long Icmp6OutType135 = 0ULL;
114 - static unsigned long long Icmp6OutType143 = 0ULL;
115 - static unsigned long long Udp6InDatagrams = 0ULL;
116 - static unsigned long long Udp6NoPorts = 0ULL;
117 - static unsigned long long Udp6InErrors = 0ULL;
118 - static unsigned long long Udp6OutDatagrams = 0ULL;
119 - static unsigned long long Udp6RcvbufErrors = 0ULL;
120 - static unsigned long long Udp6SndbufErrors = 0ULL;
121 - static unsigned long long Udp6InCsumErrors = 0ULL;
122 - static unsigned long long Udp6IgnoredMulti = 0ULL;
123 - static unsigned long long UdpLite6InDatagrams = 0ULL;
124 - static unsigned long long UdpLite6NoPorts = 0ULL;
125 - static unsigned long long UdpLite6InErrors = 0ULL;
126 - static unsigned long long UdpLite6OutDatagrams = 0ULL;
127 - static unsigned long long UdpLite6RcvbufErrors = 0ULL;
128 - static unsigned long long UdpLite6SndbufErrors = 0ULL;
129 - static unsigned long long UdpLite6InCsumErrors = 0ULL;
130 -
131 - if(unlikely(!arl_base)) {
132 - do_ip_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 packets", CONFIG_BOOLEAN_AUTO);
133 - do_ip_fragsout = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 fragments sent", CONFIG_BOOLEAN_AUTO);
134 - do_ip_fragsin = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 fragments assembly", CONFIG_BOOLEAN_AUTO);
135 - do_ip_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 errors", CONFIG_BOOLEAN_AUTO);
136 - do_udp_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDP packets", CONFIG_BOOLEAN_AUTO);
137 - do_udp_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDP errors", CONFIG_BOOLEAN_AUTO);
138 - do_udplite_packets = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDPlite packets", CONFIG_BOOLEAN_AUTO);
139 - do_udplite_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ipv6 UDPlite errors", CONFIG_BOOLEAN_AUTO);
140 - do_bandwidth = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "bandwidth", CONFIG_BOOLEAN_AUTO);
141 - do_mcast = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "multicast bandwidth", CONFIG_BOOLEAN_AUTO);
142 - do_bcast = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "broadcast bandwidth", CONFIG_BOOLEAN_AUTO);
143 - do_mcast_p = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "multicast packets", CONFIG_BOOLEAN_AUTO);
144 - do_icmp = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp", CONFIG_BOOLEAN_AUTO);
145 - do_icmp_redir = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp redirects", CONFIG_BOOLEAN_AUTO);
146 - do_icmp_errors = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp errors", CONFIG_BOOLEAN_AUTO);
147 - do_icmp_echos = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp echos", CONFIG_BOOLEAN_AUTO);
148 - do_icmp_groupmemb = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp group membership", CONFIG_BOOLEAN_AUTO);
149 - do_icmp_router = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp router", CONFIG_BOOLEAN_AUTO);
150 - do_icmp_neighbor = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp neighbor", CONFIG_BOOLEAN_AUTO);
151 - do_icmp_mldv2 = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp mldv2", CONFIG_BOOLEAN_AUTO);
152 - do_icmp_types = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "icmp types", CONFIG_BOOLEAN_AUTO);
153 - do_ect = config_get_boolean_ondemand("plugin:proc:/proc/net/snmp6", "ect", CONFIG_BOOLEAN_AUTO);
154 -
155 - arl_base = arl_create("snmp6", NULL, 60);
156 - arl_expect(arl_base, "Ip6InReceives", &Ip6InReceives);
157 - arl_expect(arl_base, "Ip6InHdrErrors", &Ip6InHdrErrors);
158 - arl_expect(arl_base, "Ip6InTooBigErrors", &Ip6InTooBigErrors);
159 - arl_expect(arl_base, "Ip6InNoRoutes", &Ip6InNoRoutes);
160 - arl_expect(arl_base, "Ip6InAddrErrors", &Ip6InAddrErrors);
161 - arl_expect(arl_base, "Ip6InUnknownProtos", &Ip6InUnknownProtos);
162 - arl_expect(arl_base, "Ip6InTruncatedPkts", &Ip6InTruncatedPkts);
163 - arl_expect(arl_base, "Ip6InDiscards", &Ip6InDiscards);
164 - arl_expect(arl_base, "Ip6InDelivers", &Ip6InDelivers);
165 - arl_expect(arl_base, "Ip6OutForwDatagrams", &Ip6OutForwDatagrams);
166 - arl_expect(arl_base, "Ip6OutRequests", &Ip6OutRequests);
167 - arl_expect(arl_base, "Ip6OutDiscards", &Ip6OutDiscards);
168 - arl_expect(arl_base, "Ip6OutNoRoutes", &Ip6OutNoRoutes);
169 - arl_expect(arl_base, "Ip6ReasmTimeout", &Ip6ReasmTimeout);
170 - arl_expect(arl_base, "Ip6ReasmReqds", &Ip6ReasmReqds);
171 - arl_expect(arl_base, "Ip6ReasmOKs", &Ip6ReasmOKs);
172 - arl_expect(arl_base, "Ip6ReasmFails", &Ip6ReasmFails);
173 - arl_expect(arl_base, "Ip6FragOKs", &Ip6FragOKs);
174 - arl_expect(arl_base, "Ip6FragFails", &Ip6FragFails);
175 - arl_expect(arl_base, "Ip6FragCreates", &Ip6FragCreates);
176 - arl_expect(arl_base, "Ip6InMcastPkts", &Ip6InMcastPkts);
177 - arl_expect(arl_base, "Ip6OutMcastPkts", &Ip6OutMcastPkts);
178 - arl_expect(arl_base, "Ip6InOctets", &Ip6InOctets);
179 - arl_expect(arl_base, "Ip6OutOctets", &Ip6OutOctets);
180 - arl_expect(arl_base, "Ip6InMcastOctets", &Ip6InMcastOctets);
181 - arl_expect(arl_base, "Ip6OutMcastOctets", &Ip6OutMcastOctets);
182 - arl_expect(arl_base, "Ip6InBcastOctets", &Ip6InBcastOctets);
183 - arl_expect(arl_base, "Ip6OutBcastOctets", &Ip6OutBcastOctets);
184 - arl_expect(arl_base, "Ip6InNoECTPkts", &Ip6InNoECTPkts);
185 - arl_expect(arl_base, "Ip6InECT1Pkts", &Ip6InECT1Pkts);
186 - arl_expect(arl_base, "Ip6InECT0Pkts", &Ip6InECT0Pkts);
187 - arl_expect(arl_base, "Ip6InCEPkts", &Ip6InCEPkts);
188 - arl_expect(arl_base, "Icmp6InMsgs", &Icmp6InMsgs);
189 - arl_expect(arl_base, "Icmp6InErrors", &Icmp6InErrors);
190 - arl_expect(arl_base, "Icmp6OutMsgs", &Icmp6OutMsgs);
191 - arl_expect(arl_base, "Icmp6OutErrors", &Icmp6OutErrors);
192 - arl_expect(arl_base, "Icmp6InCsumErrors", &Icmp6InCsumErrors);
193 - arl_expect(arl_base, "Icmp6InDestUnreachs", &Icmp6InDestUnreachs);
194 - arl_expect(arl_base, "Icmp6InPktTooBigs", &Icmp6InPktTooBigs);
195 - arl_expect(arl_base, "Icmp6InTimeExcds", &Icmp6InTimeExcds);
196 - arl_expect(arl_base, "Icmp6InParmProblems", &Icmp6InParmProblems);
197 - arl_expect(arl_base, "Icmp6InEchos", &Icmp6InEchos);
198 - arl_expect(arl_base, "Icmp6InEchoReplies", &Icmp6InEchoReplies);
199 - arl_expect(arl_base, "Icmp6InGroupMembQueries", &Icmp6InGroupMembQueries);
200 - arl_expect(arl_base, "Icmp6InGroupMembResponses", &Icmp6InGroupMembResponses);
201 - arl_expect(arl_base, "Icmp6InGroupMembReductions", &Icmp6InGroupMembReductions);
202 - arl_expect(arl_base, "Icmp6InRouterSolicits", &Icmp6InRouterSolicits);
203 - arl_expect(arl_base, "Icmp6InRouterAdvertisements", &Icmp6InRouterAdvertisements);
204 - arl_expect(arl_base, "Icmp6InNeighborSolicits", &Icmp6InNeighborSolicits);
205 - arl_expect(arl_base, "Icmp6InNeighborAdvertisements", &Icmp6InNeighborAdvertisements);
206 - arl_expect(arl_base, "Icmp6InRedirects", &Icmp6InRedirects);
207 - arl_expect(arl_base, "Icmp6InMLDv2Reports", &Icmp6InMLDv2Reports);
208 - arl_expect(arl_base, "Icmp6OutDestUnreachs", &Icmp6OutDestUnreachs);
209 - arl_expect(arl_base, "Icmp6OutPktTooBigs", &Icmp6OutPktTooBigs);
210 - arl_expect(arl_base, "Icmp6OutTimeExcds", &Icmp6OutTimeExcds);
211 - arl_expect(arl_base, "Icmp6OutParmProblems", &Icmp6OutParmProblems);
212 - arl_expect(arl_base, "Icmp6OutEchos", &Icmp6OutEchos);
213 - arl_expect(arl_base, "Icmp6OutEchoReplies", &Icmp6OutEchoReplies);
214 - arl_expect(arl_base, "Icmp6OutGroupMembQueries", &Icmp6OutGroupMembQueries);
215 - arl_expect(arl_base, "Icmp6OutGroupMembResponses", &Icmp6OutGroupMembResponses);
216 - arl_expect(arl_base, "Icmp6OutGroupMembReductions", &Icmp6OutGroupMembReductions);
217 - arl_expect(arl_base, "Icmp6OutRouterSolicits", &Icmp6OutRouterSolicits);
218 - arl_expect(arl_base, "Icmp6OutRouterAdvertisements", &Icmp6OutRouterAdvertisements);
219 - arl_expect(arl_base, "Icmp6OutNeighborSolicits", &Icmp6OutNeighborSolicits);
220 - arl_expect(arl_base, "Icmp6OutNeighborAdvertisements", &Icmp6OutNeighborAdvertisements);
221 - arl_expect(arl_base, "Icmp6OutRedirects", &Icmp6OutRedirects);
222 - arl_expect(arl_base, "Icmp6OutMLDv2Reports", &Icmp6OutMLDv2Reports);
223 - arl_expect(arl_base, "Icmp6InType1", &Icmp6InType1);
224 - arl_expect(arl_base, "Icmp6InType128", &Icmp6InType128);
225 - arl_expect(arl_base, "Icmp6InType129", &Icmp6InType129);
226 - arl_expect(arl_base, "Icmp6InType136", &Icmp6InType136);
227 - arl_expect(arl_base, "Icmp6OutType1", &Icmp6OutType1);
228 - arl_expect(arl_base, "Icmp6OutType128", &Icmp6OutType128);
229 - arl_expect(arl_base, "Icmp6OutType129", &Icmp6OutType129);
230 - arl_expect(arl_base, "Icmp6OutType133", &Icmp6OutType133);
231 - arl_expect(arl_base, "Icmp6OutType135", &Icmp6OutType135);
232 - arl_expect(arl_base, "Icmp6OutType143", &Icmp6OutType143);
233 - arl_expect(arl_base, "Udp6InDatagrams", &Udp6InDatagrams);
234 - arl_expect(arl_base, "Udp6NoPorts", &Udp6NoPorts);
235 - arl_expect(arl_base, "Udp6InErrors", &Udp6InErrors);
236 - arl_expect(arl_base, "Udp6OutDatagrams", &Udp6OutDatagrams);
237 - arl_expect(arl_base, "Udp6RcvbufErrors", &Udp6RcvbufErrors);
238 - arl_expect(arl_base, "Udp6SndbufErrors", &Udp6SndbufErrors);
239 - arl_expect(arl_base, "Udp6InCsumErrors", &Udp6InCsumErrors);
240 - arl_expect(arl_base, "Udp6IgnoredMulti", &Udp6IgnoredMulti);
241 - arl_expect(arl_base, "UdpLite6InDatagrams", &UdpLite6InDatagrams);
242 - arl_expect(arl_base, "UdpLite6NoPorts", &UdpLite6NoPorts);
243 - arl_expect(arl_base, "UdpLite6InErrors", &UdpLite6InErrors);
244 - arl_expect(arl_base, "UdpLite6OutDatagrams", &UdpLite6OutDatagrams);
245 - arl_expect(arl_base, "UdpLite6RcvbufErrors", &UdpLite6RcvbufErrors);
246 - arl_expect(arl_base, "UdpLite6SndbufErrors", &UdpLite6SndbufErrors);
247 - arl_expect(arl_base, "UdpLite6InCsumErrors", &UdpLite6InCsumErrors);
248 - }
249 -
250 - if(unlikely(!ff)) {
251 - char filename[FILENAME_MAX + 1];
252 - snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, "/proc/net/snmp6");
253 - ff = procfile_open(config_get("plugin:proc:/proc/net/snmp6", "filename to monitor", filename), " \t:", PROCFILE_FLAG_DEFAULT);
254 - if(unlikely(!ff))
255 - return 1;
256 - }
257 -
258 - ff = procfile_readall(ff);
259 - if(unlikely(!ff))
260 - return 0; // we return 0, so that we will retry to open it next time
261 -
262 - size_t lines = procfile_lines(ff), l;
263 -
264 - arl_begin(arl_base);
265 -
266 - for(l = 0; l < lines ;l++) {
267 - size_t words = procfile_linewords(ff, l);
268 - if(unlikely(words < 2)) {
269 - if(unlikely(words)) error("Cannot read /proc/net/snmp6 line %zu. Expected 2 params, read %zu.", l, words);
270 - continue;
271 - }
272 -
273 - if(unlikely(arl_check(arl_base,
274 - procfile_lineword(ff, l, 0),
275 - procfile_lineword(ff, l, 1)))) break;
276 - }
277 -
278 - // --------------------------------------------------------------------
279 -
280 - if(do_bandwidth == CONFIG_BOOLEAN_YES || (do_bandwidth == CONFIG_BOOLEAN_AUTO &&
281 - (Ip6InOctets ||
282 - Ip6OutOctets ||
283 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
284 - do_bandwidth = CONFIG_BOOLEAN_YES;
285 - static RRDSET *st = NULL;
286 - static RRDDIM *rd_received = NULL,
287 - *rd_sent = NULL;
288 -
289 - if(unlikely(!st)) {
290 - st = rrdset_create_localhost(
291 - "system"
292 - , "ipv6"
293 - , NULL
294 - , "network"
295 - , NULL
296 - , "IPv6 Bandwidth"
297 - , "kilobits/s"
298 - , PLUGIN_PROC_NAME
299 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
300 - , NETDATA_CHART_PRIO_SYSTEM_IPV6
301 - , update_every
302 - , RRDSET_TYPE_AREA
303 - );
304 -
305 - rd_received = rrddim_add(st, "InOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
306 - rd_sent = rrddim_add(st, "OutOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
307 - }
308 - else rrdset_next(st);
309 -
310 - rrddim_set_by_pointer(st, rd_received, Ip6InOctets);
311 - rrddim_set_by_pointer(st, rd_sent, Ip6OutOctets);
312 - rrdset_done(st);
313 - }
314 -
315 - // --------------------------------------------------------------------
316 -
317 - if(do_ip_packets == CONFIG_BOOLEAN_YES || (do_ip_packets == CONFIG_BOOLEAN_AUTO &&
318 - (Ip6InReceives ||
319 - Ip6OutRequests ||
320 - Ip6InDelivers ||
321 - Ip6OutForwDatagrams ||
322 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
323 - do_ip_packets = CONFIG_BOOLEAN_YES;
324 - static RRDSET *st = NULL;
325 - static RRDDIM *rd_received = NULL,
326 - *rd_sent = NULL,
327 - *rd_forwarded = NULL,
328 - *rd_delivers = NULL;
329 -
330 - if(unlikely(!st)) {
331 - st = rrdset_create_localhost(
332 - RRD_TYPE_NET_SNMP6
333 - , "packets"
334 - , NULL
335 - , "packets"
336 - , NULL
337 - , "IPv6 Packets"
338 - , "packets/s"
339 - , PLUGIN_PROC_NAME
340 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
341 - , NETDATA_CHART_PRIO_IPV6_PACKETS
342 - , update_every
343 - , RRDSET_TYPE_LINE
344 - );
345 -
346 - rd_received = rrddim_add(st, "InReceives", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
347 - rd_sent = rrddim_add(st, "OutRequests", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
348 - rd_forwarded = rrddim_add(st, "OutForwDatagrams", "forwarded", -1, 1, RRD_ALGORITHM_INCREMENTAL);
349 - rd_delivers = rrddim_add(st, "InDelivers", "delivers", 1, 1, RRD_ALGORITHM_INCREMENTAL);
350 - }
351 - else rrdset_next(st);
352 -
353 - rrddim_set_by_pointer(st, rd_received, Ip6InReceives);
354 - rrddim_set_by_pointer(st, rd_sent, Ip6OutRequests);
355 - rrddim_set_by_pointer(st, rd_forwarded, Ip6OutForwDatagrams);
356 - rrddim_set_by_pointer(st, rd_delivers, Ip6InDelivers);
357 - rrdset_done(st);
358 - }
359 -
360 - // --------------------------------------------------------------------
361 -
362 - if(do_ip_fragsout == CONFIG_BOOLEAN_YES || (do_ip_fragsout == CONFIG_BOOLEAN_AUTO &&
363 - (Ip6FragOKs ||
364 - Ip6FragFails ||
365 - Ip6FragCreates ||
366 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
367 - do_ip_fragsout = CONFIG_BOOLEAN_YES;
368 - static RRDSET *st = NULL;
369 - static RRDDIM *rd_ok = NULL,
370 - *rd_failed = NULL,
371 - *rd_all = NULL;
372 -
373 - if(unlikely(!st)) {
374 - st = rrdset_create_localhost(
375 - RRD_TYPE_NET_SNMP6
376 - , "fragsout"
377 - , NULL
378 - , "fragments6"
379 - , NULL
380 - , "IPv6 Fragments Sent"
381 - , "packets/s"
382 - , PLUGIN_PROC_NAME
383 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
384 - , NETDATA_CHART_PRIO_IPV6_FRAGSOUT
385 - , update_every
386 - , RRDSET_TYPE_LINE
387 - );
388 - rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
389 -
390 - rd_ok = rrddim_add(st, "FragOKs", "ok", 1, 1, RRD_ALGORITHM_INCREMENTAL);
391 - rd_failed = rrddim_add(st, "FragFails", "failed", -1, 1, RRD_ALGORITHM_INCREMENTAL);
392 - rd_all = rrddim_add(st, "FragCreates", "all", 1, 1, RRD_ALGORITHM_INCREMENTAL);
393 - }
394 - else rrdset_next(st);
395 -
396 - rrddim_set_by_pointer(st, rd_ok, Ip6FragOKs);
397 - rrddim_set_by_pointer(st, rd_failed, Ip6FragFails);
398 - rrddim_set_by_pointer(st, rd_all, Ip6FragCreates);
399 - rrdset_done(st);
400 - }
401 -
402 - // --------------------------------------------------------------------
403 -
404 - if(do_ip_fragsin == CONFIG_BOOLEAN_YES || (do_ip_fragsin == CONFIG_BOOLEAN_AUTO &&
405 - (Ip6ReasmOKs ||
406 - Ip6ReasmFails ||
407 - Ip6ReasmTimeout ||
408 - Ip6ReasmReqds ||
409 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
410 - do_ip_fragsin = CONFIG_BOOLEAN_YES;
411 -
412 - static RRDSET *st = NULL;
413 - static RRDDIM *rd_ok = NULL,
414 - *rd_failed = NULL,
415 - *rd_timeout = NULL,
416 - *rd_all = NULL;
417 -
418 - if(unlikely(!st)) {
419 - st = rrdset_create_localhost(
420 - RRD_TYPE_NET_SNMP6
421 - , "fragsin"
422 - , NULL
423 - , "fragments6"
424 - , NULL
425 - , "IPv6 Fragments Reassembly"
426 - , "packets/s"
427 - , PLUGIN_PROC_NAME
428 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
429 - , NETDATA_CHART_PRIO_IPV6_FRAGSIN
430 - , update_every
431 - , RRDSET_TYPE_LINE);
432 - rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
433 -
434 - rd_ok = rrddim_add(st, "ReasmOKs", "ok", 1, 1, RRD_ALGORITHM_INCREMENTAL);
435 - rd_failed = rrddim_add(st, "ReasmFails", "failed", -1, 1, RRD_ALGORITHM_INCREMENTAL);
436 - rd_timeout = rrddim_add(st, "ReasmTimeout", "timeout", -1, 1, RRD_ALGORITHM_INCREMENTAL);
437 - rd_all = rrddim_add(st, "ReasmReqds", "all", 1, 1, RRD_ALGORITHM_INCREMENTAL);
438 - }
439 - else rrdset_next(st);
440 -
441 - rrddim_set_by_pointer(st, rd_ok, Ip6ReasmOKs);
442 - rrddim_set_by_pointer(st, rd_failed, Ip6ReasmFails);
443 - rrddim_set_by_pointer(st, rd_timeout, Ip6ReasmTimeout);
444 - rrddim_set_by_pointer(st, rd_all, Ip6ReasmReqds);
445 - rrdset_done(st);
446 - }
447 -
448 - // --------------------------------------------------------------------
449 -
450 - if(do_ip_errors == CONFIG_BOOLEAN_YES || (do_ip_errors == CONFIG_BOOLEAN_AUTO &&
451 - (Ip6InDiscards ||
452 - Ip6OutDiscards ||
453 - Ip6InHdrErrors ||
454 - Ip6InAddrErrors ||
455 - Ip6InUnknownProtos ||
456 - Ip6InTooBigErrors ||
457 - Ip6InTruncatedPkts ||
458 - Ip6InNoRoutes ||
459 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
460 - do_ip_errors = CONFIG_BOOLEAN_YES;
461 - static RRDSET *st = NULL;
462 - static RRDDIM *rd_InDiscards = NULL,
463 - *rd_OutDiscards = NULL,
464 - *rd_InHdrErrors = NULL,
465 - *rd_InAddrErrors = NULL,
466 - *rd_InUnknownProtos = NULL,
467 - *rd_InTooBigErrors = NULL,
468 - *rd_InTruncatedPkts = NULL,
469 - *rd_InNoRoutes = NULL,
470 - *rd_OutNoRoutes = NULL;
471 -
472 - if(unlikely(!st)) {
473 - st = rrdset_create_localhost(
474 - RRD_TYPE_NET_SNMP6
475 - , "errors"
476 - , NULL
477 - , "errors"
478 - , NULL
479 - , "IPv6 Errors"
480 - , "packets/s"
481 - , PLUGIN_PROC_NAME
482 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
483 - , NETDATA_CHART_PRIO_IPV6_ERRORS
484 - , update_every
485 - , RRDSET_TYPE_LINE
486 - );
487 - rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
488 -
489 - rd_InDiscards = rrddim_add(st, "InDiscards", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
490 - rd_OutDiscards = rrddim_add(st, "OutDiscards", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
491 - rd_InHdrErrors = rrddim_add(st, "InHdrErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
492 - rd_InAddrErrors = rrddim_add(st, "InAddrErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
493 - rd_InUnknownProtos = rrddim_add(st, "InUnknownProtos", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
494 - rd_InTooBigErrors = rrddim_add(st, "InTooBigErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
495 - rd_InTruncatedPkts = rrddim_add(st, "InTruncatedPkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
496 - rd_InNoRoutes = rrddim_add(st, "InNoRoutes", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
497 - rd_OutNoRoutes = rrddim_add(st, "OutNoRoutes", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
498 - }
499 - else rrdset_next(st);
500 -
501 - rrddim_set_by_pointer(st, rd_InDiscards, Ip6InDiscards);
502 - rrddim_set_by_pointer(st, rd_OutDiscards, Ip6OutDiscards);
503 - rrddim_set_by_pointer(st, rd_InHdrErrors, Ip6InHdrErrors);
504 - rrddim_set_by_pointer(st, rd_InAddrErrors, Ip6InAddrErrors);
505 - rrddim_set_by_pointer(st, rd_InUnknownProtos, Ip6InUnknownProtos);
506 - rrddim_set_by_pointer(st, rd_InTooBigErrors, Ip6InTooBigErrors);
507 - rrddim_set_by_pointer(st, rd_InTruncatedPkts, Ip6InTruncatedPkts);
508 - rrddim_set_by_pointer(st, rd_InNoRoutes, Ip6InNoRoutes);
509 - rrddim_set_by_pointer(st, rd_OutNoRoutes, Ip6OutNoRoutes);
510 - rrdset_done(st);
511 - }
512 -
513 - // --------------------------------------------------------------------
514 -
515 - if(do_udp_packets == CONFIG_BOOLEAN_YES || (do_udp_packets == CONFIG_BOOLEAN_AUTO &&
516 - (Udp6InDatagrams ||
517 - Udp6OutDatagrams ||
518 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
519 - do_udp_packets = CONFIG_BOOLEAN_YES;
520 - static RRDSET *st = NULL;
521 - static RRDDIM *rd_received = NULL,
522 - *rd_sent = NULL;
523 -
524 - if(unlikely(!st)) {
525 - st = rrdset_create_localhost(
526 - RRD_TYPE_NET_SNMP6
527 - , "udppackets"
528 - , NULL
529 - , "udp6"
530 - , NULL
531 - , "IPv6 UDP Packets"
532 - , "packets/s"
533 - , PLUGIN_PROC_NAME
534 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
535 - , NETDATA_CHART_PRIO_IPV6_UDP_PACKETS
536 - , update_every
537 - , RRDSET_TYPE_LINE
538 - );
539 -
540 - rd_received = rrddim_add(st, "InDatagrams", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
541 - rd_sent = rrddim_add(st, "OutDatagrams", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
542 - }
543 - else rrdset_next(st);
544 -
545 - rrddim_set_by_pointer(st, rd_received, Udp6InDatagrams);
546 - rrddim_set_by_pointer(st, rd_sent, Udp6OutDatagrams);
547 - rrdset_done(st);
548 - }
549 -
550 - // --------------------------------------------------------------------
551 -
552 - if(do_udp_errors == CONFIG_BOOLEAN_YES || (do_udp_errors == CONFIG_BOOLEAN_AUTO &&
553 - (Udp6InErrors ||
554 - Udp6NoPorts ||
555 - Udp6RcvbufErrors ||
556 - Udp6SndbufErrors ||
557 - Udp6InCsumErrors ||
558 - Udp6IgnoredMulti ||
559 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
560 - do_udp_errors = CONFIG_BOOLEAN_YES;
561 - static RRDSET *st = NULL;
562 - static RRDDIM *rd_RcvbufErrors = NULL,
563 - *rd_SndbufErrors = NULL,
564 - *rd_InErrors = NULL,
565 - *rd_NoPorts = NULL,
566 - *rd_InCsumErrors = NULL,
567 - *rd_IgnoredMulti = NULL;
568 -
569 - if(unlikely(!st)) {
570 - st = rrdset_create_localhost(
571 - RRD_TYPE_NET_SNMP6
572 - , "udperrors"
573 - , NULL
574 - , "udp6"
575 - , NULL
576 - , "IPv6 UDP Errors"
577 - , "events/s"
578 - , PLUGIN_PROC_NAME
579 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
580 - , NETDATA_CHART_PRIO_IPV6_UDP_ERRORS
581 - , update_every
582 - , RRDSET_TYPE_LINE
583 - );
584 - rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
585 -
586 - rd_RcvbufErrors = rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
587 - rd_SndbufErrors = rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
588 - rd_InErrors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
589 - rd_NoPorts = rrddim_add(st, "NoPorts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
590 - rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
591 - rd_IgnoredMulti = rrddim_add(st, "IgnoredMulti", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
592 - }
593 - else rrdset_next(st);
594 -
595 - rrddim_set_by_pointer(st, rd_RcvbufErrors, Udp6RcvbufErrors);
596 - rrddim_set_by_pointer(st, rd_SndbufErrors, Udp6SndbufErrors);
597 - rrddim_set_by_pointer(st, rd_InErrors, Udp6InErrors);
598 - rrddim_set_by_pointer(st, rd_NoPorts, Udp6NoPorts);
599 - rrddim_set_by_pointer(st, rd_InCsumErrors, Udp6InCsumErrors);
600 - rrddim_set_by_pointer(st, rd_IgnoredMulti, Udp6IgnoredMulti);
601 - rrdset_done(st);
602 - }
603 -
604 - // --------------------------------------------------------------------
605 -
606 - if(do_udplite_packets == CONFIG_BOOLEAN_YES || (do_udplite_packets == CONFIG_BOOLEAN_AUTO &&
607 - (UdpLite6InDatagrams ||
608 - UdpLite6OutDatagrams ||
609 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
610 - do_udplite_packets = CONFIG_BOOLEAN_YES;
611 - static RRDSET *st = NULL;
612 - static RRDDIM *rd_received = NULL,
613 - *rd_sent = NULL;
614 -
615 - if(unlikely(!st)) {
616 - st = rrdset_create_localhost(
617 - RRD_TYPE_NET_SNMP6
618 - , "udplitepackets"
619 - , NULL
620 - , "udplite6"
621 - , NULL
622 - , "IPv6 UDPlite Packets"
623 - , "packets/s"
624 - , PLUGIN_PROC_NAME
625 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
626 - , NETDATA_CHART_PRIO_IPV6_UDPLITE_PACKETS
627 - , update_every
628 - , RRDSET_TYPE_LINE
629 - );
630 -
631 - rd_received = rrddim_add(st, "InDatagrams", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
632 - rd_sent = rrddim_add(st, "OutDatagrams", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
633 - }
634 - else rrdset_next(st);
635 -
636 - rrddim_set_by_pointer(st, rd_received, UdpLite6InDatagrams);
637 - rrddim_set_by_pointer(st, rd_sent, UdpLite6OutDatagrams);
638 - rrdset_done(st);
639 - }
640 -
641 - // --------------------------------------------------------------------
642 -
643 - if(do_udplite_errors == CONFIG_BOOLEAN_YES || (do_udplite_errors == CONFIG_BOOLEAN_AUTO &&
644 - (UdpLite6InErrors ||
645 - UdpLite6NoPorts ||
646 - UdpLite6RcvbufErrors ||
647 - UdpLite6SndbufErrors ||
648 - Udp6InCsumErrors ||
649 - UdpLite6InCsumErrors ||
650 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
651 - do_udplite_errors = CONFIG_BOOLEAN_YES;
652 - static RRDSET *st = NULL;
653 - static RRDDIM *rd_RcvbufErrors = NULL,
654 - *rd_SndbufErrors = NULL,
655 - *rd_InErrors = NULL,
656 - *rd_NoPorts = NULL,
657 - *rd_InCsumErrors = NULL;
658 -
659 - if(unlikely(!st)) {
660 - st = rrdset_create_localhost(
661 - RRD_TYPE_NET_SNMP6
662 - , "udpliteerrors"
663 - , NULL
664 - , "udplite6"
665 - , NULL
666 - , "IPv6 UDP Lite Errors"
667 - , "events/s"
668 - , PLUGIN_PROC_NAME
669 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
670 - , NETDATA_CHART_PRIO_IPV6_UDPLITE_ERRORS
671 - , update_every
672 - , RRDSET_TYPE_LINE
673 - );
674 - rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
675 -
676 - rd_RcvbufErrors = rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
677 - rd_SndbufErrors = rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
678 - rd_InErrors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
679 - rd_NoPorts = rrddim_add(st, "NoPorts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
680 - rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
681 - }
682 - else rrdset_next(st);
683 -
684 - rrddim_set_by_pointer(st, rd_InErrors, UdpLite6InErrors);
685 - rrddim_set_by_pointer(st, rd_NoPorts, UdpLite6NoPorts);
686 - rrddim_set_by_pointer(st, rd_RcvbufErrors, UdpLite6RcvbufErrors);
687 - rrddim_set_by_pointer(st, rd_SndbufErrors, UdpLite6SndbufErrors);
688 - rrddim_set_by_pointer(st, rd_InCsumErrors, UdpLite6InCsumErrors);
689 - rrdset_done(st);
690 - }
691 -
692 - // --------------------------------------------------------------------
693 -
694 - if(do_mcast == CONFIG_BOOLEAN_YES || (do_mcast == CONFIG_BOOLEAN_AUTO &&
695 - (Ip6OutMcastOctets ||
696 - Ip6InMcastOctets ||
697 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
698 - do_mcast = CONFIG_BOOLEAN_YES;
699 - static RRDSET *st = NULL;
700 - static RRDDIM *rd_Ip6InMcastOctets = NULL,
701 - *rd_Ip6OutMcastOctets = NULL;
702 -
703 - if(unlikely(!st)) {
704 - st = rrdset_create_localhost(
705 - RRD_TYPE_NET_SNMP6
706 - , "mcast"
707 - , NULL
708 - , "multicast6"
709 - , NULL
710 - , "IPv6 Multicast Bandwidth"
711 - , "kilobits/s"
712 - , PLUGIN_PROC_NAME
713 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
714 - , NETDATA_CHART_PRIO_IPV6_MCAST
715 - , update_every
716 - , RRDSET_TYPE_AREA
717 - );
718 - rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
719 -
720 - rd_Ip6InMcastOctets = rrddim_add(st, "InMcastOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
721 - rd_Ip6OutMcastOctets = rrddim_add(st, "OutMcastOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
722 - }
723 - else rrdset_next(st);
724 -
725 - rrddim_set_by_pointer(st, rd_Ip6InMcastOctets, Ip6InMcastOctets);
726 - rrddim_set_by_pointer(st, rd_Ip6OutMcastOctets, Ip6OutMcastOctets);
727 - rrdset_done(st);
728 - }
729 -
730 - // --------------------------------------------------------------------
731 -
732 - if(do_bcast == CONFIG_BOOLEAN_YES || (do_bcast == CONFIG_BOOLEAN_AUTO &&
733 - (Ip6OutBcastOctets ||
734 - Ip6InBcastOctets ||
735 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
736 - do_bcast = CONFIG_BOOLEAN_YES;
737 - static RRDSET *st = NULL;
738 - static RRDDIM *rd_Ip6InBcastOctets = NULL,
739 - *rd_Ip6OutBcastOctets = NULL;
740 -
741 - if(unlikely(!st)) {
742 - st = rrdset_create_localhost(
743 - RRD_TYPE_NET_SNMP6
744 - , "bcast"
745 - , NULL
746 - , "broadcast6"
747 - , NULL
748 - , "IPv6 Broadcast Bandwidth"
749 - , "kilobits/s"
750 - , PLUGIN_PROC_NAME
751 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
752 - , NETDATA_CHART_PRIO_IPV6_BCAST
753 - , update_every
754 - , RRDSET_TYPE_AREA
755 - );
756 - rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
757 -
758 - rd_Ip6InBcastOctets = rrddim_add(st, "InBcastOctets", "received", 8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
759 - rd_Ip6OutBcastOctets = rrddim_add(st, "OutBcastOctets", "sent", -8, BITS_IN_A_KILOBIT, RRD_ALGORITHM_INCREMENTAL);
760 - }
761 - else rrdset_next(st);
762 -
763 - rrddim_set_by_pointer(st, rd_Ip6InBcastOctets, Ip6InBcastOctets);
764 - rrddim_set_by_pointer(st, rd_Ip6OutBcastOctets, Ip6OutBcastOctets);
765 - rrdset_done(st);
766 - }
767 -
768 - // --------------------------------------------------------------------
769 -
770 - if(do_mcast_p == CONFIG_BOOLEAN_YES || (do_mcast_p == CONFIG_BOOLEAN_AUTO &&
771 - (Ip6OutMcastPkts ||
772 - Ip6InMcastPkts ||
773 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
774 - do_mcast_p = CONFIG_BOOLEAN_YES;
775 - static RRDSET *st = NULL;
776 - static RRDDIM *rd_Ip6InMcastPkts = NULL,
777 - *rd_Ip6OutMcastPkts = NULL;
778 -
779 - if(unlikely(!st)) {
780 - st = rrdset_create_localhost(
781 - RRD_TYPE_NET_SNMP6
782 - , "mcastpkts"
783 - , NULL
784 - , "multicast6"
785 - , NULL
786 - , "IPv6 Multicast Packets"
787 - , "packets/s"
788 - , PLUGIN_PROC_NAME
789 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
790 - , NETDATA_CHART_PRIO_IPV6_MCAST_PACKETS
791 - , update_every
792 - , RRDSET_TYPE_LINE
793 - );
794 - rrdset_flag_set(st, RRDSET_FLAG_DETAIL);
795 -
796 - rd_Ip6InMcastPkts = rrddim_add(st, "InMcastPkts", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
797 - rd_Ip6OutMcastPkts = rrddim_add(st, "OutMcastPkts", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
798 - }
799 - else rrdset_next(st);
800 -
801 - rrddim_set_by_pointer(st, rd_Ip6InMcastPkts, Ip6InMcastPkts);
802 - rrddim_set_by_pointer(st, rd_Ip6OutMcastPkts, Ip6OutMcastPkts);
803 - rrdset_done(st);
804 - }
805 -
806 - // --------------------------------------------------------------------
807 -
808 - if(do_icmp == CONFIG_BOOLEAN_YES || (do_icmp == CONFIG_BOOLEAN_AUTO &&
809 - (Icmp6InMsgs ||
810 - Icmp6OutMsgs ||
811 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
812 - do_icmp = CONFIG_BOOLEAN_YES;
813 - static RRDSET *st = NULL;
814 - static RRDDIM *rd_Icmp6InMsgs = NULL,
815 - *rd_Icmp6OutMsgs = NULL;
816 -
817 - if(unlikely(!st)) {
818 - st = rrdset_create_localhost(
819 - RRD_TYPE_NET_SNMP6
820 - , "icmp"
821 - , NULL
822 - , "icmp6"
823 - , NULL
824 - , "IPv6 ICMP Messages"
825 - , "messages/s"
826 - , PLUGIN_PROC_NAME
827 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
828 - , NETDATA_CHART_PRIO_IPV6_ICMP
829 - , update_every
830 - , RRDSET_TYPE_LINE
831 - );
832 -
833 - rd_Icmp6InMsgs = rrddim_add(st, "InMsgs", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
834 - rd_Icmp6OutMsgs = rrddim_add(st, "OutMsgs", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
835 - }
836 - else rrdset_next(st);
837 -
838 - rrddim_set_by_pointer(st, rd_Icmp6InMsgs, Icmp6InMsgs);
839 - rrddim_set_by_pointer(st, rd_Icmp6OutMsgs, Icmp6OutMsgs);
840 - rrdset_done(st);
841 - }
842 -
843 - // --------------------------------------------------------------------
844 -
845 - if(do_icmp_redir == CONFIG_BOOLEAN_YES || (do_icmp_redir == CONFIG_BOOLEAN_AUTO &&
846 - (Icmp6InRedirects ||
847 - Icmp6OutRedirects ||
848 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
849 - do_icmp_redir = CONFIG_BOOLEAN_YES;
850 - static RRDSET *st = NULL;
851 - static RRDDIM *rd_Icmp6InRedirects = NULL,
852 - *rd_Icmp6OutRedirects = NULL;
853 -
854 - if(unlikely(!st)) {
855 - st = rrdset_create_localhost(
856 - RRD_TYPE_NET_SNMP6
857 - , "icmpredir"
858 - , NULL
859 - , "icmp6"
860 - , NULL
861 - , "IPv6 ICMP Redirects"
862 - , "redirects/s"
863 - , PLUGIN_PROC_NAME
864 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
865 - , NETDATA_CHART_PRIO_IPV6_ICMP_REDIR
866 - , update_every
867 - , RRDSET_TYPE_LINE
868 - );
869 -
870 - rd_Icmp6InRedirects = rrddim_add(st, "InRedirects", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
871 - rd_Icmp6OutRedirects = rrddim_add(st, "OutRedirects", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
872 - }
873 - else rrdset_next(st);
874 -
875 - rrddim_set_by_pointer(st, rd_Icmp6InRedirects, Icmp6InRedirects);
876 - rrddim_set_by_pointer(st, rd_Icmp6OutRedirects, Icmp6OutRedirects);
877 - rrdset_done(st);
878 - }
879 -
880 - // --------------------------------------------------------------------
881 -
882 - if(do_icmp_errors == CONFIG_BOOLEAN_YES || (do_icmp_errors == CONFIG_BOOLEAN_AUTO &&
883 - (Icmp6InErrors ||
884 - Icmp6OutErrors ||
885 - Icmp6InCsumErrors ||
886 - Icmp6InDestUnreachs ||
887 - Icmp6InPktTooBigs ||
888 - Icmp6InTimeExcds ||
889 - Icmp6InParmProblems ||
890 - Icmp6OutDestUnreachs ||
891 - Icmp6OutPktTooBigs ||
892 - Icmp6OutTimeExcds ||
893 - Icmp6OutParmProblems ||
894 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
895 - do_icmp_errors = CONFIG_BOOLEAN_YES;
896 - static RRDSET *st = NULL;
897 - static RRDDIM *rd_InErrors = NULL,
898 - *rd_OutErrors = NULL,
899 - *rd_InCsumErrors = NULL,
900 - *rd_InDestUnreachs = NULL,
901 - *rd_InPktTooBigs = NULL,
902 - *rd_InTimeExcds = NULL,
903 - *rd_InParmProblems = NULL,
904 - *rd_OutDestUnreachs = NULL,
905 - *rd_OutPktTooBigs = NULL,
906 - *rd_OutTimeExcds = NULL,
907 - *rd_OutParmProblems = NULL;
908 -
909 - if(unlikely(!st)) {
910 - st = rrdset_create_localhost(
911 - RRD_TYPE_NET_SNMP6
912 - , "icmperrors"
913 - , NULL
914 - , "icmp6"
915 - , NULL
916 - , "IPv6 ICMP Errors"
917 - , "errors/s"
918 - , PLUGIN_PROC_NAME
919 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
920 - , NETDATA_CHART_PRIO_IPV6_ICMP_ERRORS
921 - , update_every
922 - , RRDSET_TYPE_LINE
923 - );
924 -
925 - rd_InErrors = rrddim_add(st, "InErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
926 - rd_OutErrors = rrddim_add(st, "OutErrors", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
927 - rd_InCsumErrors = rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
928 - rd_InDestUnreachs = rrddim_add(st, "InDestUnreachs", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
929 - rd_InPktTooBigs = rrddim_add(st, "InPktTooBigs", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
930 - rd_InTimeExcds = rrddim_add(st, "InTimeExcds", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
931 - rd_InParmProblems = rrddim_add(st, "InParmProblems", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
932 - rd_OutDestUnreachs = rrddim_add(st, "OutDestUnreachs", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
933 - rd_OutPktTooBigs = rrddim_add(st, "OutPktTooBigs", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
934 - rd_OutTimeExcds = rrddim_add(st, "OutTimeExcds", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
935 - rd_OutParmProblems = rrddim_add(st, "OutParmProblems", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
936 - }
937 - else rrdset_next(st);
938 -
939 - rrddim_set_by_pointer(st, rd_InErrors, Icmp6InErrors);
940 - rrddim_set_by_pointer(st, rd_OutErrors, Icmp6OutErrors);
941 - rrddim_set_by_pointer(st, rd_InCsumErrors, Icmp6InCsumErrors);
942 - rrddim_set_by_pointer(st, rd_InDestUnreachs, Icmp6InDestUnreachs);
943 - rrddim_set_by_pointer(st, rd_InPktTooBigs, Icmp6InPktTooBigs);
944 - rrddim_set_by_pointer(st, rd_InTimeExcds, Icmp6InTimeExcds);
945 - rrddim_set_by_pointer(st, rd_InParmProblems, Icmp6InParmProblems);
946 - rrddim_set_by_pointer(st, rd_OutDestUnreachs, Icmp6OutDestUnreachs);
947 - rrddim_set_by_pointer(st, rd_OutPktTooBigs, Icmp6OutPktTooBigs);
948 - rrddim_set_by_pointer(st, rd_OutTimeExcds, Icmp6OutTimeExcds);
949 - rrddim_set_by_pointer(st, rd_OutParmProblems, Icmp6OutParmProblems);
950 - rrdset_done(st);
951 - }
952 -
953 - // --------------------------------------------------------------------
954 -
955 - if(do_icmp_echos == CONFIG_BOOLEAN_YES || (do_icmp_echos == CONFIG_BOOLEAN_AUTO &&
956 - (Icmp6InEchos ||
957 - Icmp6OutEchos ||
958 - Icmp6InEchoReplies ||
959 - Icmp6OutEchoReplies ||
960 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
961 - do_icmp_echos = CONFIG_BOOLEAN_YES;
962 - static RRDSET *st = NULL;
963 - static RRDDIM *rd_InEchos = NULL,
964 - *rd_OutEchos = NULL,
965 - *rd_InEchoReplies = NULL,
966 - *rd_OutEchoReplies = NULL;
967 -
968 - if(unlikely(!st)) {
969 - st = rrdset_create_localhost(
970 - RRD_TYPE_NET_SNMP6
971 - , "icmpechos"
972 - , NULL
973 - , "icmp6"
974 - , NULL
975 - , "IPv6 ICMP Echo"
976 - , "messages/s"
977 - , PLUGIN_PROC_NAME
978 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
979 - , NETDATA_CHART_PRIO_IPV6_ICMP_ECHOS
980 - , update_every
981 - , RRDSET_TYPE_LINE
982 - );
983 -
984 - rd_InEchos = rrddim_add(st, "InEchos", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
985 - rd_OutEchos = rrddim_add(st, "OutEchos", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
986 - rd_InEchoReplies = rrddim_add(st, "InEchoReplies", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
987 - rd_OutEchoReplies = rrddim_add(st, "OutEchoReplies", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
988 - }
989 - else rrdset_next(st);
990 -
991 - rrddim_set_by_pointer(st, rd_InEchos, Icmp6InEchos);
992 - rrddim_set_by_pointer(st, rd_OutEchos, Icmp6OutEchos);
993 - rrddim_set_by_pointer(st, rd_InEchoReplies, Icmp6InEchoReplies);
994 - rrddim_set_by_pointer(st, rd_OutEchoReplies, Icmp6OutEchoReplies);
995 - rrdset_done(st);
996 - }
997 -
998 - // --------------------------------------------------------------------
999 -
1000 - if(do_icmp_groupmemb == CONFIG_BOOLEAN_YES || (do_icmp_groupmemb == CONFIG_BOOLEAN_AUTO &&
1001 - (Icmp6InGroupMembQueries ||
1002 - Icmp6OutGroupMembQueries ||
1003 - Icmp6InGroupMembResponses ||
1004 - Icmp6OutGroupMembResponses ||
1005 - Icmp6InGroupMembReductions ||
1006 - Icmp6OutGroupMembReductions ||
1007 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1008 - do_icmp_groupmemb = CONFIG_BOOLEAN_YES;
1009 - static RRDSET *st = NULL;
1010 - static RRDDIM *rd_InQueries = NULL,
1011 - *rd_OutQueries = NULL,
1012 - *rd_InResponses = NULL,
1013 - *rd_OutResponses = NULL,
1014 - *rd_InReductions = NULL,
1015 - *rd_OutReductions = NULL;
1016 -
1017 - if(unlikely(!st)) {
1018 - st = rrdset_create_localhost(
1019 - RRD_TYPE_NET_SNMP6
1020 - , "groupmemb"
1021 - , NULL
1022 - , "icmp6"
1023 - , NULL
1024 - , "IPv6 ICMP Group Membership"
1025 - , "messages/s"
1026 - , PLUGIN_PROC_NAME
1027 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
1028 - , NETDATA_CHART_PRIO_IPV6_ICMP_GROUPMEMB
1029 - , update_every
1030 - , RRDSET_TYPE_LINE);
1031 -
1032 - rd_InQueries = rrddim_add(st, "InQueries", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1033 - rd_OutQueries = rrddim_add(st, "OutQueries", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1034 - rd_InResponses = rrddim_add(st, "InResponses", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1035 - rd_OutResponses = rrddim_add(st, "OutResponses", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1036 - rd_InReductions = rrddim_add(st, "InReductions", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1037 - rd_OutReductions = rrddim_add(st, "OutReductions", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1038 - }
1039 - else rrdset_next(st);
1040 -
1041 - rrddim_set_by_pointer(st, rd_InQueries, Icmp6InGroupMembQueries);
1042 - rrddim_set_by_pointer(st, rd_OutQueries, Icmp6OutGroupMembQueries);
1043 - rrddim_set_by_pointer(st, rd_InResponses, Icmp6InGroupMembResponses);
1044 - rrddim_set_by_pointer(st, rd_OutResponses, Icmp6OutGroupMembResponses);
1045 - rrddim_set_by_pointer(st, rd_InReductions, Icmp6InGroupMembReductions);
1046 - rrddim_set_by_pointer(st, rd_OutReductions, Icmp6OutGroupMembReductions);
1047 - rrdset_done(st);
1048 - }
1049 -
1050 - // --------------------------------------------------------------------
1051 -
1052 - if(do_icmp_router == CONFIG_BOOLEAN_YES || (do_icmp_router == CONFIG_BOOLEAN_AUTO &&
1053 - (Icmp6InRouterSolicits ||
1054 - Icmp6OutRouterSolicits ||
1055 - Icmp6InRouterAdvertisements ||
1056 - Icmp6OutRouterAdvertisements ||
1057 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1058 - do_icmp_router = CONFIG_BOOLEAN_YES;
1059 - static RRDSET *st = NULL;
1060 - static RRDDIM *rd_InSolicits = NULL,
1061 - *rd_OutSolicits = NULL,
1062 - *rd_InAdvertisements = NULL,
1063 - *rd_OutAdvertisements = NULL;
1064 -
1065 - if(unlikely(!st)) {
1066 - st = rrdset_create_localhost(
1067 - RRD_TYPE_NET_SNMP6
1068 - , "icmprouter"
1069 - , NULL
1070 - , "icmp6"
1071 - , NULL
1072 - , "IPv6 Router Messages"
1073 - , "messages/s"
1074 - , PLUGIN_PROC_NAME
1075 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
1076 - , NETDATA_CHART_PRIO_IPV6_ICMP_ROUTER
1077 - , update_every
1078 - , RRDSET_TYPE_LINE
1079 - );
1080 -
1081 - rd_InSolicits = rrddim_add(st, "InSolicits", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1082 - rd_OutSolicits = rrddim_add(st, "OutSolicits", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1083 - rd_InAdvertisements = rrddim_add(st, "InAdvertisements", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1084 - rd_OutAdvertisements = rrddim_add(st, "OutAdvertisements", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1085 - }
1086 - else rrdset_next(st);
1087 -
1088 - rrddim_set_by_pointer(st, rd_InSolicits, Icmp6InRouterSolicits);
1089 - rrddim_set_by_pointer(st, rd_OutSolicits, Icmp6OutRouterSolicits);
1090 - rrddim_set_by_pointer(st, rd_InAdvertisements, Icmp6InRouterAdvertisements);
1091 - rrddim_set_by_pointer(st, rd_OutAdvertisements, Icmp6OutRouterAdvertisements);
1092 - rrdset_done(st);
1093 - }
1094 -
1095 - // --------------------------------------------------------------------
1096 -
1097 - if(do_icmp_neighbor == CONFIG_BOOLEAN_YES || (do_icmp_neighbor == CONFIG_BOOLEAN_AUTO &&
1098 - (Icmp6InNeighborSolicits ||
1099 - Icmp6OutNeighborSolicits ||
1100 - Icmp6InNeighborAdvertisements ||
1101 - Icmp6OutNeighborAdvertisements ||
1102 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1103 - do_icmp_neighbor = CONFIG_BOOLEAN_YES;
1104 - static RRDSET *st = NULL;
1105 - static RRDDIM *rd_InSolicits = NULL,
1106 - *rd_OutSolicits = NULL,
1107 - *rd_InAdvertisements = NULL,
1108 - *rd_OutAdvertisements = NULL;
1109 -
1110 - if(unlikely(!st)) {
1111 - st = rrdset_create_localhost(
1112 - RRD_TYPE_NET_SNMP6
1113 - , "icmpneighbor"
1114 - , NULL
1115 - , "icmp6"
1116 - , NULL
1117 - , "IPv6 Neighbor Messages"
1118 - , "messages/s"
1119 - , PLUGIN_PROC_NAME
1120 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
1121 - , NETDATA_CHART_PRIO_IPV6_ICMP_NEIGHBOR
1122 - , update_every
1123 - , RRDSET_TYPE_LINE
1124 - );
1125 -
1126 - rd_InSolicits = rrddim_add(st, "InSolicits", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1127 - rd_OutSolicits = rrddim_add(st, "OutSolicits", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1128 - rd_InAdvertisements = rrddim_add(st, "InAdvertisements", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1129 - rd_OutAdvertisements = rrddim_add(st, "OutAdvertisements", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1130 - }
1131 - else rrdset_next(st);
1132 -
1133 - rrddim_set_by_pointer(st, rd_InSolicits, Icmp6InNeighborSolicits);
1134 - rrddim_set_by_pointer(st, rd_OutSolicits, Icmp6OutNeighborSolicits);
1135 - rrddim_set_by_pointer(st, rd_InAdvertisements, Icmp6InNeighborAdvertisements);
1136 - rrddim_set_by_pointer(st, rd_OutAdvertisements, Icmp6OutNeighborAdvertisements);
1137 - rrdset_done(st);
1138 - }
1139 -
1140 - // --------------------------------------------------------------------
1141 -
1142 - if(do_icmp_mldv2 == CONFIG_BOOLEAN_YES || (do_icmp_mldv2 == CONFIG_BOOLEAN_AUTO &&
1143 - (Icmp6InMLDv2Reports ||
1144 - Icmp6OutMLDv2Reports ||
1145 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1146 - do_icmp_mldv2 = CONFIG_BOOLEAN_YES;
1147 - static RRDSET *st = NULL;
1148 - static RRDDIM *rd_InMLDv2Reports = NULL,
1149 - *rd_OutMLDv2Reports = NULL;
1150 -
1151 - if(unlikely(!st)) {
1152 - st = rrdset_create_localhost(
1153 - RRD_TYPE_NET_SNMP6
1154 - , "icmpmldv2"
1155 - , NULL
1156 - , "icmp6"
1157 - , NULL
1158 - , "IPv6 ICMP MLDv2 Reports"
1159 - , "reports/s"
1160 - , PLUGIN_PROC_NAME
1161 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
1162 - , NETDATA_CHART_PRIO_IPV6_ICMP_LDV2
1163 - , update_every
1164 - , RRDSET_TYPE_LINE
1165 - );
1166 -
1167 - rd_InMLDv2Reports = rrddim_add(st, "InMLDv2Reports", "received", 1, 1, RRD_ALGORITHM_INCREMENTAL);
1168 - rd_OutMLDv2Reports = rrddim_add(st, "OutMLDv2Reports", "sent", -1, 1, RRD_ALGORITHM_INCREMENTAL);
1169 - }
1170 - else rrdset_next(st);
1171 -
1172 - rrddim_set_by_pointer(st, rd_InMLDv2Reports, Icmp6InMLDv2Reports);
1173 - rrddim_set_by_pointer(st, rd_OutMLDv2Reports, Icmp6OutMLDv2Reports);
1174 - rrdset_done(st);
1175 - }
1176 -
1177 - // --------------------------------------------------------------------
1178 -
1179 - if(do_icmp_types == CONFIG_BOOLEAN_YES || (do_icmp_types == CONFIG_BOOLEAN_AUTO &&
1180 - (Icmp6InType1 ||
1181 - Icmp6InType128 ||
1182 - Icmp6InType129 ||
1183 - Icmp6InType136 ||
1184 - Icmp6OutType1 ||
1185 - Icmp6OutType128 ||
1186 - Icmp6OutType129 ||
1187 - Icmp6OutType133 ||
1188 - Icmp6OutType135 ||
1189 - Icmp6OutType143 ||
1190 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1191 - do_icmp_types = CONFIG_BOOLEAN_YES;
1192 - static RRDSET *st = NULL;
1193 - static RRDDIM *rd_InType1 = NULL,
1194 - *rd_InType128 = NULL,
1195 - *rd_InType129 = NULL,
1196 - *rd_InType136 = NULL,
1197 - *rd_OutType1 = NULL,
1198 - *rd_OutType128 = NULL,
1199 - *rd_OutType129 = NULL,
1200 - *rd_OutType133 = NULL,
1201 - *rd_OutType135 = NULL,
1202 - *rd_OutType143 = NULL;
1203 -
1204 - if(unlikely(!st)) {
1205 - st = rrdset_create_localhost(
1206 - RRD_TYPE_NET_SNMP6
1207 - , "icmptypes"
1208 - , NULL
1209 - , "icmp6"
1210 - , NULL
1211 - , "IPv6 ICMP Types"
1212 - , "messages/s"
1213 - , PLUGIN_PROC_NAME
1214 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
1215 - , NETDATA_CHART_PRIO_IPV6_ICMP_TYPES
1216 - , update_every
1217 - , RRDSET_TYPE_LINE
1218 - );
1219 -
1220 - rd_InType1 = rrddim_add(st, "InType1", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1221 - rd_InType128 = rrddim_add(st, "InType128", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1222 - rd_InType129 = rrddim_add(st, "InType129", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1223 - rd_InType136 = rrddim_add(st, "InType136", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1224 - rd_OutType1 = rrddim_add(st, "OutType1", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1225 - rd_OutType128 = rrddim_add(st, "OutType128", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1226 - rd_OutType129 = rrddim_add(st, "OutType129", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1227 - rd_OutType133 = rrddim_add(st, "OutType133", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1228 - rd_OutType135 = rrddim_add(st, "OutType135", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1229 - rd_OutType143 = rrddim_add(st, "OutType143", NULL, -1, 1, RRD_ALGORITHM_INCREMENTAL);
1230 - }
1231 - else rrdset_next(st);
1232 -
1233 - rrddim_set_by_pointer(st, rd_InType1, Icmp6InType1);
1234 - rrddim_set_by_pointer(st, rd_InType128, Icmp6InType128);
1235 - rrddim_set_by_pointer(st, rd_InType129, Icmp6InType129);
1236 - rrddim_set_by_pointer(st, rd_InType136, Icmp6InType136);
1237 - rrddim_set_by_pointer(st, rd_OutType1, Icmp6OutType1);
1238 - rrddim_set_by_pointer(st, rd_OutType128, Icmp6OutType128);
1239 - rrddim_set_by_pointer(st, rd_OutType129, Icmp6OutType129);
1240 - rrddim_set_by_pointer(st, rd_OutType133, Icmp6OutType133);
1241 - rrddim_set_by_pointer(st, rd_OutType135, Icmp6OutType135);
1242 - rrddim_set_by_pointer(st, rd_OutType143, Icmp6OutType143);
1243 - rrdset_done(st);
1244 - }
1245 -
1246 - // --------------------------------------------------------------------
1247 -
1248 - if(do_ect == CONFIG_BOOLEAN_YES || (do_ect == CONFIG_BOOLEAN_AUTO &&
1249 - (Ip6InNoECTPkts ||
1250 - Ip6InECT1Pkts ||
1251 - Ip6InECT0Pkts ||
1252 - Ip6InCEPkts ||
1253 - netdata_zero_metrics_enabled == CONFIG_BOOLEAN_YES))) {
1254 - do_ect = CONFIG_BOOLEAN_YES;
1255 - static RRDSET *st = NULL;
1256 - static RRDDIM *rd_InNoECTPkts = NULL,
1257 - *rd_InECT1Pkts = NULL,
1258 - *rd_InECT0Pkts = NULL,
1259 - *rd_InCEPkts = NULL;
1260 -
1261 - if(unlikely(!st)) {
1262 - st = rrdset_create_localhost(
1263 - RRD_TYPE_NET_SNMP6
1264 - , "ect"
1265 - , NULL
1266 - , "packets"
1267 - , NULL
1268 - , "IPv6 ECT Packets"
1269 - , "packets/s"
1270 - , PLUGIN_PROC_NAME
1271 - , PLUGIN_PROC_MODULE_NET_SNMP6_NAME
1272 - , NETDATA_CHART_PRIO_IPV6_ECT
1273 - , update_every
1274 - , RRDSET_TYPE_LINE
1275 - );
1276 -
1277 - rd_InNoECTPkts = rrddim_add(st, "InNoECTPkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1278 - rd_InECT1Pkts = rrddim_add(st, "InECT1Pkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1279 - rd_InECT0Pkts = rrddim_add(st, "InECT0Pkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1280 - rd_InCEPkts = rrddim_add(st, "InCEPkts", NULL, 1, 1, RRD_ALGORITHM_INCREMENTAL);
1281 - }
1282 - else rrdset_next(st);
1283 -
1284 - rrddim_set_by_pointer(st, rd_InNoECTPkts, Ip6InNoECTPkts);
1285 - rrddim_set_by_pointer(st, rd_InECT1Pkts, Ip6InECT1Pkts);
1286 - rrddim_set_by_pointer(st, rd_InECT0Pkts, Ip6InECT0Pkts);
1287 - rrddim_set_by_pointer(st, rd_InCEPkts, Ip6InCEPkts);
1288 - rrdset_done(st);
1289 - }
1290 -
1291 - return 0;
1292 -}
1293 -