Ticket #943 (new defect)

Opened 2 years ago

Last modified 2 years ago

if_ fails to enumerate interfaces not ending in a digit

Reported by: feiner.tom Assigned to: nobody
Priority: normal Milestone:
Component: plugins Version: 1.4.4
Severity: normal Keywords:
Cc: madduck@debian.org

Description (Last modified by feiner.tom)

Forwarded from: http://bugs.debian.org/591455


Munin uses the following regexp to suggest device names from

/proc/net/dev:
  /^ *(eth|tap|bond|wlan|ath|ra|sw|vlan|venet|veth|msh)[0-9]+(\.[0-9]+)?:/

The days of silly device names are over, as udev allows for easy and consistent static renaming, and various user-space use freely-named TUN devices (e.g. iodine, kvm, bluez, etc.).

Instead of the awk expression, might I suggest the following to obtain the names of interfaces?

  sed -rne 's,^[[:space:]]*([^:]+):.*,\1,p' /proc/net/dev

If you want to exclude certain interfaces, e.g. lo or sit*, then use this:

  sed -rne '/^[[:space:]]*(lo|sit[[:digit:]]+):/d;s,^[[:space:]]*([^:]+):.*,\1,p' /proc/net/dev

Thanks, Martin f krafft


Change History

08/05/10 21:05:44 changed by feiner.tom

  • description changed.