Skip to content

Expand netdev_linux to include more information from /sys/class/net/*/ #794

Description

@dorkmatt

Linux allows for an administratively set port description for network interfaces, this can be configured with iproute2 using ip link set dev eth0 alias "LAN interface". This is similar to IF-MIB::ifAlias or IF-MIB::ifDescr in the land of SNMP.

On Cumulus Linux platforms (a fork of Debian), ifupdown2 allows setting this as part of the /etc/network/interfaces file.

We (@sfmix) use this for noting which ports are peering participants, backhaul transport, and/or management. We're trying to avoid using the snmp_exporter, since the node_exporter is faster and meets 99% of our requirements. The goal is to filter based on regex of port description for these different used interface descriptions.

It looks like the netdev_linux code parses /proc/net/dev file for counters (at least from my horrible Go code parsing skills, or lack of). This data is present in /sys/class/net/eth0/ifalias.

Host operating system: output of uname -a

Linux switch02-sfo02 4.1.0-cl-6-amd64 #1 SMP Cumulus 4.1.33-1+cl3u11 (2018-01-04) x86_64 GNU/Linux

node_exporter version: output of node_exporter --version

node_exporter, version 0.15.2 (branch: HEAD, revision: 98bc64930d34878b84a0f87dfe6e1a6da61e532d)
  build user:       root@d5c4792c921f
  build date:       20171205-14:50:53
  go version:       go1.9.2

node_exporter command line flags

./node_exporter --collector.bonding --collector.logind --collector.interrupts --collector.systemd --web.listen-address="100.64.0.7:9100"

Are you running node_exporter in Docker?

No

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions