Metrics-net plugin reports -1, 65535 or 4294967295 when not connected.
Debilski opened this issue · comments
Not sure if it depends on the kernel version but when the interface is not connected to the network, cat /sys/class/net/$IF/speed
may report either -1, 65535 (=2^16 - 1) or 4294967295 (=2^32 - 1).
Sounds like it should be pretty easy to check those conditions and use unknown to let the user know that the interface is disconnected. Could you put together a pr for this?
https://rubygems.org/gems/sensu-plugins-network-checks/versions/3.2.0 has been released which allows you to specify --only-up
which would prevent "unexpected" results from being collected. If there is anything else you need please comment back.