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

LinuxIPNetwork connector fails to monitor some Ethernet interfaces #111

Open
bertysentry opened this issue Aug 26, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@bertysentry
Copy link
Member

Problem

Currently, the connectors takes into account only network cards whose name match with this regular expression: /^eth[0-9][0-9]*:?|^vmnic[0-9][0-9]*:?|^em[0-9]*:?|^[Pp][0-9][0-9]*[Pp][0-9][0-9]*:?|^en[os][0-9]*:?|^enp[0-9]*s[0-9]*:?/

But as a network card can be named arbitrarily by the system admin, filtering with a regular expression will fail to list the physical Ethernet interfaces.

Specifications

Instead of using a regular expression, try listing the symbolic links in /sys/class/net.

All entries that link to something in /sys/devices/ that is not virtual should be considered physical.

Examples:

ls -l /sys/class/net
total 0
lrwxrwxrwx 1 root root 0 Aug 14 01:46 eth0 -> ../../devices/pci0000:00/0000:00:05.0/0000:05:00.2/0000:07:08.0/net/eth0
lrwxrwxrwx 1 root root 0 Aug 26 16:33 eth1 -> ../../devices/pci0000:00/0000:00:05.0/0000:05:00.0/0000:06:07.0/net/eth1
lrwxrwxrwx 1 root root 0 Aug 26 16:33 lo -> ../../devices/virtual/net/lo
ls -l
total 0
lrwxrwxrwx 1 root root    0 Aug 26 16:31 bond0 -> ../../devices/virtual/net/bond0
-rw-r--r-- 1 root root 4096 Aug 26 16:31 bonding_masters
lrwxrwxrwx 1 root root    0 Aug 26 16:31 dummy0 -> ../../devices/virtual/net/dummy0
lrwxrwxrwx 1 root root    0 Aug 20 12:50 eth0 -> ../../devices/LNXSYSTM:00/LNXSYBUS:00/ACPI0004:00/VMBUS:00/a03b81eb-5f29-44f5-ad95-e6a8b4993c17/net/eth0
lrwxrwxrwx 1 root root    0 Aug 20 12:50 lo -> ../../devices/virtual/net/lo
lrwxrwxrwx 1 root root    0 Aug 20 12:50 sit0 -> ../../devices/virtual/net/sit0
lrwxrwxrwx 1 root root    0 Aug 26 16:31 tunl0 -> ../../devices/virtual/net/tunl0
@bertysentry bertysentry added the bug Something isn't working label Aug 26, 2024
@bertysentry bertysentry self-assigned this Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants