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