Skip to content

Network


Net collector is used to collect host network information, such as traffic information of each network interface. For Linux, system-wide TCP and UDP statistics will be collected.

Config

After successfully installing and launching DataKit, the Net Collector is automatically enabled and does not require manual activation.

Collector Configuration

Go to the conf.d/host directory under the DataKit installation directory, copy net.conf.sample and name it net.conf. Examples are as follows:

[[inputs.net]]
  ## (optional) collect interval, default is 10 seconds
  interval = '10s'

  ## By default, gathers stats from any up interface, but Linux does not contain virtual interfaces.
  ## Setting interfaces using regular expressions will collect these expected interfaces.
  # interfaces = ['''eth[\w-]+''', '''lo''', ]

  ## Datakit does not collect network virtual interfaces under the linux system.
  ## Setting enable_virtual_interfaces to true will collect virtual interfaces stats for linux.
  # enable_virtual_interfaces = true

  ## On linux systems also collects protocol stats.
  ## Setting ignore_protocol_stats to true will skip reporting of protocol metrics.
  # ignore_protocol_stats = false

[inputs.net.tags]
  # some_tag = "some_value"
  # more_tag = "some_other_value"

Once configured, restart DataKit 即可。

Can be turned on by ConfigMap Injection Collector Configuration or Config ENV_DATAKIT_INPUTS .

Can also be turned on by environment variables, (needs to be added as the default collector in ENV_DEFAULT_ENABLED_INPUTS):

  • ENV_INPUT_NET_INTERVAL

    Collect interval

    Type: Duration

    input.conf: interval

    Default: 10s

  • ENV_INPUT_NET_IGNORE_PROTOCOL_STATS

    Ignore reporting of protocol metrics

    Type: Boolean

    input.conf: ignore_protocol_stats

    Default: false

  • ENV_INPUT_NET_ENABLE_VIRTUAL_INTERFACES

    Enable collect virtual interfaces stats for Linux

    Type: Boolean

    input.conf: enable_virtual_interfaces

    Default: false

  • ENV_INPUT_NET_INTERFACES

    Expected interfaces (regular)

    Type: List

    input.conf: interfaces

    Example: eth[\w-]+,lo

  • ENV_INPUT_NET_TAGS

    Customize tags. If there is a tag with the same name in the configuration file, it will be overwritten

    Type: Map

    input.conf: tags

    Example: tag1=value1,tag2=value2

Metric

For all the following data collections, a global tag named host is appended by default (the tag value is the host name of the DataKit), or other tags can be specified in the configuration by [inputs.net.tags]:

 [inputs.net.tags]
  # some_tag = "some_value"
  # more_tag = "some_other_value"
  # ...

net

Tags & Fields Description
host
(tag)
System hostname.
interface
(tag)
Network interface name.
bytes_recv The number of bytes received by the interface.
Type: int
Unit: digital,B
bytes_recv/sec The number of bytes received by the interface per second.
Type: int
Unit: traffic,B/S
bytes_sent The number of bytes sent by the interface.
Type: int
Unit: digital,B
bytes_sent/sec The number of bytes sent by the interface per second.
Type: int
Unit: traffic,B/S
drop_in The number of received packets dropped by the interface.
Type: int
Unit: count
drop_out The number of transmitted packets dropped by the interface.
Type: int
Unit: count
err_in The number of receive errors detected by the interface.
Type: int
Unit: count
err_out The number of transmit errors detected by the interface.
Type: int
Unit: count
packets_recv The number of packets received by the interface.
Type: int
Unit: count
packets_recv/sec The number of packets received by the interface per second.
Type: int
Unit: count
packets_sent The number of packets sent by the interface.
Type: int
Unit: count
packets_sent/sec The number of packets sent by the interface per second.
Type: int
Unit: count
tcp_activeopens It means the TCP layer sends a SYN, and come into the SYN-SENT state. Linux only
Type: int
Unit: count
tcp_attemptfails The number of times TCP connections have made a direct transition to the CLOSED state from either the SYN-SENT state or the SYN-RCVD state, plus the number of times TCP connections have made a direct transition to the LISTEN state from the SYN-RCVD state. Linux only
Type: int
Unit: count
tcp_currestab The number of TCP connections for which the current state is either ESTABLISHED or CLOSE-WAIT. Linux only
Type: int
Unit: count
tcp_estabresets The number of times TCP connections have made a direct transition to the CLOSED state from either the ESTABLISHED state or the CLOSE-WAIT state. Linux only
Type: int
Unit: count
tcp_incsumerrors The number of incoming TCP segments in checksum error. Linux only
Type: int
Unit: count
tcp_inerrs The number of incoming TCP segments in error. Linux only
Type: int
Unit: count
tcp_insegs The number of packets received by the TCP layer. Linux only
Type: int
Unit: count
tcp_insegs/sec The number of packets received by the TCP layer per second. Linux only
Type: int
Unit: count
tcp_maxconn The limit on the total number of TCP connections the entity can support. Linux only
Type: int
Unit: count
tcp_outrsts The number of TCP segments sent containing the RST flag. Linux only
Type: int
Unit: count
tcp_outsegs The number of packets sent by the TCP layer. Linux only
Type: int
Unit: count
tcp_outsegs/sec The number of packets sent by the TCP layer per second. Linux only
Type: int
Unit: count
tcp_passiveopens It means the TCP layer receives a SYN, replies a SYN+ACK, come into the SYN-RCVD state. Linux only
Type: int
Unit: count
tcp_retranssegs The total number of segments re-transmitted - that is, the number of TCP segments transmitted containing one or more previously transmitted octets. Linux only
Type: int
Unit: count
tcp_rtoalgorithm The algorithm used to determine the timeout value used for retransmitting unacknowledged octets. Linux only
Type: int
Unit: count
tcp_rtomax The maximum value permitted by a TCP implementation for the retransmission timeout, measured in milliseconds. Linux only
Type: int
Unit: time,ms
tcp_rtomin The minimum value permitted by a TCP implementation for the retransmission timeout, measured in milliseconds. Linux only
Type: int
Unit: time,ms
udp_ignoredmulti The number of ignored multicast packets
Type: int
Unit: count
udp_incsumerrors The number of incoming UDP datagram in checksum errors. Linux only
Type: int
Unit: count
udp_indatagrams The number of UDP datagram delivered to UDP users. Linux only
Type: int
Unit: count
udp_indatagrams/sec The number of UDP datagram delivered to UDP users per second. Linux only
Type: int
Unit: count
udp_inerrors The number of packet receive errors. Linux only
Type: int
Unit: count
udp_memerrors The number of memory errors. Linux only
Type: int
Unit: count
udp_noports The number of packets to unknown port received. Linux only
Type: int
Unit: count
udp_outdatagrams The number of UDP datagram sent from this entity. Linux only
Type: int
Unit: count
udp_outdatagrams/sec The number of UDP datagram sent from this entity per second. Linux only
Type: int
Unit: count
udp_rcvbuferrors The number of receive buffer errors. Linux only
Type: int
Unit: count
udp_sndbuferrors The number of send buffer errors. Linux only
Type: int
Unit: count

More Readings