Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dorkmatt opened this issue Jan 22, 2018 · 5 comments
Closed

Comments

@dorkmatt
Copy link

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

@dorkmatt
Copy link
Author

Technically FreeBSD has description too, probably other OS's wouldn't be surprising.

@SuperQ
Copy link
Member

SuperQ commented Jan 22, 2018

Sure, this sounds like a good idea. There are a number of extra things in /sys/class/net/*/ I have been wanting to implement.

For reference, the documentation is here

For example, speed is a common request. Also operstate or maybe carrier.

@SuperQ SuperQ changed the title Expand netdev_linux to include port description Expand netdev_linux to include more information from /sys/class/net/*/ Oct 30, 2018
@deboshrestha
Copy link

hello! I wanted to check if the operstate part has been currently implemented in node_exporter or not? We are using the following linux OS -

uname -a
Linux <host-name> 4.4.0-142-generic #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

We use Prometheus Operator for monitoring and this is our currently implemented node_exporter version -

quay.io/prometheus/node-exporter:v0.16.0

@tomvil
Copy link
Contributor

tomvil commented Sep 11, 2024

@SuperQ @dorkmatt , I think the initial request (to expose ifAlias as label in netdev_linux) was solved by #3087 ?

@discordianfish
Copy link
Member

Ok lets close this issue then. For further info from sys/class/net, please open specific issues if needed

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

No branches or pull requests

5 participants