centreon-plugins
centreon-plugins copied to clipboard
[os::linux::local::plugin] try to guess interface speed in traffic mode
Hi,
An improvement for the traffic mode of os::linux::local::plugin: it would be better if it can detect the speed of network interfaces instead of using a static value provided as an argument.
On new kernels (at least the one of CentOS 6 for instance), it's available in /sys/class/net/<interface_name>/speed
/sys/class/net/<interface_name>/speed may be empty or "-1" for down interfaces.
I use ip addr or ifconfig command. And the speed is not present.
OSI layer 1 or 2 I think, not layer 3 as TCP/IP.
You can display it with ethtool for Ethernet interfaces or iwconfig for WIFI interfaces, as in this old plugin: https://github.com/Sysnove/shinken-plugins/blob/master/check_netint.pl
As I said you can get the value in /sys/class/net/<interface_name>/speed (https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-net) for Ethernet devices
What: /sys/class/net/<iface>/speed
Date: October 2009
KernelVersion: 2.6.33
Contact: [email protected]
Description:
Indicates the interface latest or current speed value. Value is
an integer representing the link speed in Mbits/sec.
Note: this attribute is only valid for interfaces that implement
the ethtool get_link_ksettings method (mostly Ethernet).
https://github.com/centreon/centreon-plugins/pull/3941
New option --guess-speed