@cryptotaxi247 / netdata-1 / commits / e1f246410

fix(collectors/cgroups): use different context for cgroup network charts (#12454)

Ilya Mashchenko committed Mar 18, 2022 at 18:57 UTC e1f24641031b7f9ff29987fabf0575db2dcf79ca
4 files changed +238 -124
collectors/proc.plugin/proc_net_dev.c
+64 -23
@@ -75,6 +75,19 @@ static struct netdev {
75 const char *chart_id_net_carrier;
76 const char *chart_id_net_mtu;
77
78 + const char *chart_ctx_net_bytes;
79 + const char *chart_ctx_net_packets;
80 + const char *chart_ctx_net_errors;
81 + const char *chart_ctx_net_fifo;
82 + const char *chart_ctx_net_events;
83 + const char *chart_ctx_net_drops;
84 + const char *chart_ctx_net_compressed;
85 + const char *chart_ctx_net_speed;
86 + const char *chart_ctx_net_duplex;
87 + const char *chart_ctx_net_operstate;
88 + const char *chart_ctx_net_carrier;
89 + const char *chart_ctx_net_mtu;
90 +
91 const char *chart_family;
92
93 struct label *chart_labels;
@@ -241,6 +254,19 @@ static void netdev_free_chart_strings(struct netdev *d) {
254 freez((void *)d->chart_id_net_carrier);
255 freez((void *)d->chart_id_net_mtu);
256
257 + freez((void *)d->chart_ctx_net_bytes);
258 + freez((void *)d->chart_ctx_net_compressed);
259 + freez((void *)d->chart_ctx_net_drops);
260 + freez((void *)d->chart_ctx_net_errors);
261 + freez((void *)d->chart_ctx_net_events);
262 + freez((void *)d->chart_ctx_net_fifo);
263 + freez((void *)d->chart_ctx_net_packets);
264 + freez((void *)d->chart_ctx_net_speed);
265 + freez((void *)d->chart_ctx_net_duplex);
266 + freez((void *)d->chart_ctx_net_operstate);
267 + freez((void *)d->chart_ctx_net_carrier);
268 + freez((void *)d->chart_ctx_net_mtu);
269 +
270 freez((void *)d->chart_family);
271 }
272
@@ -384,40 +410,42 @@ static inline void netdev_rename_cgroup(struct netdev *d, struct netdev_rename *
410
411 snprintfz(buffer, RRD_ID_LENGTH_MAX, "net_%s", r->container_device);
412 d->chart_id_net_bytes = strdupz(buffer);
387 -
413 snprintfz(buffer, RRD_ID_LENGTH_MAX, "net_compressed_%s", r->container_device);
414 d->chart_id_net_compressed = strdupz(buffer);
390 -
415 snprintfz(buffer, RRD_ID_LENGTH_MAX, "net_drops_%s", r->container_device);
416 d->chart_id_net_drops = strdupz(buffer);
393 -
417 snprintfz(buffer, RRD_ID_LENGTH_MAX, "net_errors_%s", r->container_device);
418 d->chart_id_net_errors = strdupz(buffer);
396 -
419 snprintfz(buffer, RRD_ID_LENGTH_MAX, "net_events_%s", r->container_device);
420 d->chart_id_net_events = strdupz(buffer);
399 -
421 snprintfz(buffer, RRD_ID_LENGTH_MAX, "net_fifo_%s", r->container_device);
422 d->chart_id_net_fifo = strdupz(buffer);
402 -
423 snprintfz(buffer, RRD_ID_LENGTH_MAX, "net_packets_%s", r->container_device);
424 d->chart_id_net_packets = strdupz(buffer);
405 -
425 snprintfz(buffer, RRD_ID_LENGTH_MAX, "net_speed_%s", r->container_device);
426 d->chart_id_net_speed = strdupz(buffer);
408 -
427 snprintfz(buffer, RRD_ID_LENGTH_MAX, "net_duplex_%s", r->container_device);
428 d->chart_id_net_duplex = strdupz(buffer);
411 -
429 snprintfz(buffer, RRD_ID_LENGTH_MAX, "net_operstate_%s", r->container_device);
430 d->chart_id_net_operstate = strdupz(buffer);
414 -
431 snprintfz(buffer, RRD_ID_LENGTH_MAX, "net_carrier_%s", r->container_device);
432 d->chart_id_net_carrier = strdupz(buffer);
417 -
433 snprintfz(buffer, RRD_ID_LENGTH_MAX, "net_mtu_%s", r->container_device);
434 d->chart_id_net_mtu = strdupz(buffer);
435
436 + d->chart_ctx_net_bytes = strdupz("cgroup.net_net");
437 + d->chart_ctx_net_compressed = strdupz("cgroup.net_compressed");
438 + d->chart_ctx_net_drops = strdupz("cgroup.net_drops");
439 + d->chart_ctx_net_errors = strdupz("cgroup.net_errors");
440 + d->chart_ctx_net_events = strdupz("cgroup.net_events");
441 + d->chart_ctx_net_fifo = strdupz("cgroup.net_fifo");
442 + d->chart_ctx_net_packets = strdupz("cgroup.net_packets");
443 + d->chart_ctx_net_speed = strdupz("cgroup.net_speed");
444 + d->chart_ctx_net_duplex = strdupz("cgroup.net_duplex");
445 + d->chart_ctx_net_operstate = strdupz("cgroup.net_operstate");
446 + d->chart_ctx_net_carrier = strdupz("cgroup.net_carrier");
447 + d->chart_ctx_net_mtu = strdupz("cgroup.net_mtu");
448 +
449 snprintfz(buffer, RRD_ID_LENGTH_MAX, "net %s", r->container_device);
450 d->chart_family = strdupz(buffer);
451
@@ -541,6 +569,19 @@ static struct netdev *get_netdev(const char *name) {
569 d->chart_id_net_carrier = strdupz(d->name);
570 d->chart_id_net_mtu = strdupz(d->name);
571
572 + d->chart_ctx_net_bytes = strdupz("net.net");
573 + d->chart_ctx_net_compressed = strdupz("net.compressed");
574 + d->chart_ctx_net_drops = strdupz("net.drops");
575 + d->chart_ctx_net_errors = strdupz("net.errors");
576 + d->chart_ctx_net_events = strdupz("net.events");
577 + d->chart_ctx_net_fifo = strdupz("net.fifo");
578 + d->chart_ctx_net_packets = strdupz("net.packets");
579 + d->chart_ctx_net_speed = strdupz("net.speed");
580 + d->chart_ctx_net_duplex = strdupz("net.duplex");
581 + d->chart_ctx_net_operstate = strdupz("net.operstate");
582 + d->chart_ctx_net_carrier = strdupz("net.carrier");
583 + d->chart_ctx_net_mtu = strdupz("net.mtu");
584 +
585 d->chart_family = strdupz(d->name);
586 d->priority = NETDATA_CHART_PRIO_FIRST_NET_IFACE;
587
@@ -825,7 +866,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
866 , d->chart_id_net_bytes
867 , NULL
868 , d->chart_family
828 - , "net.net"
869 + , d->chart_ctx_net_bytes
870 , "Bandwidth"
871 , "kilobits/s"
872 , PLUGIN_PROC_NAME
@@ -881,7 +922,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
922 , d->chart_id_net_speed
923 , NULL
924 , d->chart_family
884 - , "net.speed"
925 + , d->chart_ctx_net_speed
926 , "Interface Speed"
927 , "kilobits/s"
928 , PLUGIN_PROC_NAME
@@ -916,7 +957,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
957 , d->chart_id_net_duplex
958 , NULL
959 , d->chart_family
919 - , "net.duplex"
960 + , d->chart_ctx_net_duplex
961 , "Interface Duplex State"
962 , "state"
963 , PLUGIN_PROC_NAME
@@ -947,7 +988,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
988 , d->chart_id_net_operstate
989 , NULL
990 , d->chart_family
950 - , "net.operstate"
991 + , d->chart_ctx_net_operstate
992 , "Interface Operational State"
993 , "state"
994 , PLUGIN_PROC_NAME
@@ -978,7 +1019,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
1019 , d->chart_id_net_carrier
1020 , NULL
1021 , d->chart_family
981 - , "net.carrier"
1022 + , d->chart_ctx_net_carrier
1023 , "Interface Physical Link State"
1024 , "state"
1025 , PLUGIN_PROC_NAME
@@ -1009,7 +1050,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
1050 , d->chart_id_net_mtu
1051 , NULL
1052 , d->chart_family
1012 - , "net.mtu"
1053 + , d->chart_ctx_net_mtu
1054 , "Interface MTU"
1055 , "octets"
1056 , PLUGIN_PROC_NAME
@@ -1045,7 +1086,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
1086 , d->chart_id_net_packets
1087 , NULL
1088 , d->chart_family
1048 - , "net.packets"
1089 + , d->chart_ctx_net_packets
1090 , "Packets"
1091 , "packets/s"
1092 , PLUGIN_PROC_NAME
@@ -1093,7 +1134,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
1134 , d->chart_id_net_errors
1135 , NULL
1136 , d->chart_family
1096 - , "net.errors"
1137 + , d->chart_ctx_net_errors
1138 , "Interface Errors"
1139 , "errors/s"
1140 , PLUGIN_PROC_NAME
@@ -1139,7 +1180,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
1180 , d->chart_id_net_drops
1181 , NULL
1182 , d->chart_family
1142 - , "net.drops"
1183 + , d->chart_ctx_net_drops
1184 , "Interface Drops"
1185 , "drops/s"
1186 , PLUGIN_PROC_NAME
@@ -1185,7 +1226,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
1226 , d->chart_id_net_fifo
1227 , NULL
1228 , d->chart_family
1188 - , "net.fifo"
1229 + , d->chart_ctx_net_fifo
1230 , "Interface FIFO Buffer Errors"
1231 , "errors"
1232 , PLUGIN_PROC_NAME
@@ -1231,7 +1272,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
1272 , d->chart_id_net_compressed
1273 , NULL
1274 , d->chart_family
1234 - , "net.compressed"
1275 + , d->chart_ctx_net_compressed
1276 , "Compressed Packets"
1277 , "packets/s"
1278 , PLUGIN_PROC_NAME
@@ -1277,7 +1318,7 @@ int do_proc_net_dev(int update_every, usec_t dt) {
1318 , d->chart_id_net_events
1319 , NULL
1320 , d->chart_family
1280 - , "net.events"
1321 + , d->chart_ctx_net_events
1322 , "Network Interface Events"
1323 , "events/s"
1324 , PLUGIN_PROC_NAME
health/health.d/cgroups.conf
+37
@@ -32,3 +32,40 @@ component: Memory
32 delay: down 15m multiplier 1.5 max 1h
33 info: cgroup memory utilization
34 to: sysadmin
35 +
36 +# -----------------------------------------------------------------------------
37 +# check for packet storms
38 +
39 +# 1. calculate the rate packets are received in 1m: 1m_received_packets_rate
40 +# 2. do the same for the last 10s
41 +# 3. raise an alarm if the later is 10x or 20x the first
42 +# we assume the minimum packet storm should at least have
43 +# 10000 packets/s, average of the last 10 seconds
44 +
45 + template: cgroup_1m_received_packets_rate
46 + on: cgroup.net_packets
47 + class: Workload
48 + type: Cgroups
49 +component: Network
50 + hosts: *
51 + lookup: average -1m unaligned of received
52 + units: packets
53 + every: 10s
54 + info: average number of packets received by the network interface $family over the last minute
55 +
56 + template: cgroup_10s_received_packets_storm
57 + on: cgroup.net_packets
58 + class: Workload
59 + type: Cgroups
60 +component: Network
61 + hosts: *
62 + lookup: average -10s unaligned of received
63 + calc: $this * 100 / (($1m_received_packets_rate < 1000)?(1000):($1m_received_packets_rate))
64 + every: 10s
65 + units: %
66 + warn: $this > (($status >= $WARNING)?(200):(5000))
67 + crit: $this > (($status == $CRITICAL)?(5000):(6000))
68 + options: no-clear-notification
69 + info: ratio of average number of received packets for the network interface $family over the last 10 seconds, \
70 + compared to the rate over the last minute
71 + to: sysadmin
health/health.d/net.conf
+4 -4
@@ -68,7 +68,7 @@ component: Network
68 component: Network
69 os: linux
70 hosts: *
71 - families: !net* *
71 + families: *
72 lookup: sum -10m unaligned absolute of inbound
73 units: packets
74 every: 1m
@@ -81,7 +81,7 @@ component: Network
81 component: Network
82 os: linux
83 hosts: *
84 - families: !net* *
84 + families: *
85 lookup: sum -10m unaligned absolute of outbound
86 units: packets
87 every: 1m
@@ -94,7 +94,7 @@ component: Network
94 component: Network
95 os: linux
96 hosts: *
97 - families: !net* !wl* *
97 + families: !wl* *
98 lookup: sum -10m unaligned absolute of received
99 calc: (($inbound_packets_dropped != nan AND $this > 10000) ? ($inbound_packets_dropped * 100 / $this) : (0))
100 units: %
@@ -111,7 +111,7 @@ component: Network
111 component: Network
112 os: linux
113 hosts: *
114 - families: !net* !wl* *
114 + families: !wl* *
115 lookup: sum -10m unaligned absolute of sent
116 calc: (($outbound_packets_dropped != nan AND $this > 1000) ? ($outbound_packets_dropped * 100 / $this) : (0))
117 units: %
web/gui/dashboard_info.js
+133 -97
@@ -1080,6 +1080,62 @@ netdataDashboard.submenu = {
1080 var cgroupCPULimitIsSet = 0;
1081 var cgroupMemLimitIsSet = 0;
1082
1083 +const netBytesInfo = 'The amount of traffic transferred by the network interface.'
1084 +const netPacketsInfo = 'The number of packets transferred by the network interface. ' +
1085 + 'Received <a href="https://en.wikipedia.org/wiki/Multicast" target="_blank">multicast</a> counter is ' +
1086 + 'commonly calculated at the device level (unlike <b>received</b>) and therefore may include packets which did not reach the host.'
1087 +const netErrorsInfo = '<p>The number of errors encountered by the network interface.</p>' +
1088 + '<p><b>Inbound</b> - bad packets received on this interface. ' +
1089 + 'It includes dropped packets due to invalid length, CRC, frame alignment, and other errors. ' +
1090 + '<b>Outbound</b> - transmit problems. ' +
1091 + 'It includes frames transmission errors due to loss of carrier, FIFO underrun/underflow, heartbeat, ' +
1092 + 'late collisions, and other problems.</p>'
1093 +const netFIFOInfo = '<p>The number of FIFO errors encountered by the network interface.</p>' +
1094 + '<p><b>Inbound</b> - packets dropped because they did not fit into buffers provided by the host, ' +
1095 + 'e.g. packets larger than MTU or next buffer in the ring was not available for a scatter transfer. ' +
1096 + '<b>Outbound</b> - frame transmission errors due to device FIFO underrun/underflow. ' +
1097 + 'This condition occurs when the device begins transmission of a frame ' +
1098 + 'but is unable to deliver the entire frame to the transmitter in time for transmission.</p>'
1099 +const netDropsInfo = '<p>The number of packets that have been dropped at the network interface level.</p>' +
1100 + '<p><b>Inbound</b> - packets received but not processed, e.g. due to ' +
1101 + '<a href="#menu_system_submenu_softnet_stat">softnet backlog</a> overflow, bad/unintended VLAN tags, ' +
1102 + 'unknown or unregistered protocols, IPv6 frames when the server is not configured for IPv6. ' +
1103 + '<b>Outbound</b> - packets dropped on their way to transmission, e.g. due to lack of resources.</p>'
1104 +const netCompressedInfo = 'The number of correctly transferred compressed packets by the network interface. ' +
1105 + 'These counters are only meaningful for interfaces which support packet compression (e.g. CSLIP, PPP).'
1106 +const netEventsInfo = '<p>The number of errors encountered by the network interface.</p>' +
1107 + '<p><b>Frames</b> - aggregated counter for dropped packets due to ' +
1108 + 'invalid length, FIFO overflow, CRC, and frame alignment errors. ' +
1109 + '<b>Collisions</b> - ' +
1110 + '<a href="https://en.wikipedia.org/wiki/Collision_(telecommunications)" target="blank">collisions</a> during packet transmissions. ' +
1111 + '<b>Carrier</b> - aggregated counter for frame transmission errors due to ' +
1112 + 'excessive collisions, loss of carrier, device FIFO underrun/underflow, Heartbeat/SQE Test errors, and late collisions.</p>'
1113 +const netDuplexInfo = '<p>The interface\'s latest or current ' +
1114 + '<a href="https://en.wikipedia.org/wiki/Duplex_(telecommunications)" target="_blank">duplex</a> that the network adapter ' +
1115 + '<a href="https://en.wikipedia.org/wiki/Autonegotiation" target="_blank">negotiated</a> with the device it is connected to.</p>' +
1116 + '<p><b>Unknown</b> - the duplex mode can not be determined. ' +
1117 + '<b>Half duplex</b> - the communication is one direction at a time. ' +
1118 + '<b>Full duplex</b> - the interface is able to send and receive data simultaneously.</p>' +
1119 + '<p><b>State map</b>: 0 - unknown, 1 - half, 2 - full.</p>'
1120 +const netOperstateInfo = '<p>The current ' +
1121 + '<a href="https://datatracker.ietf.org/doc/html/rfc2863" target="_blank">operational state</a> of the interface.</p>' +
1122 + '<p><b>Unknown</b> - the state can not be determined. ' +
1123 + '<b>NotPresent</b> - the interface has missing (typically, hardware) components. ' +
1124 + '<b>Down</b> - the interface is unable to transfer data on L1, e.g. ethernet is not plugged or interface is administratively down. ' +
1125 + '<b>LowerLayerDown</b> - the interface is down due to state of lower-layer interface(s). ' +
1126 + '<b>Testing</b> - the interface is in testing mode, e.g. cable test. It can’t be used for normal traffic until tests complete. ' +
1127 + '<b>Dormant</b> - the interface is L1 up, but waiting for an external event, e.g. for a protocol to establish. ' +
1128 + '<b>Up</b> - the interface is ready to pass packets and can be used.</p>' +
1129 + '<p><b>State map</b>: 0 - unknown, 1 - notpresent, 2 - down, 3 - lowerlayerdown, 4 - testing, 5 - dormant, 6 - up.</p>'
1130 +const netCarrierInfo = '<p>The current physical link state of the interface.</p>' +
1131 + '<p><b>State map</b>: 0 - down, 1 - up.</p>'
1132 +const netSpeedInfo = 'The interface\'s latest or current speed that the network adapter ' +
1133 + '<a href="https://en.wikipedia.org/wiki/Autonegotiation" target="_blank">negotiated</a> with the device it is connected to. ' +
1134 + 'This does not give the max supported speed of the NIC.'
1135 +const netMTUInfo = 'The interface\'s currently configured ' +
1136 + '<a href="https://en.wikipedia.org/wiki/Maximum_transmission_unit" target="_blank">Maximum transmission unit</a> (MTU) value. ' +
1137 + 'MTU is the size of the largest protocol data unit that can be communicated in a single network layer transaction.'
1138 +
1139 netdataDashboard.context = {
1140 'system.cpu': {
1141 info: function (os) {
@@ -2654,127 +2710,107 @@ netdataDashboard.context = {
2710 // NETWORK INTERFACES
2711
2712 'net.net': {
2657 - mainheads: [
2658 - function (os, id) {
2659 - void (os);
2660 - if (id.match(/^cgroup_.*/)) {
2661 - var iface;
2662 - try {
2663 - iface = ' ' + id.substring(id.lastIndexOf('.net_') + 5, id.length);
2664 - } catch (e) {
2665 - iface = '';
2666 - }
2667 - return netdataDashboard.gaugeChart('Received' + iface, '12%', 'received');
2668 - } else
2669 - return '';
2670 - },
2671 - function (os, id) {
2672 - void (os);
2673 - if (id.match(/^cgroup_.*/)) {
2674 - var iface;
2675 - try {
2676 - iface = ' ' + id.substring(id.lastIndexOf('.net_') + 5, id.length);
2677 - } catch (e) {
2678 - iface = '';
2679 - }
2680 - return netdataDashboard.gaugeChart('Sent' + iface, '12%', 'sent');
2681 - } else
2682 - return '';
2683 - }
2684 - ],
2713 heads: [
2686 - function (os, id) {
2687 - void (os);
2688 - if (!id.match(/^cgroup_.*/))
2689 - return netdataDashboard.gaugeChart('Received', '12%', 'received');
2690 - else
2691 - return '';
2692 - },
2693 - function (os, id) {
2694 - void (os);
2695 - if (!id.match(/^cgroup_.*/))
2696 - return netdataDashboard.gaugeChart('Sent', '12%', 'sent');
2697 - else
2698 - return '';
2699 - }
2714 + netdataDashboard.gaugeChart('Received', '12%', 'received'),
2715 + netdataDashboard.gaugeChart('Sent', '12%', 'sent'),
2716 ],
2701 - info: 'The amount of traffic transferred by the network interface.'
2717 + info: netBytesInfo
2718 },
2719 'net.packets': {
2704 - info: 'The number of packets transferred by the network interface. '+
2705 - 'Received <a href="https://en.wikipedia.org/wiki/Multicast" target="_blank">multicast</a> counter is '+
2706 - 'commonly calculated at the device level (unlike <b>received</b>) and therefore may include packets which did not reach the host.'
2720 + info: netPacketsInfo
2721 },
2722 'net.errors': {
2709 - info: '<p>The number of errors encountered by the network interface.</p>'+
2710 - '<p><b>Inbound</b> - bad packets received on this interface. '+
2711 - 'It includes dropped packets due to invalid length, CRC, frame alignment, and other errors. '+
2712 - '<b>Outbound</b> - transmit problems. '+
2713 - 'It includes frames transmission errors due to loss of carrier, FIFO underrun/underflow, heartbeat, '+
2714 - 'late collisions, and other problems.</p>'
2723 + info: netErrorsInfo
2724 },
2725 'net.fifo': {
2717 - info: '<p>The number of FIFO errors encountered by the network interface.</p>'+
2718 - '<p><b>Inbound</b> - packets dropped because they did not fit into buffers provided by the host, '+
2719 - 'e.g. packets larger than MTU or next buffer in the ring was not available for a scatter transfer. '+
2720 - '<b>Outbound</b> - frame transmission errors due to device FIFO underrun/underflow. '+
2721 - 'This condition occurs when the device begins transmission of a frame '+
2722 - 'but is unable to deliver the entire frame to the transmitter in time for transmission.</p>'
2726 + info: netFIFOInfo
2727 },
2728 'net.drops': {
2725 - info: '<p>The number of packets that have been dropped at the network interface level.</p>'+
2726 - '<p><b>Inbound</b> - packets received but not processed, e.g. due to '+
2727 - '<a href="#menu_system_submenu_softnet_stat">softnet backlog</a> overflow, bad/unintended VLAN tags, '+
2728 - 'unknown or unregistered protocols, IPv6 frames when the server is not configured for IPv6. '+
2729 - '<b>Outbound</b> - packets dropped on their way to transmission, e.g. due to lack of resources.</p>'
2729 + info: netDropsInfo
2730 },
2731 'net.compressed': {
2732 - info: 'The number of correctly transferred compressed packets by the network interface. '+
2733 - 'These counters are only meaningful for interfaces which support packet compression (e.g. CSLIP, PPP).'
2732 + info: netCompressedInfo
2733 },
2734 'net.events': {
2736 - info: '<p>The number of errors encountered by the network interface.</p>'+
2737 - '<p><b>Frames</b> - aggregated counter for dropped packets due to '+
2738 - 'invalid length, FIFO overflow, CRC, and frame alignment errors. '+
2739 - '<b>Collisions</b> - '+
2740 - '<a href="https://en.wikipedia.org/wiki/Collision_(telecommunications)" target="blank">collisions</a> during packet transmissions. '+
2741 - '<b>Carrier</b> - aggregated counter for frame transmission errors due to '+
2742 - 'excessive collisions, loss of carrier, device FIFO underrun/underflow, Heartbeat/SQE Test errors, and late collisions.</p>'
2735 + info: netEventsInfo
2736 },
2737 'net.duplex': {
2745 - info: '<p>The interface\'s latest or current '+
2746 - '<a href="https://en.wikipedia.org/wiki/Duplex_(telecommunications)" target="_blank">duplex</a> that the network adapter '+
2747 - '<a href="https://en.wikipedia.org/wiki/Autonegotiation" target="_blank">negotiated</a> with the device it is connected to.</p>'+
2748 - '<p><b>Unknown</b> - the duplex mode can not be determined. '+
2749 - '<b>Half duplex</b> - the communication is one direction at a time. '+
2750 - '<b>Full duplex</b> - the interface is able to send and receive data simultaneously.</p>'+
2751 - '<p><b>State map</b>: 0 - unknown, 1 - half, 2 - full.</p>'
2738 + info: netDuplexInfo
2739 },
2740 'net.operstate': {
2754 - info: '<p>The current '+
2755 - '<a href="https://datatracker.ietf.org/doc/html/rfc2863" target="_blank">operational state</a> of the interface.</p>'+
2756 - '<p><b>Unknown</b> - the state can not be determined. '+
2757 - '<b>NotPresent</b> - the interface has missing (typically, hardware) components. '+
2758 - '<b>Down</b> - the interface is unable to transfer data on L1, e.g. ethernet is not plugged or interface is administratively down. '+
2759 - '<b>LowerLayerDown</b> - the interface is down due to state of lower-layer interface(s). '+
2760 - '<b>Testing</b> - the interface is in testing mode, e.g. cable test. It can’t be used for normal traffic until tests complete. '+
2761 - '<b>Dormant</b> - the interface is L1 up, but waiting for an external event, e.g. for a protocol to establish. '+
2762 - '<b>Up</b> - the interface is ready to pass packets and can be used.</p>'+
2763 - '<p><b>State map</b>: 0 - unknown, 1 - notpresent, 2 - down, 3 - lowerlayerdown, 4 - testing, 5 - dormant, 6 - up.</p>'
2741 + info: netOperstateInfo
2742 },
2743 'net.carrier': {
2766 - info: '<p>The current physical link state of the interface.</p>'+
2767 - '<p><b>State map</b>: 0 - down, 1 - up.</p>'
2744 + info: netCarrierInfo
2745 },
2746 'net.speed': {
2770 - info: 'The interface\'s latest or current speed that the network adapter '+
2771 - '<a href="https://en.wikipedia.org/wiki/Autonegotiation" target="_blank">negotiated</a> with the device it is connected to. '+
2772 - 'This does not give the max supported speed of the NIC.'
2747 + info: netSpeedInfo
2748 },
2749 'net.mtu': {
2775 - info: 'The interface\'s currently configured '+
2776 - '<a href="https://en.wikipedia.org/wiki/Maximum_transmission_unit" target="_blank">Maximum transmission unit</a> (MTU) value. '+
2777 - 'MTU is the size of the largest protocol data unit that can be communicated in a single network layer transaction.'
2750 + info: netMTUInfo
2751 + },
2752 +
2753 + // ------------------------------------------------------------------------
2754 + // CGROUP NETWORK INTERFACES
2755 +
2756 + 'cgroup.net_net': {
2757 + mainheads: [
2758 + function (os, id) {
2759 + void (os);
2760 + var iface;
2761 + try {
2762 + iface = ' ' + id.substring(id.lastIndexOf('.net_') + 5, id.length);
2763 + } catch (e) {
2764 + iface = '';
2765 + }
2766 + return netdataDashboard.gaugeChart('Received' + iface, '12%', 'received');
2767 +
2768 + },
2769 + function (os, id) {
2770 + void (os);
2771 + var iface;
2772 + try {
2773 + iface = ' ' + id.substring(id.lastIndexOf('.net_') + 5, id.length);
2774 + } catch (e) {
2775 + iface = '';
2776 + }
2777 + return netdataDashboard.gaugeChart('Sent' + iface, '12%', 'sent');
2778 + }
2779 + ],
2780 + info: netBytesInfo
2781 + },
2782 + 'cgroup.net_packets': {
2783 + info: netPacketsInfo
2784 + },
2785 + 'cgroup.net_errors': {
2786 + info: netErrorsInfo
2787 + },
2788 + 'cgroup.net_fifo': {
2789 + info: netFIFOInfo
2790 + },
2791 + 'cgroup.net_drops': {
2792 + info: netDropsInfo
2793 + },
2794 + 'cgroup.net_compressed': {
2795 + info: netCompressedInfo
2796 + },
2797 + 'cgroup.net_events': {
2798 + info: netEventsInfo
2799 + },
2800 + 'cgroup.net_duplex': {
2801 + info: netDuplexInfo
2802 + },
2803 + 'cgroup.net_operstate': {
2804 + info: netOperstateInfo
2805 + },
2806 + 'cgroup.net_carrier': {
2807 + info: netCarrierInfo
2808 + },
2809 + 'cgroup.net_speed': {
2810 + info: netSpeedInfo
2811 + },
2812 + 'cgroup.net_mtu': {
2813 + info: netMTUInfo
2814 },
2815
2816 // ------------------------------------------------------------------------