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