18 Return values for net.if.get

Overview

This section provides return value details for the net.if.get item. The item is supported on Linux by Zabbix agent and Zabbix agent 2.

Details

This item returns detailed information on network interfaces whose names match the given regular expression. The output is structured as a JSON object containing config and values arrays.

The output contains the following properties:

  • name - interface name, read from /proc/net/dev;
  • ifalias - interface alias, read from /sys/class/net/<name>/ifalias;
  • mac - interface MAC address, read from /sys/class/net/<name>/address;
  • type - interface type (physical, virtual, loopback);
  • speed - the link speed in Mbits/sec, Ethernet-specific, read from /sys/class/net/<name>/speed;
  • duplex - interface latest or current duplex value (half, full), Ethernet-specific, read from /sys/class/net/<name>/duplex;
  • administrative_state - configured state (down, up), read from /sys/class/net/<name>/flags;
  • operational_state - interface RFC2863 operational state (unknown, notpresent, down, lowerlayerdown, testing, dormant, up), read from sys/class/net/<name>/operstate;
  • carrier - physical link presence (0 - physical link is down, 1 - physical link is up), read from /sys/class/net/<name>/carrier;
  • carrier_changes - total number of times link state changed from up to down and vice versa, read from /sys/class/net/<name>/carrier_changes;
  • carrier_up_count - number of times link has become up, read from /sys/class/net/<name>/carrier_up_count;
  • carrier_down_count - number of times link has become down, read from /sys/class/net/<name>/carrier_down_count;
  • in - incoming traffic, read from /proc/net/dev. Contains interface counters:
    • bytes - number of good bytes;
    • packets - number of good packets;
    • errors - total number of bad packets;
    • dropped - number of packets received but not processed + count of packets missed by the host;
    • overruns - number of overflow events;
    • frame - number of packets with framing errors;
    • compressed - number of correctly received compressed packets;
    • multicast - multicast packets received.
  • out - outgoing traffic, read from /proc/net/dev. Contains interface counters:
    • bytes - number of good bytes;
    • packets - number of good packets;
    • errors - total number of bad packets;
    • dropped - number of packets received but not processed + count of packets missed by the host;
    • overruns - number of overflow events;
    • collisions - number of collisions during packet transmissions;
    • carrier - number of frame transmission errors due to loss of carrier during transmission;
    • compressed - number of transmitted compressed packets.

Unavailable metrics are excluded from the JSON output. In the following example, no alias is configured for the "lo" interface, so the ifalias property is excluded.

Example:

{
    "config": [
        {
            "name": "lo",
            "mac": "00:00:00:00:00:00",
            "type": "loopback",
            "administrative_state": "up",
            "operational_state": "unknown",
            "carrier": 1
        },
        {
            "name": "enp3s0",
            "ifalias": "Wired Ethernet connection",
            "mac": "8c:16:45:e3:1d:58",
            "type": "physical",
            "duplex": "unknown",
            "administrative_state": "up",
            "operational_state": "down",
            "carrier": 0
        },
        {
            "name": "wlp5s0",
            "ifalias": "Wi-Fi network adapter",
            "mac": "34:e1:2d:72:67:c6",
            "type": "physical",
            "administrative_state": "up",
            "operational_state": "up",
            "carrier": 1
        }
    ],
    "values": [
        {
            "name": "lo",
            "mac": "00:00:00:00:00:00",
            "carrier": 1,
            "carrier_changes": 0,
            "carrier_up_count": 0,
            "carrier_down_count": 0,
            "in": {
                "bytes": 1040047,
                "packets": 10784,
                "errors": 0,
                "dropped": 0,
                "overruns": 0,
                "frame": 0,
                "compressed": 0,
                "multicast": 0
            },
            "out": {
                "bytes": 1040047,
                "packets": 10784,
                "errors": 0,
                "dropped": 0,
                "overruns": 0,
                "collisions": 0,
                "carrier": 0,
                "compressed": 0
            }
        },
        {
            "name": "enp3s0",
            "ifalias": "Wired Ethernet connection",
            "mac": "8c:16:45:e3:1d:58",
            "carrier": 0,
            "carrier_changes": 1,
            "carrier_up_count": 0,
            "carrier_down_count": 1,
            "in": {
                "bytes": 0,
                "packets": 0,
                "errors": 0,
                "dropped": 0,
                "overruns": 0,
                "frame": 0,
                "compressed": 0,
                "multicast": 0
            },
            "out": {
                "bytes": 0,
                "packets": 0,
                "errors": 0,
                "dropped": 0,
                "overruns": 0,
                "collisions": 0,
                "carrier": 0,
                "compressed": 0
            }
        },
        {
            "name": "wlp5s0",
            "ifalias": "Wi-Fi network adapter",
            "mac": "34:e1:2d:72:67:c6",
            "carrier": 1,
            "carrier_changes": 6,
            "carrier_up_count": 3,
            "carrier_down_count": 3,
            "in": {
                "bytes": 165537298,
                "packets": 216182,
                "errors": 0,
                "dropped": 291,
                "overruns": 0,
                "frame": 0,
                "compressed": 0,
                "multicast": 0
            },
            "out": {
                "bytes": 252574347,
                "packets": 246607,
                "errors": 0,
                "dropped": 0,
                "overruns": 0,
                "collisions": 0,
                "carrier": 0,
                "compressed": 0
            }
        }
    ]
}

See also

For more information on the sysfs ABI for network devices, see: