跳转到主要内容

systemd-report-netstat@.service

systemd

systemd-report-netstat@.service

8

systemd-report-netstat@.service

systemd-report-netstat.socket

systemd-report-netstat

Report network interface statistics as system report metrics

systemd-report-netstat@.service

systemd-report-netstat.socket

/usr/lib/systemd/systemd-report-netstat

Description

systemd-report-netstat@.service is a metrics source for systemd-report(1). It reports traffic counters and related properties of the network interfaces of the host, by implementing the io.systemd.Metrics Varlink interface on a socket linked into the /run/systemd/report/ directory.

All network interfaces of the host's network namespace are enumerated, including the loopback interface. The data is acquired from the kernel via rtnetlink(7), except for the link speed, see below. Note that this service is independent of systemd-networkd.service(8), and reports on all interfaces, regardless of which component manages them. For each interface the following metrics are reported, with the interface name as metric object:

io.systemd.NetworkStatistics.CarrierChanges
The number of times the carrier state of the interface changed (counter).

io.systemd.NetworkStatistics.Collisions
The number of collisions during packet transmission (counter).

io.systemd.NetworkStatistics.MTU
The maximum transmission unit of the interface, in bytes (gauge).

io.systemd.NetworkStatistics.ReceiveBytes
The number of bytes received (counter).

io.systemd.NetworkStatistics.ReceiveDropped
The number of received packets that were dropped without an error, for example due to lack of buffer space (counter).

io.systemd.NetworkStatistics.ReceiveErrors
The total number of receive errors (counter).

io.systemd.NetworkStatistics.ReceiveMulticastPackets
The number of multicast packets received (counter).

io.systemd.NetworkStatistics.ReceivePackets
The number of packets received (counter).

io.systemd.NetworkStatistics.SpeedBitsPerSecond
The link speed, in bits per second. Only reported for interfaces whose driver reports a link speed and that are up and have a known speed, which typically means wired Ethernet interfaces. The value is read from the speed attribute of the interface in /sys/class/net/ (gauge).

io.systemd.NetworkStatistics.TransmitBytes
The number of bytes transmitted (counter).

io.systemd.NetworkStatistics.TransmitDropped
The number of packets dropped on transmission without an error (counter).

io.systemd.NetworkStatistics.TransmitErrors
The total number of transmit errors (counter).

io.systemd.NetworkStatistics.TransmitPackets
The number of packets transmitted (counter).

io.systemd.NetworkStatistics.TransmitQueueLength
The length of the transmit queue of the interface, in packets (gauge).

Counters are maintained by the kernel per interface, and hence start from zero whenever an interface is (re-)created. The following metric fields are set on all metrics:

ifindex
The interface index, in decimal. Always set.

type
The type of the interface, as also shown in the Type column of networkctl(1), i.e. the device type if the kernel reports one (for example wlan or bridge), and the hardware type otherwise (for example ether or loopback). Omitted if not known.

kind
The kind of the interface, for virtual interfaces, for example veth, bridge or wireguard. Omitted for physical interfaces.

See Also

systemd(1), systemd-report(1), systemd-networkd.service(8), rtnetlink(7)