mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-30 07:59:53 -08:00
Merge pull request #1940 from prometheus/superq/fix_netdev
Update netdev OpenBSD amd64 filter
This commit is contained in:
commit
39f50e6024
|
@ -20,11 +20,10 @@ import (
|
||||||
"github.com/go-kit/kit/log/level"
|
"github.com/go-kit/kit/log/level"
|
||||||
|
|
||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
"regexp"
|
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func getNetDevStats(ignore *regexp.Regexp, accept *regexp.Regexp, logger log.Logger) (netDevStats, error) {
|
func getNetDevStats(filter *netDevFilter, logger log.Logger) (netDevStats, error) {
|
||||||
netDev := netDevStats{}
|
netDev := netDevStats{}
|
||||||
|
|
||||||
mib := [6]_C_int{unix.CTL_NET, unix.AF_ROUTE, 0, 0, unix.NET_RT_IFLIST, 0}
|
mib := [6]_C_int{unix.CTL_NET, unix.AF_ROUTE, 0, 0, unix.NET_RT_IFLIST, 0}
|
||||||
|
@ -53,11 +52,7 @@ func getNetDevStats(ignore *regexp.Regexp, accept *regexp.Regexp, logger log.Log
|
||||||
}
|
}
|
||||||
data := ifm.Data
|
data := ifm.Data
|
||||||
dev := int8ToString(dl.Data[:dl.Nlen])
|
dev := int8ToString(dl.Data[:dl.Nlen])
|
||||||
if ignore != nil && ignore.MatchString(dev) {
|
if filter.ignored(dev) {
|
||||||
level.Debug(logger).Log("msg", "Ignoring device", "device", dev)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
if accept != nil && !accept.MatchString(dev) {
|
|
||||||
level.Debug(logger).Log("msg", "Ignoring device", "device", dev)
|
level.Debug(logger).Log("msg", "Ignoring device", "device", dev)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue