Skip to content

Commit

Permalink
cmd/scollector: add systemd physical "predictable" linux net interfac…
Browse files Browse the repository at this point in the history
…e names (bosun-monitor#1985)

adds: en — ethernet, wl — wlan, and ww — wwan.
See https://github.com/systemd/systemd/blob/v237/src/udev/udev-builtin-net_id.c#L30 as reference.
  • Loading branch information
sysadmind authored and Mike Chepaykin committed Apr 23, 2018
1 parent 42f0a4b commit 9c39e5c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/scollector/collectors/ifstat_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ var netFields = []struct {
{"compressed", metadata.Counter, metadata.Count},
}

var ifstatRE = regexp.MustCompile(`\s+(eth\d+|em\d+_\d+/\d+|em\d+_\d+|em\d+|` +
`bond\d+|team\d+|` + `p\d+p\d+_\d+/\d+|p\d+p\d+_\d+|p\d+p\d+):(.*)`)
var ifstatRE = regexp.MustCompile(`\s*(eth\d+|em\d+_\d+/\d+|em\d+_\d+|em\d+|` +
`bond\d+|team\d+|` +
`p\d+p\d+_\d+/\d+|p\d+p\d+_\d+|p\d+p\d+|` +
`en[[:alnum:]]+|wl[[:alnum:]]+|ww[[:alnum:]]+` + // Systemd predictable interface names
`):(.*)`)

func c_ipcount_linux() (opentsdb.MultiDataPoint, error) {
var md opentsdb.MultiDataPoint
Expand Down

0 comments on commit 9c39e5c

Please sign in to comment.