@cryptotaxi247 / netdata-1 / commits / e33878d2a

added IPv6 performance metrics #60

Costa Tsaousis (ktsaou) committed Apr 2, 2016 at 20:36 UTC e33878d2a0c705d7687fcfb693566a1bfb8a6f01
8 files changed +1006 -7
src/Makefile.am
+1
@@ -47,6 +47,7 @@ netdata_SOURCES = \
47 proc_net_netstat.c \
48 proc_net_rpc_nfsd.c \
49 proc_net_snmp.c \
50 + proc_net_snmp6.c \
51 proc_net_stat_conntrack.c \
52 proc_stat.c \
53 proc_sys_kernel_random_entropy_avail.c \
src/plugin_proc.c
+10
@@ -43,6 +43,7 @@ void *proc_main(void *ptr)
43 int vdo_proc_net_dev = !config_get_boolean("plugin:proc", "/proc/net/dev", 1);
44 int vdo_proc_diskstats = !config_get_boolean("plugin:proc", "/proc/diskstats", 1);
45 int vdo_proc_net_snmp = !config_get_boolean("plugin:proc", "/proc/net/snmp", 1);
46 + int vdo_proc_net_snmp6 = !config_get_boolean("plugin:proc", "/proc/net/snmp6", 1);
47 int vdo_proc_net_netstat = !config_get_boolean("plugin:proc", "/proc/net/netstat", 1);
48 int vdo_proc_net_stat_conntrack = !config_get_boolean("plugin:proc", "/proc/net/stat/conntrack", 1);
49 int vdo_proc_net_ip_vs_stats = !config_get_boolean("plugin:proc", "/proc/net/ip_vs/stats", 1);
@@ -61,6 +62,7 @@ void *proc_main(void *ptr)
62 unsigned long long sutime_proc_net_dev = 0ULL;
63 unsigned long long sutime_proc_diskstats = 0ULL;
64 unsigned long long sutime_proc_net_snmp = 0ULL;
65 + unsigned long long sutime_proc_net_snmp6 = 0ULL;
66 unsigned long long sutime_proc_net_netstat = 0ULL;
67 unsigned long long sutime_proc_net_stat_conntrack = 0ULL;
68 unsigned long long sutime_proc_net_ip_vs_stats = 0ULL;
@@ -160,6 +162,14 @@ void *proc_main(void *ptr)
162 }
163 if(unlikely(netdata_exit)) break;
164
165 + if(!vdo_proc_net_snmp6) {
166 + debug(D_PROCNETDEV_LOOP, "PROCNETDEV: calling do_proc_net_snmp6().");
167 + sunow = sutime();
168 + vdo_proc_net_snmp6 = do_proc_net_snmp6(rrd_update_every, (sutime_proc_net_snmp6 > 0)?sunow - sutime_proc_net_snmp6:0ULL);
169 + sutime_proc_net_snmp6 = sunow;
170 + }
171 + if(unlikely(netdata_exit)) break;
172 +
173 if(!vdo_proc_net_netstat) {
174 debug(D_PROCNETDEV_LOOP, "PROCNETDEV: calling do_proc_net_netstat().");
175 sunow = sutime();
src/plugin_proc.h
+1
@@ -6,6 +6,7 @@ void *proc_main(void *ptr);
6 extern int do_proc_net_dev(int update_every, unsigned long long dt);
7 extern int do_proc_diskstats(int update_every, unsigned long long dt);
8 extern int do_proc_net_snmp(int update_every, unsigned long long dt);
9 +extern int do_proc_net_snmp6(int update_every, unsigned long long dt);
10 extern int do_proc_net_netstat(int update_every, unsigned long long dt);
11 extern int do_proc_net_stat_conntrack(int update_every, unsigned long long dt);
12 extern int do_proc_net_ip_vs_stats(int update_every, unsigned long long dt);
src/proc_net_netstat.c
+2 -2
@@ -98,12 +98,12 @@ int do_proc_net_netstat(int update_every, unsigned long long dt) {
98 st->isdetail = 1;
99
100 rrddim_add(st, "noroutes", NULL, 1, 1, RRDDIM_INCREMENTAL);
101 - rrddim_add(st, "trunkated", NULL, 1, 1, RRDDIM_INCREMENTAL);
101 + rrddim_add(st, "truncated", NULL, 1, 1, RRDDIM_INCREMENTAL);
102 }
103 else rrdset_next(st);
104
105 rrddim_set(st, "noroutes", InNoRoutes);
106 - rrddim_set(st, "trunkated", InTruncatedPkts);
106 + rrddim_set(st, "truncated", InTruncatedPkts);
107 rrdset_done(st);
108 }
109
src/proc_net_snmp.c
+1 -1
@@ -22,7 +22,7 @@ int do_proc_net_snmp(int update_every, unsigned long long dt) {
22 do_udp_packets = -1, do_udp_errors = -1;
23
24 if(do_ip_packets == -1) do_ip_packets = config_get_boolean("plugin:proc:/proc/net/snmp", "ipv4 packets", 1);
25 - if(do_ip_fragsout == -1) do_ip_fragsout = config_get_boolean("plugin:proc:/proc/net/snmp", "ipv4 fragrments sent", 1);
25 + if(do_ip_fragsout == -1) do_ip_fragsout = config_get_boolean("plugin:proc:/proc/net/snmp", "ipv4 fragments sent", 1);
26 if(do_ip_fragsin == -1) do_ip_fragsin = config_get_boolean("plugin:proc:/proc/net/snmp", "ipv4 fragments assembly", 1);
27 if(do_ip_errors == -1) do_ip_errors = config_get_boolean("plugin:proc:/proc/net/snmp", "ipv4 errors", 1);
28 if(do_tcp_sockets == -1) do_tcp_sockets = config_get_boolean("plugin:proc:/proc/net/snmp", "ipv4 TCP connections", 1);
src/proc_net_snmp6.c new
+958
@@ -0,0 +1,958 @@
1 +#ifdef HAVE_CONFIG_H
2 +#include <config.h>
3 +#endif
4 +#include <stdio.h>
5 +#include <stdlib.h>
6 +#include <string.h>
7 +#include <unistd.h>
8 +
9 +#include "common.h"
10 +#include "log.h"
11 +#include "appconfig.h"
12 +#include "procfile.h"
13 +#include "rrd.h"
14 +#include "plugin_proc.h"
15 +
16 +#define RRD_TYPE_NET_SNMP6 "ipv6"
17 +#define RRD_TYPE_NET_SNMP6_LEN strlen(RRD_TYPE_NET_SNMP6)
18 +
19 +int do_proc_net_snmp6(int update_every, unsigned long long dt) {
20 + static procfile *ff = NULL;
21 + static int gen_hashes = -1;
22 +
23 + static int do_ip_packets = -1, do_ip_fragsout = -1, do_ip_fragsin = -1, do_ip_errors = -1,
24 + do_udplite_packets = -1, do_udplite_errors = -1,
25 + do_udp_packets = -1, do_udp_errors = -1,
26 + do_bandwidth = -1, do_inerrors = -1, do_mcast = -1, do_bcast = -1, do_mcast_p = -1, do_bcast_p = -1,
27 + do_icmp = -1, do_icmp_redir = -1, do_icmp_errors = -1, do_icmp_echos = -1, do_icmp_groupmemb = -1,
28 + do_icmp_router = -1, do_icmp_neighbor = -1, do_icmp_mldv2 = -1, do_icmp_types = -1, do_ect = -1;
29 +
30 + static uint32_t hash_Ip6InReceives = -1;
31 +
32 + static uint32_t hash_Ip6InHdrErrors = -1;
33 + static uint32_t hash_Ip6InTooBigErrors = -1;
34 + static uint32_t hash_Ip6InNoRoutes = -1;
35 + static uint32_t hash_Ip6InAddrErrors = -1;
36 + static uint32_t hash_Ip6InUnknownProtos = -1;
37 + static uint32_t hash_Ip6InTruncatedPkts = -1;
38 + static uint32_t hash_Ip6InDiscards = -1;
39 + static uint32_t hash_Ip6InDelivers = -1;
40 +
41 + static uint32_t hash_Ip6OutForwDatagrams = -1;
42 + static uint32_t hash_Ip6OutRequests = -1;
43 + static uint32_t hash_Ip6OutDiscards = -1;
44 + static uint32_t hash_Ip6OutNoRoutes = -1;
45 +
46 + static uint32_t hash_Ip6ReasmTimeout = -1;
47 + static uint32_t hash_Ip6ReasmReqds = -1;
48 + static uint32_t hash_Ip6ReasmOKs = -1;
49 + static uint32_t hash_Ip6ReasmFails = -1;
50 +
51 + static uint32_t hash_Ip6FragOKs = -1;
52 + static uint32_t hash_Ip6FragFails = -1;
53 + static uint32_t hash_Ip6FragCreates = -1;
54 +
55 + static uint32_t hash_Ip6InMcastPkts = -1;
56 + static uint32_t hash_Ip6OutMcastPkts = -1;
57 +
58 + static uint32_t hash_Ip6InOctets = -1;
59 + static uint32_t hash_Ip6OutOctets = -1;
60 +
61 + static uint32_t hash_Ip6InMcastOctets = -1;
62 + static uint32_t hash_Ip6OutMcastOctets = -1;
63 + static uint32_t hash_Ip6InBcastOctets = -1;
64 + static uint32_t hash_Ip6OutBcastOctets = -1;
65 +
66 + static uint32_t hash_Ip6InNoECTPkts = -1;
67 + static uint32_t hash_Ip6InECT1Pkts = -1;
68 + static uint32_t hash_Ip6InECT0Pkts = -1;
69 + static uint32_t hash_Ip6InCEPkts = -1;
70 +
71 + static uint32_t hash_Icmp6InMsgs = -1;
72 + static uint32_t hash_Icmp6InErrors = -1;
73 + static uint32_t hash_Icmp6OutMsgs = -1;
74 + static uint32_t hash_Icmp6OutErrors = -1;
75 + static uint32_t hash_Icmp6InCsumErrors = -1;
76 + static uint32_t hash_Icmp6InDestUnreachs = -1;
77 + static uint32_t hash_Icmp6InPktTooBigs = -1;
78 + static uint32_t hash_Icmp6InTimeExcds = -1;
79 + static uint32_t hash_Icmp6InParmProblems = -1;
80 + static uint32_t hash_Icmp6InEchos = -1;
81 + static uint32_t hash_Icmp6InEchoReplies = -1;
82 + static uint32_t hash_Icmp6InGroupMembQueries = -1;
83 + static uint32_t hash_Icmp6InGroupMembResponses = -1;
84 + static uint32_t hash_Icmp6InGroupMembReductions = -1;
85 + static uint32_t hash_Icmp6InRouterSolicits = -1;
86 + static uint32_t hash_Icmp6InRouterAdvertisements = -1;
87 + static uint32_t hash_Icmp6InNeighborSolicits = -1;
88 + static uint32_t hash_Icmp6InNeighborAdvertisements = -1;
89 + static uint32_t hash_Icmp6InRedirects = -1;
90 + static uint32_t hash_Icmp6InMLDv2Reports = -1;
91 + static uint32_t hash_Icmp6OutDestUnreachs = -1;
92 + static uint32_t hash_Icmp6OutPktTooBigs = -1;
93 + static uint32_t hash_Icmp6OutTimeExcds = -1;
94 + static uint32_t hash_Icmp6OutParmProblems = -1;
95 + static uint32_t hash_Icmp6OutEchos = -1;
96 + static uint32_t hash_Icmp6OutEchoReplies = -1;
97 + static uint32_t hash_Icmp6OutGroupMembQueries = -1;
98 + static uint32_t hash_Icmp6OutGroupMembResponses = -1;
99 + static uint32_t hash_Icmp6OutGroupMembReductions = -1;
100 + static uint32_t hash_Icmp6OutRouterSolicits = -1;
101 + static uint32_t hash_Icmp6OutRouterAdvertisements = -1;
102 + static uint32_t hash_Icmp6OutNeighborSolicits = -1;
103 + static uint32_t hash_Icmp6OutNeighborAdvertisements = -1;
104 + static uint32_t hash_Icmp6OutRedirects = -1;
105 + static uint32_t hash_Icmp6OutMLDv2Reports = -1;
106 + static uint32_t hash_Icmp6InType1 = -1;
107 + static uint32_t hash_Icmp6InType128 = -1;
108 + static uint32_t hash_Icmp6InType129 = -1;
109 + static uint32_t hash_Icmp6InType136 = -1;
110 + static uint32_t hash_Icmp6OutType1 = -1;
111 + static uint32_t hash_Icmp6OutType128 = -1;
112 + static uint32_t hash_Icmp6OutType129 = -1;
113 + static uint32_t hash_Icmp6OutType133 = -1;
114 + static uint32_t hash_Icmp6OutType135 = -1;
115 + static uint32_t hash_Icmp6OutType143 = -1;
116 +
117 + static uint32_t hash_Udp6InDatagrams = -1;
118 + static uint32_t hash_Udp6NoPorts = -1;
119 + static uint32_t hash_Udp6InErrors = -1;
120 + static uint32_t hash_Udp6OutDatagrams = -1;
121 + static uint32_t hash_Udp6RcvbufErrors = -1;
122 + static uint32_t hash_Udp6SndbufErrors = -1;
123 + static uint32_t hash_Udp6InCsumErrors = -1;
124 + static uint32_t hash_Udp6IgnoredMulti = -1;
125 +
126 + static uint32_t hash_UdpLite6InDatagrams = -1;
127 + static uint32_t hash_UdpLite6NoPorts = -1;
128 + static uint32_t hash_UdpLite6InErrors = -1;
129 + static uint32_t hash_UdpLite6OutDatagrams = -1;
130 + static uint32_t hash_UdpLite6RcvbufErrors = -1;
131 + static uint32_t hash_UdpLite6SndbufErrors = -1;
132 + static uint32_t hash_UdpLite6InCsumErrors = -1;
133 +
134 + if(gen_hashes != 1) {
135 + gen_hashes = 1;
136 + hash_Ip6InReceives = simple_hash("Ip6InReceives");
137 + hash_Ip6InHdrErrors = simple_hash("Ip6InHdrErrors");
138 + hash_Ip6InTooBigErrors = simple_hash("Ip6InTooBigErrors");
139 + hash_Ip6InNoRoutes = simple_hash("Ip6InNoRoutes");
140 + hash_Ip6InAddrErrors = simple_hash("Ip6InAddrErrors");
141 + hash_Ip6InUnknownProtos = simple_hash("Ip6InUnknownProtos");
142 + hash_Ip6InTruncatedPkts = simple_hash("Ip6InTruncatedPkts");
143 + hash_Ip6InDiscards = simple_hash("Ip6InDiscards");
144 + hash_Ip6InDelivers = simple_hash("Ip6InDelivers");
145 + hash_Ip6OutForwDatagrams = simple_hash("Ip6OutForwDatagrams");
146 + hash_Ip6OutRequests = simple_hash("Ip6OutRequests");
147 + hash_Ip6OutDiscards = simple_hash("Ip6OutDiscards");
148 + hash_Ip6OutNoRoutes = simple_hash("Ip6OutNoRoutes");
149 + hash_Ip6ReasmTimeout = simple_hash("Ip6ReasmTimeout");
150 + hash_Ip6ReasmReqds = simple_hash("Ip6ReasmReqds");
151 + hash_Ip6ReasmOKs = simple_hash("Ip6ReasmOKs");
152 + hash_Ip6ReasmFails = simple_hash("Ip6ReasmFails");
153 + hash_Ip6FragOKs = simple_hash("Ip6FragOKs");
154 + hash_Ip6FragFails = simple_hash("Ip6FragFails");
155 + hash_Ip6FragCreates = simple_hash("Ip6FragCreates");
156 + hash_Ip6InMcastPkts = simple_hash("Ip6InMcastPkts");
157 + hash_Ip6OutMcastPkts = simple_hash("Ip6OutMcastPkts");
158 + hash_Ip6InOctets = simple_hash("Ip6InOctets");
159 + hash_Ip6OutOctets = simple_hash("Ip6OutOctets");
160 + hash_Ip6InMcastOctets = simple_hash("Ip6InMcastOctets");
161 + hash_Ip6OutMcastOctets = simple_hash("Ip6OutMcastOctets");
162 + hash_Ip6InBcastOctets = simple_hash("Ip6InBcastOctets");
163 + hash_Ip6OutBcastOctets = simple_hash("Ip6OutBcastOctets");
164 + hash_Ip6InNoECTPkts = simple_hash("Ip6InNoECTPkts");
165 + hash_Ip6InECT1Pkts = simple_hash("Ip6InECT1Pkts");
166 + hash_Ip6InECT0Pkts = simple_hash("Ip6InECT0Pkts");
167 + hash_Ip6InCEPkts = simple_hash("Ip6InCEPkts");
168 + hash_Icmp6InMsgs = simple_hash("Icmp6InMsgs");
169 + hash_Icmp6InErrors = simple_hash("Icmp6InErrors");
170 + hash_Icmp6OutMsgs = simple_hash("Icmp6OutMsgs");
171 + hash_Icmp6OutErrors = simple_hash("Icmp6OutErrors");
172 + hash_Icmp6InCsumErrors = simple_hash("Icmp6InCsumErrors");
173 + hash_Icmp6InDestUnreachs = simple_hash("Icmp6InDestUnreachs");
174 + hash_Icmp6InPktTooBigs = simple_hash("Icmp6InPktTooBigs");
175 + hash_Icmp6InTimeExcds = simple_hash("Icmp6InTimeExcds");
176 + hash_Icmp6InParmProblems = simple_hash("Icmp6InParmProblems");
177 + hash_Icmp6InEchos = simple_hash("Icmp6InEchos");
178 + hash_Icmp6InEchoReplies = simple_hash("Icmp6InEchoReplies");
179 + hash_Icmp6InGroupMembQueries = simple_hash("Icmp6InGroupMembQueries");
180 + hash_Icmp6InGroupMembResponses = simple_hash("Icmp6InGroupMembResponses");
181 + hash_Icmp6InGroupMembReductions = simple_hash("Icmp6InGroupMembReductions");
182 + hash_Icmp6InRouterSolicits = simple_hash("Icmp6InRouterSolicits");
183 + hash_Icmp6InRouterAdvertisements = simple_hash("Icmp6InRouterAdvertisements");
184 + hash_Icmp6InNeighborSolicits = simple_hash("Icmp6InNeighborSolicits");
185 + hash_Icmp6InNeighborAdvertisements = simple_hash("Icmp6InNeighborAdvertisements");
186 + hash_Icmp6InRedirects = simple_hash("Icmp6InRedirects");
187 + hash_Icmp6InMLDv2Reports = simple_hash("Icmp6InMLDv2Reports");
188 + hash_Icmp6OutDestUnreachs = simple_hash("Icmp6OutDestUnreachs");
189 + hash_Icmp6OutPktTooBigs = simple_hash("Icmp6OutPktTooBigs");
190 + hash_Icmp6OutTimeExcds = simple_hash("Icmp6OutTimeExcds");
191 + hash_Icmp6OutParmProblems = simple_hash("Icmp6OutParmProblems");
192 + hash_Icmp6OutEchos = simple_hash("Icmp6OutEchos");
193 + hash_Icmp6OutEchoReplies = simple_hash("Icmp6OutEchoReplies");
194 + hash_Icmp6OutGroupMembQueries = simple_hash("Icmp6OutGroupMembQueries");
195 + hash_Icmp6OutGroupMembResponses = simple_hash("Icmp6OutGroupMembResponses");
196 + hash_Icmp6OutGroupMembReductions = simple_hash("Icmp6OutGroupMembReductions");
197 + hash_Icmp6OutRouterSolicits = simple_hash("Icmp6OutRouterSolicits");
198 + hash_Icmp6OutRouterAdvertisements = simple_hash("Icmp6OutRouterAdvertisements");
199 + hash_Icmp6OutNeighborSolicits = simple_hash("Icmp6OutNeighborSolicits");
200 + hash_Icmp6OutNeighborAdvertisements = simple_hash("Icmp6OutNeighborAdvertisements");
201 + hash_Icmp6OutRedirects = simple_hash("Icmp6OutRedirects");
202 + hash_Icmp6OutMLDv2Reports = simple_hash("Icmp6OutMLDv2Reports");
203 + hash_Icmp6InType1 = simple_hash("Icmp6InType1");
204 + hash_Icmp6InType128 = simple_hash("Icmp6InType128");
205 + hash_Icmp6InType129 = simple_hash("Icmp6InType129");
206 + hash_Icmp6InType136 = simple_hash("Icmp6InType136");
207 + hash_Icmp6OutType1 = simple_hash("Icmp6OutType1");
208 + hash_Icmp6OutType128 = simple_hash("Icmp6OutType128");
209 + hash_Icmp6OutType129 = simple_hash("Icmp6OutType129");
210 + hash_Icmp6OutType133 = simple_hash("Icmp6OutType133");
211 + hash_Icmp6OutType135 = simple_hash("Icmp6OutType135");
212 + hash_Icmp6OutType143 = simple_hash("Icmp6OutType143");
213 + hash_Udp6InDatagrams = simple_hash("Udp6InDatagrams");
214 + hash_Udp6NoPorts = simple_hash("Udp6NoPorts");
215 + hash_Udp6InErrors = simple_hash("Udp6InErrors");
216 + hash_Udp6OutDatagrams = simple_hash("Udp6OutDatagrams");
217 + hash_Udp6RcvbufErrors = simple_hash("Udp6RcvbufErrors");
218 + hash_Udp6SndbufErrors = simple_hash("Udp6SndbufErrors");
219 + hash_Udp6InCsumErrors = simple_hash("Udp6InCsumErrors");
220 + hash_Udp6IgnoredMulti = simple_hash("Udp6IgnoredMulti");
221 + hash_UdpLite6InDatagrams = simple_hash("UdpLite6InDatagrams");
222 + hash_UdpLite6NoPorts = simple_hash("UdpLite6NoPorts");
223 + hash_UdpLite6InErrors = simple_hash("UdpLite6InErrors");
224 + hash_UdpLite6OutDatagrams = simple_hash("UdpLite6OutDatagrams");
225 + hash_UdpLite6RcvbufErrors = simple_hash("UdpLite6RcvbufErrors");
226 + hash_UdpLite6SndbufErrors = simple_hash("UdpLite6SndbufErrors");
227 + hash_UdpLite6InCsumErrors = simple_hash("UdpLite6InCsumErrors");
228 + }
229 +
230 + if(do_ip_packets == -1) do_ip_packets = config_get_boolean("plugin:proc:/proc/net/snmp6", "ipv6 packets", 1);
231 + if(do_ip_fragsout == -1) do_ip_fragsout = config_get_boolean("plugin:proc:/proc/net/snmp6", "ipv6 fragments sent", 1);
232 + if(do_ip_fragsin == -1) do_ip_fragsin = config_get_boolean("plugin:proc:/proc/net/snmp6", "ipv6 fragments assembly", 1);
233 + if(do_ip_errors == -1) do_ip_errors = config_get_boolean("plugin:proc:/proc/net/snmp6", "ipv6 errors", 1);
234 + if(do_udp_packets == -1) do_udp_packets = config_get_boolean("plugin:proc:/proc/net/snmp6", "ipv6 UDP packets", 1);
235 + if(do_udp_errors == -1) do_udp_errors = config_get_boolean("plugin:proc:/proc/net/snmp6", "ipv6 UDP errors", 1);
236 + if(do_udplite_packets == -1) do_udplite_packets = config_get_boolean("plugin:proc:/proc/net/snmp6", "ipv6 UDPlite packets", 1);
237 + if(do_udplite_errors == -1) do_udplite_errors = config_get_boolean("plugin:proc:/proc/net/snmp6", "ipv6 UDPlite errors", 1);
238 + if(do_bandwidth == -1) do_bandwidth = config_get_boolean("plugin:proc:/proc/net/snmp6", "bandwidth", 1);
239 + if(do_inerrors == -1) do_inerrors = config_get_boolean("plugin:proc:/proc/net/snmp6", "input errors", 1);
240 + if(do_mcast == -1) do_mcast = config_get_boolean("plugin:proc:/proc/net/snmp6", "multicast bandwidth", 1);
241 + if(do_bcast == -1) do_bcast = config_get_boolean("plugin:proc:/proc/net/snmp6", "broadcast bandwidth", 1);
242 + if(do_mcast_p == -1) do_mcast_p = config_get_boolean("plugin:proc:/proc/net/snmp6", "multicast packets", 1);
243 + if(do_bcast_p == -1) do_bcast_p = config_get_boolean("plugin:proc:/proc/net/snmp6", "broadcast packets", 1);
244 + if(do_icmp == -1) do_icmp = config_get_boolean("plugin:proc:/proc/net/snmp6", "icmp", 1);
245 + if(do_icmp_redir == -1) do_icmp_redir = config_get_boolean("plugin:proc:/proc/net/snmp6", "icmp redirects", 1);
246 + if(do_icmp_errors == -1) do_icmp_errors = config_get_boolean("plugin:proc:/proc/net/snmp6", "icmp errors", 1);
247 + if(do_icmp_echos == -1) do_icmp_echos = config_get_boolean("plugin:proc:/proc/net/snmp6", "icmp echos", 1);
248 + if(do_icmp_groupmemb == -1) do_icmp_groupmemb = config_get_boolean("plugin:proc:/proc/net/snmp6", "icmp group membership", 1);
249 + if(do_icmp_router == -1) do_icmp_router = config_get_boolean("plugin:proc:/proc/net/snmp6", "icmp router", 1);
250 + if(do_icmp_neighbor == -1) do_icmp_neighbor = config_get_boolean("plugin:proc:/proc/net/snmp6", "icmp neighbor", 1);
251 + if(do_icmp_mldv2 == -1) do_icmp_mldv2 = config_get_boolean("plugin:proc:/proc/net/snmp6", "icmp mldv2", 1);
252 + if(do_icmp_types == -1) do_icmp_types = config_get_boolean("plugin:proc:/proc/net/snmp6", "icmp types", 1);
253 + if(do_ect == -1) do_ect = config_get_boolean("plugin:proc:/proc/net/snmp6", "ect", 1);
254 +
255 + if(dt) {};
256 +
257 + if(!ff) {
258 + char filename[FILENAME_MAX + 1];
259 + snprintf(filename, FILENAME_MAX, "%s%s", global_host_prefix, "/proc/net/snmp6");
260 + ff = procfile_open(config_get("plugin:proc:/proc/net/snmp6", "filename to monitor", filename), " \t:", PROCFILE_FLAG_DEFAULT);
261 + }
262 + if(!ff) return 1;
263 +
264 + ff = procfile_readall(ff);
265 + if(!ff) return 0; // we return 0, so that we will retry to open it next time
266 +
267 + uint32_t lines = procfile_lines(ff), l;
268 + uint32_t words;
269 +
270 + unsigned long long Ip6InReceives = 0ULL;
271 + unsigned long long Ip6InHdrErrors = 0ULL;
272 + unsigned long long Ip6InTooBigErrors = 0ULL;
273 + unsigned long long Ip6InNoRoutes = 0ULL;
274 + unsigned long long Ip6InAddrErrors = 0ULL;
275 + unsigned long long Ip6InUnknownProtos = 0ULL;
276 + unsigned long long Ip6InTruncatedPkts = 0ULL;
277 + unsigned long long Ip6InDiscards = 0ULL;
278 + unsigned long long Ip6InDelivers = 0ULL;
279 + unsigned long long Ip6OutForwDatagrams = 0ULL;
280 + unsigned long long Ip6OutRequests = 0ULL;
281 + unsigned long long Ip6OutDiscards = 0ULL;
282 + unsigned long long Ip6OutNoRoutes = 0ULL;
283 + unsigned long long Ip6ReasmTimeout = 0ULL;
284 + unsigned long long Ip6ReasmReqds = 0ULL;
285 + unsigned long long Ip6ReasmOKs = 0ULL;
286 + unsigned long long Ip6ReasmFails = 0ULL;
287 + unsigned long long Ip6FragOKs = 0ULL;
288 + unsigned long long Ip6FragFails = 0ULL;
289 + unsigned long long Ip6FragCreates = 0ULL;
290 + unsigned long long Ip6InMcastPkts = 0ULL;
291 + unsigned long long Ip6OutMcastPkts = 0ULL;
292 + unsigned long long Ip6InOctets = 0ULL;
293 + unsigned long long Ip6OutOctets = 0ULL;
294 + unsigned long long Ip6InMcastOctets = 0ULL;
295 + unsigned long long Ip6OutMcastOctets = 0ULL;
296 + unsigned long long Ip6InBcastOctets = 0ULL;
297 + unsigned long long Ip6OutBcastOctets = 0ULL;
298 + unsigned long long Ip6InNoECTPkts = 0ULL;
299 + unsigned long long Ip6InECT1Pkts = 0ULL;
300 + unsigned long long Ip6InECT0Pkts = 0ULL;
301 + unsigned long long Ip6InCEPkts = 0ULL;
302 + unsigned long long Icmp6InMsgs = 0ULL;
303 + unsigned long long Icmp6InErrors = 0ULL;
304 + unsigned long long Icmp6OutMsgs = 0ULL;
305 + unsigned long long Icmp6OutErrors = 0ULL;
306 + unsigned long long Icmp6InCsumErrors = 0ULL;
307 + unsigned long long Icmp6InDestUnreachs = 0ULL;
308 + unsigned long long Icmp6InPktTooBigs = 0ULL;
309 + unsigned long long Icmp6InTimeExcds = 0ULL;
310 + unsigned long long Icmp6InParmProblems = 0ULL;
311 + unsigned long long Icmp6InEchos = 0ULL;
312 + unsigned long long Icmp6InEchoReplies = 0ULL;
313 + unsigned long long Icmp6InGroupMembQueries = 0ULL;
314 + unsigned long long Icmp6InGroupMembResponses = 0ULL;
315 + unsigned long long Icmp6InGroupMembReductions = 0ULL;
316 + unsigned long long Icmp6InRouterSolicits = 0ULL;
317 + unsigned long long Icmp6InRouterAdvertisements = 0ULL;
318 + unsigned long long Icmp6InNeighborSolicits = 0ULL;
319 + unsigned long long Icmp6InNeighborAdvertisements = 0ULL;
320 + unsigned long long Icmp6InRedirects = 0ULL;
321 + unsigned long long Icmp6InMLDv2Reports = 0ULL;
322 + unsigned long long Icmp6OutDestUnreachs = 0ULL;
323 + unsigned long long Icmp6OutPktTooBigs = 0ULL;
324 + unsigned long long Icmp6OutTimeExcds = 0ULL;
325 + unsigned long long Icmp6OutParmProblems = 0ULL;
326 + unsigned long long Icmp6OutEchos = 0ULL;
327 + unsigned long long Icmp6OutEchoReplies = 0ULL;
328 + unsigned long long Icmp6OutGroupMembQueries = 0ULL;
329 + unsigned long long Icmp6OutGroupMembResponses = 0ULL;
330 + unsigned long long Icmp6OutGroupMembReductions = 0ULL;
331 + unsigned long long Icmp6OutRouterSolicits = 0ULL;
332 + unsigned long long Icmp6OutRouterAdvertisements = 0ULL;
333 + unsigned long long Icmp6OutNeighborSolicits = 0ULL;
334 + unsigned long long Icmp6OutNeighborAdvertisements = 0ULL;
335 + unsigned long long Icmp6OutRedirects = 0ULL;
336 + unsigned long long Icmp6OutMLDv2Reports = 0ULL;
337 + unsigned long long Icmp6InType1 = 0ULL;
338 + unsigned long long Icmp6InType128 = 0ULL;
339 + unsigned long long Icmp6InType129 = 0ULL;
340 + unsigned long long Icmp6InType136 = 0ULL;
341 + unsigned long long Icmp6OutType1 = 0ULL;
342 + unsigned long long Icmp6OutType128 = 0ULL;
343 + unsigned long long Icmp6OutType129 = 0ULL;
344 + unsigned long long Icmp6OutType133 = 0ULL;
345 + unsigned long long Icmp6OutType135 = 0ULL;
346 + unsigned long long Icmp6OutType143 = 0ULL;
347 + unsigned long long Udp6InDatagrams = 0ULL;
348 + unsigned long long Udp6NoPorts = 0ULL;
349 + unsigned long long Udp6InErrors = 0ULL;
350 + unsigned long long Udp6OutDatagrams = 0ULL;
351 + unsigned long long Udp6RcvbufErrors = 0ULL;
352 + unsigned long long Udp6SndbufErrors = 0ULL;
353 + unsigned long long Udp6InCsumErrors = 0ULL;
354 + unsigned long long Udp6IgnoredMulti = 0ULL;
355 + unsigned long long UdpLite6InDatagrams = 0ULL;
356 + unsigned long long UdpLite6NoPorts = 0ULL;
357 + unsigned long long UdpLite6InErrors = 0ULL;
358 + unsigned long long UdpLite6OutDatagrams = 0ULL;
359 + unsigned long long UdpLite6RcvbufErrors = 0ULL;
360 + unsigned long long UdpLite6SndbufErrors = 0ULL;
361 + unsigned long long UdpLite6InCsumErrors = 0ULL;
362 +
363 + for(l = 0; l < lines ;l++) {
364 + words = procfile_linewords(ff, l);
365 + if(words < 2) {
366 + if(words) error("Cannot read /proc/net/snmp6 line %d. Expected 2 params, read %d.", l, words);
367 + continue;
368 + }
369 +
370 + char *name = procfile_lineword(ff, l, 0);
371 + char * value = procfile_lineword(ff, l, 1);
372 + if(!name || !*name || !value || !*value) continue;
373 +
374 + uint32_t hash = simple_hash(name);
375 +
376 + if(0) ;
377 + else if(hash == hash_Ip6InReceives && strcmp(name, "Ip6InReceives") == 0) Ip6InReceives = strtoull(value, NULL, 10);
378 + else if(hash == hash_Ip6InHdrErrors && strcmp(name, "Ip6InHdrErrors") == 0) Ip6InHdrErrors = strtoull(value, NULL, 10);
379 + else if(hash == hash_Ip6InTooBigErrors && strcmp(name, "Ip6InTooBigErrors") == 0) Ip6InTooBigErrors = strtoull(value, NULL, 10);
380 + else if(hash == hash_Ip6InNoRoutes && strcmp(name, "Ip6InNoRoutes") == 0) Ip6InNoRoutes = strtoull(value, NULL, 10);
381 + else if(hash == hash_Ip6InAddrErrors && strcmp(name, "Ip6InAddrErrors") == 0) Ip6InAddrErrors = strtoull(value, NULL, 10);
382 + else if(hash == hash_Ip6InUnknownProtos && strcmp(name, "Ip6InUnknownProtos") == 0) Ip6InUnknownProtos = strtoull(value, NULL, 10);
383 + else if(hash == hash_Ip6InTruncatedPkts && strcmp(name, "Ip6InTruncatedPkts") == 0) Ip6InTruncatedPkts = strtoull(value, NULL, 10);
384 + else if(hash == hash_Ip6InDiscards && strcmp(name, "Ip6InDiscards") == 0) Ip6InDiscards = strtoull(value, NULL, 10);
385 + else if(hash == hash_Ip6InDelivers && strcmp(name, "Ip6InDelivers") == 0) Ip6InDelivers = strtoull(value, NULL, 10);
386 + else if(hash == hash_Ip6OutForwDatagrams && strcmp(name, "Ip6OutForwDatagrams") == 0) Ip6OutForwDatagrams = strtoull(value, NULL, 10);
387 + else if(hash == hash_Ip6OutRequests && strcmp(name, "Ip6OutRequests") == 0) Ip6OutRequests = strtoull(value, NULL, 10);
388 + else if(hash == hash_Ip6OutDiscards && strcmp(name, "Ip6OutDiscards") == 0) Ip6OutDiscards = strtoull(value, NULL, 10);
389 + else if(hash == hash_Ip6OutNoRoutes && strcmp(name, "Ip6OutNoRoutes") == 0) Ip6OutNoRoutes = strtoull(value, NULL, 10);
390 + else if(hash == hash_Ip6ReasmTimeout && strcmp(name, "Ip6ReasmTimeout") == 0) Ip6ReasmTimeout = strtoull(value, NULL, 10);
391 + else if(hash == hash_Ip6ReasmReqds && strcmp(name, "Ip6ReasmReqds") == 0) Ip6ReasmReqds = strtoull(value, NULL, 10);
392 + else if(hash == hash_Ip6ReasmOKs && strcmp(name, "Ip6ReasmOKs") == 0) Ip6ReasmOKs = strtoull(value, NULL, 10);
393 + else if(hash == hash_Ip6ReasmFails && strcmp(name, "Ip6ReasmFails") == 0) Ip6ReasmFails = strtoull(value, NULL, 10);
394 + else if(hash == hash_Ip6FragOKs && strcmp(name, "Ip6FragOKs") == 0) Ip6FragOKs = strtoull(value, NULL, 10);
395 + else if(hash == hash_Ip6FragFails && strcmp(name, "Ip6FragFails") == 0) Ip6FragFails = strtoull(value, NULL, 10);
396 + else if(hash == hash_Ip6FragCreates && strcmp(name, "Ip6FragCreates") == 0) Ip6FragCreates = strtoull(value, NULL, 10);
397 + else if(hash == hash_Ip6InMcastPkts && strcmp(name, "Ip6InMcastPkts") == 0) Ip6InMcastPkts = strtoull(value, NULL, 10);
398 + else if(hash == hash_Ip6OutMcastPkts && strcmp(name, "Ip6OutMcastPkts") == 0) Ip6OutMcastPkts = strtoull(value, NULL, 10);
399 + else if(hash == hash_Ip6InOctets && strcmp(name, "Ip6InOctets") == 0) Ip6InOctets = strtoull(value, NULL, 10);
400 + else if(hash == hash_Ip6OutOctets && strcmp(name, "Ip6OutOctets") == 0) Ip6OutOctets = strtoull(value, NULL, 10);
401 + else if(hash == hash_Ip6InMcastOctets && strcmp(name, "Ip6InMcastOctets") == 0) Ip6InMcastOctets = strtoull(value, NULL, 10);
402 + else if(hash == hash_Ip6OutMcastOctets && strcmp(name, "Ip6OutMcastOctets") == 0) Ip6OutMcastOctets = strtoull(value, NULL, 10);
403 + else if(hash == hash_Ip6InBcastOctets && strcmp(name, "Ip6InBcastOctets") == 0) Ip6InBcastOctets = strtoull(value, NULL, 10);
404 + else if(hash == hash_Ip6OutBcastOctets && strcmp(name, "Ip6OutBcastOctets") == 0) Ip6OutBcastOctets = strtoull(value, NULL, 10);
405 + else if(hash == hash_Ip6InNoECTPkts && strcmp(name, "Ip6InNoECTPkts") == 0) Ip6InNoECTPkts = strtoull(value, NULL, 10);
406 + else if(hash == hash_Ip6InECT1Pkts && strcmp(name, "Ip6InECT1Pkts") == 0) Ip6InECT1Pkts = strtoull(value, NULL, 10);
407 + else if(hash == hash_Ip6InECT0Pkts && strcmp(name, "Ip6InECT0Pkts") == 0) Ip6InECT0Pkts = strtoull(value, NULL, 10);
408 + else if(hash == hash_Ip6InCEPkts && strcmp(name, "Ip6InCEPkts") == 0) Ip6InCEPkts = strtoull(value, NULL, 10);
409 + else if(hash == hash_Icmp6InMsgs && strcmp(name, "Icmp6InMsgs") == 0) Icmp6InMsgs = strtoull(value, NULL, 10);
410 + else if(hash == hash_Icmp6InErrors && strcmp(name, "Icmp6InErrors") == 0) Icmp6InErrors = strtoull(value, NULL, 10);
411 + else if(hash == hash_Icmp6OutMsgs && strcmp(name, "Icmp6OutMsgs") == 0) Icmp6OutMsgs = strtoull(value, NULL, 10);
412 + else if(hash == hash_Icmp6OutErrors && strcmp(name, "Icmp6OutErrors") == 0) Icmp6OutErrors = strtoull(value, NULL, 10);
413 + else if(hash == hash_Icmp6InCsumErrors && strcmp(name, "Icmp6InCsumErrors") == 0) Icmp6InCsumErrors = strtoull(value, NULL, 10);
414 + else if(hash == hash_Icmp6InDestUnreachs && strcmp(name, "Icmp6InDestUnreachs") == 0) Icmp6InDestUnreachs = strtoull(value, NULL, 10);
415 + else if(hash == hash_Icmp6InPktTooBigs && strcmp(name, "Icmp6InPktTooBigs") == 0) Icmp6InPktTooBigs = strtoull(value, NULL, 10);
416 + else if(hash == hash_Icmp6InTimeExcds && strcmp(name, "Icmp6InTimeExcds") == 0) Icmp6InTimeExcds = strtoull(value, NULL, 10);
417 + else if(hash == hash_Icmp6InParmProblems && strcmp(name, "Icmp6InParmProblems") == 0) Icmp6InParmProblems = strtoull(value, NULL, 10);
418 + else if(hash == hash_Icmp6InEchos && strcmp(name, "Icmp6InEchos") == 0) Icmp6InEchos = strtoull(value, NULL, 10);
419 + else if(hash == hash_Icmp6InEchoReplies && strcmp(name, "Icmp6InEchoReplies") == 0) Icmp6InEchoReplies = strtoull(value, NULL, 10);
420 + else if(hash == hash_Icmp6InGroupMembQueries && strcmp(name, "Icmp6InGroupMembQueries") == 0) Icmp6InGroupMembQueries = strtoull(value, NULL, 10);
421 + else if(hash == hash_Icmp6InGroupMembResponses && strcmp(name, "Icmp6InGroupMembResponses") == 0) Icmp6InGroupMembResponses = strtoull(value, NULL, 10);
422 + else if(hash == hash_Icmp6InGroupMembReductions && strcmp(name, "Icmp6InGroupMembReductions") == 0) Icmp6InGroupMembReductions = strtoull(value, NULL, 10);
423 + else if(hash == hash_Icmp6InRouterSolicits && strcmp(name, "Icmp6InRouterSolicits") == 0) Icmp6InRouterSolicits = strtoull(value, NULL, 10);
424 + else if(hash == hash_Icmp6InRouterAdvertisements && strcmp(name, "Icmp6InRouterAdvertisements") == 0) Icmp6InRouterAdvertisements = strtoull(value, NULL, 10);
425 + else if(hash == hash_Icmp6InNeighborSolicits && strcmp(name, "Icmp6InNeighborSolicits") == 0) Icmp6InNeighborSolicits = strtoull(value, NULL, 10);
426 + else if(hash == hash_Icmp6InNeighborAdvertisements && strcmp(name, "Icmp6InNeighborAdvertisements") == 0) Icmp6InNeighborAdvertisements = strtoull(value, NULL, 10);
427 + else if(hash == hash_Icmp6InRedirects && strcmp(name, "Icmp6InRedirects") == 0) Icmp6InRedirects = strtoull(value, NULL, 10);
428 + else if(hash == hash_Icmp6InMLDv2Reports && strcmp(name, "Icmp6InMLDv2Reports") == 0) Icmp6InMLDv2Reports = strtoull(value, NULL, 10);
429 + else if(hash == hash_Icmp6OutDestUnreachs && strcmp(name, "Icmp6OutDestUnreachs") == 0) Icmp6OutDestUnreachs = strtoull(value, NULL, 10);
430 + else if(hash == hash_Icmp6OutPktTooBigs && strcmp(name, "Icmp6OutPktTooBigs") == 0) Icmp6OutPktTooBigs = strtoull(value, NULL, 10);
431 + else if(hash == hash_Icmp6OutTimeExcds && strcmp(name, "Icmp6OutTimeExcds") == 0) Icmp6OutTimeExcds = strtoull(value, NULL, 10);
432 + else if(hash == hash_Icmp6OutParmProblems && strcmp(name, "Icmp6OutParmProblems") == 0) Icmp6OutParmProblems = strtoull(value, NULL, 10);
433 + else if(hash == hash_Icmp6OutEchos && strcmp(name, "Icmp6OutEchos") == 0) Icmp6OutEchos = strtoull(value, NULL, 10);
434 + else if(hash == hash_Icmp6OutEchoReplies && strcmp(name, "Icmp6OutEchoReplies") == 0) Icmp6OutEchoReplies = strtoull(value, NULL, 10);
435 + else if(hash == hash_Icmp6OutGroupMembQueries && strcmp(name, "Icmp6OutGroupMembQueries") == 0) Icmp6OutGroupMembQueries = strtoull(value, NULL, 10);
436 + else if(hash == hash_Icmp6OutGroupMembResponses && strcmp(name, "Icmp6OutGroupMembResponses") == 0) Icmp6OutGroupMembResponses = strtoull(value, NULL, 10);
437 + else if(hash == hash_Icmp6OutGroupMembReductions && strcmp(name, "Icmp6OutGroupMembReductions") == 0) Icmp6OutGroupMembReductions = strtoull(value, NULL, 10);
438 + else if(hash == hash_Icmp6OutRouterSolicits && strcmp(name, "Icmp6OutRouterSolicits") == 0) Icmp6OutRouterSolicits = strtoull(value, NULL, 10);
439 + else if(hash == hash_Icmp6OutRouterAdvertisements && strcmp(name, "Icmp6OutRouterAdvertisements") == 0) Icmp6OutRouterAdvertisements = strtoull(value, NULL, 10);
440 + else if(hash == hash_Icmp6OutNeighborSolicits && strcmp(name, "Icmp6OutNeighborSolicits") == 0) Icmp6OutNeighborSolicits = strtoull(value, NULL, 10);
441 + else if(hash == hash_Icmp6OutNeighborAdvertisements && strcmp(name, "Icmp6OutNeighborAdvertisements") == 0) Icmp6OutNeighborAdvertisements = strtoull(value, NULL, 10);
442 + else if(hash == hash_Icmp6OutRedirects && strcmp(name, "Icmp6OutRedirects") == 0) Icmp6OutRedirects = strtoull(value, NULL, 10);
443 + else if(hash == hash_Icmp6OutMLDv2Reports && strcmp(name, "Icmp6OutMLDv2Reports") == 0) Icmp6OutMLDv2Reports = strtoull(value, NULL, 10);
444 + else if(hash == hash_Icmp6InType1 && strcmp(name, "Icmp6InType1") == 0) Icmp6InType1 = strtoull(value, NULL, 10);
445 + else if(hash == hash_Icmp6InType128 && strcmp(name, "Icmp6InType128") == 0) Icmp6InType128 = strtoull(value, NULL, 10);
446 + else if(hash == hash_Icmp6InType129 && strcmp(name, "Icmp6InType129") == 0) Icmp6InType129 = strtoull(value, NULL, 10);
447 + else if(hash == hash_Icmp6InType136 && strcmp(name, "Icmp6InType136") == 0) Icmp6InType136 = strtoull(value, NULL, 10);
448 + else if(hash == hash_Icmp6OutType1 && strcmp(name, "Icmp6OutType1") == 0) Icmp6OutType1 = strtoull(value, NULL, 10);
449 + else if(hash == hash_Icmp6OutType128 && strcmp(name, "Icmp6OutType128") == 0) Icmp6OutType128 = strtoull(value, NULL, 10);
450 + else if(hash == hash_Icmp6OutType129 && strcmp(name, "Icmp6OutType129") == 0) Icmp6OutType129 = strtoull(value, NULL, 10);
451 + else if(hash == hash_Icmp6OutType133 && strcmp(name, "Icmp6OutType133") == 0) Icmp6OutType133 = strtoull(value, NULL, 10);
452 + else if(hash == hash_Icmp6OutType135 && strcmp(name, "Icmp6OutType135") == 0) Icmp6OutType135 = strtoull(value, NULL, 10);
453 + else if(hash == hash_Icmp6OutType143 && strcmp(name, "Icmp6OutType143") == 0) Icmp6OutType143 = strtoull(value, NULL, 10);
454 + else if(hash == hash_Udp6InDatagrams && strcmp(name, "Udp6InDatagrams") == 0) Udp6InDatagrams = strtoull(value, NULL, 10);
455 + else if(hash == hash_Udp6NoPorts && strcmp(name, "Udp6NoPorts") == 0) Udp6NoPorts = strtoull(value, NULL, 10);
456 + else if(hash == hash_Udp6InErrors && strcmp(name, "Udp6InErrors") == 0) Udp6InErrors = strtoull(value, NULL, 10);
457 + else if(hash == hash_Udp6OutDatagrams && strcmp(name, "Udp6OutDatagrams") == 0) Udp6OutDatagrams = strtoull(value, NULL, 10);
458 + else if(hash == hash_Udp6RcvbufErrors && strcmp(name, "Udp6RcvbufErrors") == 0) Udp6RcvbufErrors = strtoull(value, NULL, 10);
459 + else if(hash == hash_Udp6SndbufErrors && strcmp(name, "Udp6SndbufErrors") == 0) Udp6SndbufErrors = strtoull(value, NULL, 10);
460 + else if(hash == hash_Udp6InCsumErrors && strcmp(name, "Udp6InCsumErrors") == 0) Udp6InCsumErrors = strtoull(value, NULL, 10);
461 + else if(hash == hash_Udp6IgnoredMulti && strcmp(name, "Udp6IgnoredMulti") == 0) Udp6IgnoredMulti = strtoull(value, NULL, 10);
462 + else if(hash == hash_UdpLite6InDatagrams && strcmp(name, "UdpLite6InDatagrams") == 0) UdpLite6InDatagrams = strtoull(value, NULL, 10);
463 + else if(hash == hash_UdpLite6NoPorts && strcmp(name, "UdpLite6NoPorts") == 0) UdpLite6NoPorts = strtoull(value, NULL, 10);
464 + else if(hash == hash_UdpLite6InErrors && strcmp(name, "UdpLite6InErrors") == 0) UdpLite6InErrors = strtoull(value, NULL, 10);
465 + else if(hash == hash_UdpLite6OutDatagrams && strcmp(name, "UdpLite6OutDatagrams") == 0) UdpLite6OutDatagrams = strtoull(value, NULL, 10);
466 + else if(hash == hash_UdpLite6RcvbufErrors && strcmp(name, "UdpLite6RcvbufErrors") == 0) UdpLite6RcvbufErrors = strtoull(value, NULL, 10);
467 + else if(hash == hash_UdpLite6SndbufErrors && strcmp(name, "UdpLite6SndbufErrors") == 0) UdpLite6SndbufErrors = strtoull(value, NULL, 10);
468 + else if(hash == hash_UdpLite6InCsumErrors && strcmp(name, "UdpLite6InCsumErrors") == 0) UdpLite6InCsumErrors = strtoull(value, NULL, 10);
469 + }
470 +
471 + RRDSET *st;
472 +
473 + // --------------------------------------------------------------------
474 +
475 + if(do_bandwidth) {
476 + st = rrdset_find("system.ipv6");
477 + if(!st) {
478 + st = rrdset_create("system", "ipv6", NULL, "network", NULL, "IPv6 Bandwidth", "kilobits/s", 500, update_every, RRDSET_TYPE_AREA);
479 +
480 + rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL);
481 + rrddim_add(st, "sent", NULL, -8, 1024, RRDDIM_INCREMENTAL);
482 + }
483 + else rrdset_next(st);
484 +
485 + rrddim_set(st, "sent", Ip6OutOctets);
486 + rrddim_set(st, "received", Ip6InOctets);
487 + rrdset_done(st);
488 + }
489 +
490 + // --------------------------------------------------------------------
491 +
492 + if(do_ip_packets) {
493 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".packets");
494 + if(!st) {
495 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "packets", NULL, "packets", NULL, "IPv6 Packets", "packets/s", 3000, update_every, RRDSET_TYPE_LINE);
496 +
497 + rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
498 + rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
499 + rrddim_add(st, "forwarded", NULL, 1, 1, RRDDIM_INCREMENTAL);
500 + rrddim_add(st, "delivers", NULL, -1, 1, RRDDIM_INCREMENTAL);
501 + }
502 + else rrdset_next(st);
503 +
504 + rrddim_set(st, "sent", Ip6OutRequests);
505 + rrddim_set(st, "received", Ip6InReceives);
506 + rrddim_set(st, "forwarded", Ip6InDelivers);
507 + rrddim_set(st, "delivers", Ip6OutForwDatagrams);
508 + rrdset_done(st);
509 + }
510 +
511 + // --------------------------------------------------------------------
512 +
513 + if(do_ip_fragsout) {
514 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".fragsout");
515 + if(!st) {
516 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "fragsout", NULL, "fragments", NULL, "IPv6 Fragments Sent", "packets/s", 3010, update_every, RRDSET_TYPE_LINE);
517 + st->isdetail = 1;
518 +
519 + rrddim_add(st, "ok", NULL, 1, 1, RRDDIM_INCREMENTAL);
520 + rrddim_add(st, "failed", NULL, -1, 1, RRDDIM_INCREMENTAL);
521 + rrddim_add(st, "all", NULL, 1, 1, RRDDIM_INCREMENTAL);
522 + }
523 + else rrdset_next(st);
524 +
525 + rrddim_set(st, "ok", Ip6FragOKs);
526 + rrddim_set(st, "failed", Ip6FragFails);
527 + rrddim_set(st, "all", Ip6FragCreates);
528 + rrdset_done(st);
529 + }
530 +
531 + // --------------------------------------------------------------------
532 +
533 + if(do_ip_fragsin) {
534 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".fragsin");
535 + if(!st) {
536 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "fragsin", NULL, "fragments", NULL, "IPv6 Fragments Reassembly", "packets/s", 3011, update_every, RRDSET_TYPE_LINE);
537 + st->isdetail = 1;
538 +
539 + rrddim_add(st, "ok", NULL, 1, 1, RRDDIM_INCREMENTAL);
540 + rrddim_add(st, "failed", NULL, -1, 1, RRDDIM_INCREMENTAL);
541 + rrddim_add(st, "timeout", NULL, -1, 1, RRDDIM_INCREMENTAL);
542 + rrddim_add(st, "all", NULL, 1, 1, RRDDIM_INCREMENTAL);
543 + }
544 + else rrdset_next(st);
545 +
546 + rrddim_set(st, "ok", Ip6ReasmOKs);
547 + rrddim_set(st, "failed", Ip6ReasmFails);
548 + rrddim_set(st, "timeout", Ip6ReasmTimeout);
549 + rrddim_set(st, "all", Ip6ReasmReqds);
550 + rrdset_done(st);
551 + }
552 +
553 + // --------------------------------------------------------------------
554 +
555 + if(do_ip_errors) {
556 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".errors");
557 + if(!st) {
558 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "errors", NULL, "errors", NULL, "IPv6 Errors", "packets/s", 3002, update_every, RRDSET_TYPE_LINE);
559 + st->isdetail = 1;
560 +
561 + rrddim_add(st, "InDiscards", NULL, 1, 1, RRDDIM_INCREMENTAL);
562 + rrddim_add(st, "OutDiscards", NULL, -1, 1, RRDDIM_INCREMENTAL);
563 +
564 + rrddim_add(st, "InHdrErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
565 + rrddim_add(st, "InAddrErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
566 + rrddim_add(st, "InUnknownProtos", NULL, 1, 1, RRDDIM_INCREMENTAL);
567 + rrddim_add(st, "InTooBigErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
568 + rrddim_add(st, "InTruncatedPkts", NULL, 1, 1, RRDDIM_INCREMENTAL);
569 + rrddim_add(st, "InNoRoutes", NULL, 1, 1, RRDDIM_INCREMENTAL);
570 +
571 + rrddim_add(st, "OutNoRoutes", NULL, -1, 1, RRDDIM_INCREMENTAL);
572 + }
573 + else rrdset_next(st);
574 +
575 + rrddim_set(st, "InDiscards", Ip6InDiscards);
576 + rrddim_set(st, "OutDiscards", Ip6OutDiscards);
577 +
578 + rrddim_set(st, "InHdrErrors", Ip6InHdrErrors);
579 + rrddim_set(st, "InAddrErrors", Ip6InAddrErrors);
580 + rrddim_set(st, "InUnknownProtos", Ip6InUnknownProtos);
581 + rrddim_set(st, "InTooBigErrors", Ip6InTooBigErrors);
582 + rrddim_set(st, "InTruncatedPkts", Ip6InTruncatedPkts);
583 + rrddim_set(st, "InNoRoutes", Ip6InNoRoutes);
584 +
585 + rrddim_set(st, "OutNoRoutes", Ip6OutNoRoutes);
586 + rrdset_done(st);
587 + }
588 +
589 + // --------------------------------------------------------------------
590 +
591 + if(do_udp_packets) {
592 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".udppackets");
593 + if(!st) {
594 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "udppackets", NULL, "udp", NULL, "IPv6 UDP Packets", "packets/s", 3601, update_every, RRDSET_TYPE_LINE);
595 +
596 + rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
597 + rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
598 + }
599 + else rrdset_next(st);
600 +
601 + rrddim_set(st, "received", Udp6InDatagrams);
602 + rrddim_set(st, "sent", Udp6OutDatagrams);
603 + rrdset_done(st);
604 + }
605 +
606 + // --------------------------------------------------------------------
607 +
608 + if(do_udp_errors) {
609 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".udperrors");
610 + if(!st) {
611 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "udperrors", NULL, "udp", NULL, "IPv6 UDP Errors", "events/s", 3701, update_every, RRDSET_TYPE_LINE);
612 + st->isdetail = 1;
613 +
614 + rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
615 + rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRDDIM_INCREMENTAL);
616 + rrddim_add(st, "InErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
617 + rrddim_add(st, "NoPorts", NULL, 1, 1, RRDDIM_INCREMENTAL);
618 + rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
619 + rrddim_add(st, "IgnoredMulti", NULL, 1, 1, RRDDIM_INCREMENTAL);
620 + }
621 + else rrdset_next(st);
622 +
623 + rrddim_set(st, "InErrors", Udp6InErrors);
624 + rrddim_set(st, "NoPorts", Udp6NoPorts);
625 + rrddim_set(st, "RcvbufErrors", Udp6RcvbufErrors);
626 + rrddim_set(st, "SndbufErrors", Udp6SndbufErrors);
627 + rrddim_set(st, "InCsumErrors", Udp6InCsumErrors);
628 + rrddim_set(st, "IgnoredMulti", Udp6IgnoredMulti);
629 + rrdset_done(st);
630 + }
631 +
632 + // --------------------------------------------------------------------
633 +
634 + if(do_udplite_packets) {
635 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".udplitepackets");
636 + if(!st) {
637 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "udplitepackets", NULL, "udplite", NULL, "IPv6 UDPlite Packets", "packets/s", 3601, update_every, RRDSET_TYPE_LINE);
638 +
639 + rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
640 + rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
641 + }
642 + else rrdset_next(st);
643 +
644 + rrddim_set(st, "received", UdpLite6InDatagrams);
645 + rrddim_set(st, "sent", UdpLite6OutDatagrams);
646 + rrdset_done(st);
647 + }
648 +
649 + // --------------------------------------------------------------------
650 +
651 + if(do_udplite_errors) {
652 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".udpliteerrors");
653 + if(!st) {
654 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "udpliteerrors", NULL, "udplite", NULL, "IPv6 UDP Lite Errors", "events/s", 3701, update_every, RRDSET_TYPE_LINE);
655 + st->isdetail = 1;
656 +
657 + rrddim_add(st, "RcvbufErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
658 + rrddim_add(st, "SndbufErrors", NULL, -1, 1, RRDDIM_INCREMENTAL);
659 + rrddim_add(st, "InErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
660 + rrddim_add(st, "NoPorts", NULL, 1, 1, RRDDIM_INCREMENTAL);
661 + rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
662 + }
663 + else rrdset_next(st);
664 +
665 + rrddim_set(st, "InErrors", UdpLite6InErrors);
666 + rrddim_set(st, "NoPorts", UdpLite6NoPorts);
667 + rrddim_set(st, "RcvbufErrors", UdpLite6RcvbufErrors);
668 + rrddim_set(st, "SndbufErrors", UdpLite6SndbufErrors);
669 + rrddim_set(st, "InCsumErrors", UdpLite6InCsumErrors);
670 + rrdset_done(st);
671 + }
672 +
673 + // --------------------------------------------------------------------
674 +
675 + if(do_mcast) {
676 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".mcast");
677 + if(!st) {
678 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "mcast", NULL, "multicast", NULL, "IPv6 Multicast Bandwidth", "kilobits/s", 9000, update_every, RRDSET_TYPE_AREA);
679 + st->isdetail = 1;
680 +
681 + rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL);
682 + rrddim_add(st, "sent", NULL, -8, 1024, RRDDIM_INCREMENTAL);
683 + }
684 + else rrdset_next(st);
685 +
686 + rrddim_set(st, "sent", Ip6OutMcastOctets);
687 + rrddim_set(st, "received", Ip6InMcastOctets);
688 + rrdset_done(st);
689 + }
690 +
691 + // --------------------------------------------------------------------
692 +
693 + if(do_bcast) {
694 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".bcast");
695 + if(!st) {
696 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "bcast", NULL, "broadcast", NULL, "IPv6 Broadcast Bandwidth", "kilobits/s", 8000, update_every, RRDSET_TYPE_AREA);
697 + st->isdetail = 1;
698 +
699 + rrddim_add(st, "received", NULL, 8, 1024, RRDDIM_INCREMENTAL);
700 + rrddim_add(st, "sent", NULL, -8, 1024, RRDDIM_INCREMENTAL);
701 + }
702 + else rrdset_next(st);
703 +
704 + rrddim_set(st, "sent", Ip6OutBcastOctets);
705 + rrddim_set(st, "received", Ip6InBcastOctets);
706 + rrdset_done(st);
707 + }
708 +
709 + // --------------------------------------------------------------------
710 +
711 + if(do_mcast_p) {
712 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".mcastpkts");
713 + if(!st) {
714 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "mcastpkts", NULL, "multicast", NULL, "IPv6 Multicast Packets", "packets/s", 9500, update_every, RRDSET_TYPE_LINE);
715 + st->isdetail = 1;
716 +
717 + rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
718 + rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
719 + }
720 + else rrdset_next(st);
721 +
722 + rrddim_set(st, "sent", Ip6OutMcastPkts);
723 + rrddim_set(st, "received", Ip6InMcastPkts);
724 + rrdset_done(st);
725 + }
726 +
727 + // --------------------------------------------------------------------
728 +
729 + if(do_icmp) {
730 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".icmp");
731 + if(!st) {
732 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "icmp", NULL, "icmp", NULL, "IPv6 ICMP Messages", "messages/s", 10000, update_every, RRDSET_TYPE_LINE);
733 +
734 + rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
735 + rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
736 + }
737 + else rrdset_next(st);
738 +
739 + rrddim_set(st, "sent", Icmp6InMsgs);
740 + rrddim_set(st, "received", Icmp6OutMsgs);
741 + rrdset_done(st);
742 + }
743 +
744 + // --------------------------------------------------------------------
745 +
746 + if(do_icmp_redir) {
747 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".icmpredir");
748 + if(!st) {
749 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "icmpredir", NULL, "icmp", NULL, "IPv6 ICMP Redirects", "redirects/s", 10050, update_every, RRDSET_TYPE_LINE);
750 +
751 + rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
752 + rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
753 + }
754 + else rrdset_next(st);
755 +
756 + rrddim_set(st, "sent", Icmp6InRedirects);
757 + rrddim_set(st, "received", Icmp6OutRedirects);
758 + rrdset_done(st);
759 + }
760 +
761 + // --------------------------------------------------------------------
762 +
763 + if(do_icmp_errors) {
764 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".icmperrors");
765 + if(!st) {
766 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "icmperrors", NULL, "icmp", NULL, "IPv6 ICMP Errors", "errors/s", 10100, update_every, RRDSET_TYPE_LINE);
767 +
768 + rrddim_add(st, "InErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
769 + rrddim_add(st, "OutErrors", NULL, -1, 1, RRDDIM_INCREMENTAL);
770 +
771 + rrddim_add(st, "InCsumErrors", NULL, 1, 1, RRDDIM_INCREMENTAL);
772 + rrddim_add(st, "InDestUnreachs", NULL, 1, 1, RRDDIM_INCREMENTAL);
773 + rrddim_add(st, "InPktTooBigs", NULL, 1, 1, RRDDIM_INCREMENTAL);
774 + rrddim_add(st, "InTimeExcds", NULL, 1, 1, RRDDIM_INCREMENTAL);
775 + rrddim_add(st, "InParmProblems", NULL, 1, 1, RRDDIM_INCREMENTAL);
776 + rrddim_add(st, "OutDestUnreachs", NULL, -1, 1, RRDDIM_INCREMENTAL);
777 + rrddim_add(st, "OutPktTooBigs", NULL, -1, 1, RRDDIM_INCREMENTAL);
778 + rrddim_add(st, "OutTimeExcds", NULL, -1, 1, RRDDIM_INCREMENTAL);
779 + rrddim_add(st, "OutParmProblems", NULL, -1, 1, RRDDIM_INCREMENTAL);
780 + }
781 + else rrdset_next(st);
782 +
783 + rrddim_set(st, "InErrors", Icmp6InErrors);
784 + rrddim_set(st, "OutErrors", Icmp6OutErrors);
785 + rrddim_set(st, "InCsumErrors", Icmp6InCsumErrors);
786 + rrddim_set(st, "InDestUnreachs", Icmp6InDestUnreachs);
787 + rrddim_set(st, "InPktTooBigs", Icmp6InPktTooBigs);
788 + rrddim_set(st, "InTimeExcds", Icmp6InTimeExcds);
789 + rrddim_set(st, "InParmProblems", Icmp6InParmProblems);
790 + rrddim_set(st, "OutDestUnreachs", Icmp6OutDestUnreachs);
791 + rrddim_set(st, "OutPktTooBigs", Icmp6OutPktTooBigs);
792 + rrddim_set(st, "OutTimeExcds", Icmp6OutTimeExcds);
793 + rrddim_set(st, "OutParmProblems", Icmp6OutParmProblems);
794 + rrdset_done(st);
795 + }
796 +
797 + // --------------------------------------------------------------------
798 +
799 + if(do_icmp_echos) {
800 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".icmpechos");
801 + if(!st) {
802 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "icmpechos", NULL, "icmp", NULL, "IPv6 ICMP Echo", "messages/s", 10200, update_every, RRDSET_TYPE_LINE);
803 +
804 + rrddim_add(st, "InEchos", NULL, 1, 1, RRDDIM_INCREMENTAL);
805 + rrddim_add(st, "OutEchos", NULL, -1, 1, RRDDIM_INCREMENTAL);
806 + rrddim_add(st, "InEchoReplies", NULL, 1, 1, RRDDIM_INCREMENTAL);
807 + rrddim_add(st, "OutEchoReplies", NULL, -1, 1, RRDDIM_INCREMENTAL);
808 + }
809 + else rrdset_next(st);
810 +
811 + rrddim_set(st, "InEchos", Icmp6InEchos);
812 + rrddim_set(st, "OutEchos", Icmp6OutEchos);
813 + rrddim_set(st, "InEchoReplies", Icmp6InEchoReplies);
814 + rrddim_set(st, "OutEchoReplies", Icmp6OutEchoReplies);
815 + rrdset_done(st);
816 + }
817 +
818 + // --------------------------------------------------------------------
819 +
820 + if(do_icmp_groupmemb) {
821 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".groupmemb");
822 + if(!st) {
823 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "groupmemb", NULL, "icmp", NULL, "IPv6 ICMP Group Membership", "messages/s", 10300, update_every, RRDSET_TYPE_LINE);
824 +
825 + rrddim_add(st, "InQueries", NULL, 1, 1, RRDDIM_INCREMENTAL);
826 + rrddim_add(st, "OutQueries", NULL, -1, 1, RRDDIM_INCREMENTAL);
827 + rrddim_add(st, "InResponses", NULL, 1, 1, RRDDIM_INCREMENTAL);
828 + rrddim_add(st, "OutResponses", NULL, -1, 1, RRDDIM_INCREMENTAL);
829 + rrddim_add(st, "InReductions", NULL, 1, 1, RRDDIM_INCREMENTAL);
830 + rrddim_add(st, "OutReductions", NULL, -1, 1, RRDDIM_INCREMENTAL);
831 + }
832 + else rrdset_next(st);
833 +
834 + rrddim_set(st, "InQueries", Icmp6InGroupMembQueries);
835 + rrddim_set(st, "OutQueries", Icmp6OutGroupMembQueries);
836 + rrddim_set(st, "InResponses", Icmp6InGroupMembResponses);
837 + rrddim_set(st, "OutResponses", Icmp6OutGroupMembResponses);
838 + rrddim_set(st, "InReductions", Icmp6InGroupMembReductions);
839 + rrddim_set(st, "OutReductions", Icmp6OutGroupMembReductions);
840 + rrdset_done(st);
841 + }
842 +
843 + // --------------------------------------------------------------------
844 +
845 + if(do_icmp_router) {
846 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".icmprouter");
847 + if(!st) {
848 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "icmprouter", NULL, "icmp", NULL, "IPv6 Router Messages", "messages/s", 10400, update_every, RRDSET_TYPE_LINE);
849 +
850 + rrddim_add(st, "InSolicits", NULL, 1, 1, RRDDIM_INCREMENTAL);
851 + rrddim_add(st, "OutSolicits", NULL, -1, 1, RRDDIM_INCREMENTAL);
852 + rrddim_add(st, "InAdvertisements", NULL, 1, 1, RRDDIM_INCREMENTAL);
853 + rrddim_add(st, "OutAdvertisements", NULL, -1, 1, RRDDIM_INCREMENTAL);
854 + }
855 + else rrdset_next(st);
856 +
857 + rrddim_set(st, "InSolicits", Icmp6InRouterSolicits);
858 + rrddim_set(st, "OutSolicits", Icmp6OutRouterSolicits);
859 + rrddim_set(st, "InAdvertisements", Icmp6InRouterAdvertisements);
860 + rrddim_set(st, "OutAdvertisements", Icmp6OutRouterAdvertisements);
861 + rrdset_done(st);
862 + }
863 +
864 + // --------------------------------------------------------------------
865 +
866 + if(do_icmp_neighbor) {
867 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".icmpneighbor");
868 + if(!st) {
869 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "icmpneighbor", NULL, "icmp", NULL, "IPv6 Neighbor Messages", "messages/s", 10500, update_every, RRDSET_TYPE_LINE);
870 +
871 + rrddim_add(st, "InSolicits", NULL, 1, 1, RRDDIM_INCREMENTAL);
872 + rrddim_add(st, "OutSolicits", NULL, -1, 1, RRDDIM_INCREMENTAL);
873 + rrddim_add(st, "InAdvertisements", NULL, 1, 1, RRDDIM_INCREMENTAL);
874 + rrddim_add(st, "OutAdvertisements", NULL, -1, 1, RRDDIM_INCREMENTAL);
875 + }
876 + else rrdset_next(st);
877 +
878 + rrddim_set(st, "InSolicits", Icmp6InNeighborSolicits);
879 + rrddim_set(st, "OutSolicits", Icmp6OutNeighborSolicits);
880 + rrddim_set(st, "InAdvertisements", Icmp6InNeighborAdvertisements);
881 + rrddim_set(st, "OutAdvertisements", Icmp6OutNeighborAdvertisements);
882 + rrdset_done(st);
883 + }
884 +
885 + // --------------------------------------------------------------------
886 +
887 + if(do_icmp_mldv2) {
888 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".icmpmldv2");
889 + if(!st) {
890 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "icmpmldv2", NULL, "icmp", NULL, "IPv6 ICMP MLDv2 Reports", "reports/s", 10600, update_every, RRDSET_TYPE_LINE);
891 +
892 + rrddim_add(st, "received", NULL, 1, 1, RRDDIM_INCREMENTAL);
893 + rrddim_add(st, "sent", NULL, -1, 1, RRDDIM_INCREMENTAL);
894 + }
895 + else rrdset_next(st);
896 +
897 + rrddim_set(st, "sent", Icmp6InMLDv2Reports);
898 + rrddim_set(st, "received", Icmp6OutMLDv2Reports);
899 + rrdset_done(st);
900 + }
901 +
902 + // --------------------------------------------------------------------
903 +
904 + if(do_icmp_types) {
905 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".icmptypes");
906 + if(!st) {
907 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "icmptypes", NULL, "icmp", NULL, "IPv6 ICMP Types", "messages/s", 10700, update_every, RRDSET_TYPE_LINE);
908 +
909 + rrddim_add(st, "InType1", NULL, 1, 1, RRDDIM_INCREMENTAL);
910 + rrddim_add(st, "InType128", NULL, 1, 1, RRDDIM_INCREMENTAL);
911 + rrddim_add(st, "InType129", NULL, 1, 1, RRDDIM_INCREMENTAL);
912 + rrddim_add(st, "InType136", NULL, 1, 1, RRDDIM_INCREMENTAL);
913 + rrddim_add(st, "OutType1", NULL, -1, 1, RRDDIM_INCREMENTAL);
914 + rrddim_add(st, "OutType128", NULL, -1, 1, RRDDIM_INCREMENTAL);
915 + rrddim_add(st, "OutType129", NULL, -1, 1, RRDDIM_INCREMENTAL);
916 + rrddim_add(st, "OutType133", NULL, -1, 1, RRDDIM_INCREMENTAL);
917 + rrddim_add(st, "OutType135", NULL, -1, 1, RRDDIM_INCREMENTAL);
918 + rrddim_add(st, "OutType143", NULL, -1, 1, RRDDIM_INCREMENTAL);
919 + }
920 + else rrdset_next(st);
921 +
922 + rrddim_set(st, "InType1", Icmp6InType1);
923 + rrddim_set(st, "InType128", Icmp6InType128);
924 + rrddim_set(st, "InType129", Icmp6InType129);
925 + rrddim_set(st, "InType136", Icmp6InType136);
926 + rrddim_set(st, "OutType1", Icmp6OutType1);
927 + rrddim_set(st, "OutType128", Icmp6OutType128);
928 + rrddim_set(st, "OutType129", Icmp6OutType129);
929 + rrddim_set(st, "OutType133", Icmp6OutType133);
930 + rrddim_set(st, "OutType135", Icmp6OutType135);
931 + rrddim_set(st, "OutType143", Icmp6OutType143);
932 + rrdset_done(st);
933 + }
934 +
935 + // --------------------------------------------------------------------
936 +
937 + if(do_ect) {
938 + st = rrdset_find(RRD_TYPE_NET_SNMP6 ".ect");
939 + if(!st) {
940 + st = rrdset_create(RRD_TYPE_NET_SNMP6, "ect", NULL, "packets", NULL, "IPv6 ECT Packets", "packets/s", 10800, update_every, RRDSET_TYPE_LINE);
941 +
942 + rrddim_add(st, "InNoECTPkts", NULL, 1, 1, RRDDIM_INCREMENTAL);
943 + rrddim_add(st, "InECT1Pkts", NULL, 1, 1, RRDDIM_INCREMENTAL);
944 + rrddim_add(st, "InECT0Pkts", NULL, 1, 1, RRDDIM_INCREMENTAL);
945 + rrddim_add(st, "InCEPkts", NULL, 1, 1, RRDDIM_INCREMENTAL);
946 + }
947 + else rrdset_next(st);
948 +
949 + rrddim_set(st, "InNoECTPkts", Ip6InNoECTPkts);
950 + rrddim_set(st, "InECT1Pkts", Ip6InECT1Pkts);
951 + rrddim_set(st, "InECT0Pkts", Ip6InECT0Pkts);
952 + rrddim_set(st, "InCEPkts", Ip6InCEPkts);
953 + rrdset_done(st);
954 + }
955 +
956 + return 0;
957 +}
958 +
src/proc_vmstat.c
-3
@@ -13,9 +13,6 @@
13 #include "rrd.h"
14 #include "plugin_proc.h"
15
16 -#define MAX_PROC_VMSTAT_LINE 4096
17 -#define MAX_PROC_VMSTAT_NAME 1024
18 -
16 int do_proc_vmstat(int update_every, unsigned long long dt) {
17 static procfile *ff = NULL;
18 static int do_swapio = -1, do_io = -1, do_pgfaults = -1, gen_hashes = -1;
web/index.html
+33 -1
@@ -814,6 +814,11 @@ var menuData = {
814 info: undefined
815 },
816
817 + 'ipv6': {
818 + title: 'IPv6 Networking',
819 + info: undefined
820 + },
821 +
822 'ipvs': {
823 title: 'IP Virtual Server',
824 info: undefined
@@ -936,7 +941,11 @@ var chartData = {
941 },
942
943 'system.ipv4': {
939 - info: 'Total IPv4 Traffic, read from <code>/proc/net/netstat</code>. This includes <code>lo</code> device traffic.'
944 + info: 'Total IPv4 Traffic, read from <code>/proc/net/netstat</code>.'
945 + },
946 +
947 + 'system.ipv6': {
948 + info: 'Total IPv6 Traffic, read from <code>/proc/net/snmp6</code>.'
949 },
950
951 'system.ram': {
@@ -1297,6 +1306,29 @@ function headMain(charts, duration) {
1306 + ' data-points="' + duration.toString() + '"'
1307 + ' role="application"></div>';
1308 }
1309 + else if(typeof charts['system.ipv6'] !== 'undefined') {
1310 + head += '<div style="margin-right: 10px;" data-netdata="system.ipv6"'
1311 + + ' data-dimensions="received"'
1312 + + ' data-chart-library="easypiechart"'
1313 + + ' data-title="IPv6 Inbound"'
1314 + + ' data-units="kbps"'
1315 + + ' data-width="10%"'
1316 + + ' data-before="0"'
1317 + + ' data-after="-' + duration.toString() + '"'
1318 + + ' data-points="' + duration.toString() + '"'
1319 + + ' role="application"></div>';
1320 +
1321 + head += '<div style="margin-right: 10px;" data-netdata="system.ipv6"'
1322 + + ' data-dimensions="sent"'
1323 + + ' data-chart-library="easypiechart"'
1324 + + ' data-title="IPv6 Outbound"'
1325 + + ' data-units="kbps"'
1326 + + ' data-width="10%"'
1327 + + ' data-before="0"'
1328 + + ' data-after="-' + duration.toString() + '"'
1329 + + ' data-points="' + duration.toString() + '"'
1330 + + ' role="application"></div>';
1331 + }
1332
1333 if(typeof charts['system.ram'] !== 'undefined')
1334 head += '<div style="margin-right: 10px;" data-netdata="system.ram"'