From 92806fe77916b4b41daf44393aa5c4f31d1310dc Mon Sep 17 00:00:00 2001 From: Joe Adams Date: Wed, 14 Dec 2016 17:17:50 -0500 Subject: [PATCH] Add systemd predictable network interface names into linux network name regex. --- cmd/scollector/collectors/ifstat_linux.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/scollector/collectors/ifstat_linux.go b/cmd/scollector/collectors/ifstat_linux.go index 284a20c7fa..deb358ef0b 100644 --- a/cmd/scollector/collectors/ifstat_linux.go +++ b/cmd/scollector/collectors/ifstat_linux.go @@ -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