From 69f50091004505e86a08b81e6e2d312b5584c62f Mon Sep 17 00:00:00 2001 From: Marcin Franczyk Date: Thu, 13 Feb 2025 15:57:35 +0100 Subject: [PATCH] Add MTU attribute for physical and virtual devices Signed-off-by: Marcin Franczyk --- docs/usage/customization-guide.md | 4 ++-- source/network/network.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/usage/customization-guide.md b/docs/usage/customization-guide.md index 3fca6578e..29353b16c 100644 --- a/docs/usage/customization-guide.md +++ b/docs/usage/customization-guide.md @@ -968,10 +968,10 @@ The following features are available for matching: | | | **`enabled`** | bool | `true` if swap partition detected, `false` otherwise | | **`network.device`** | instance | | | Physical (non-virtual) network interfaces present in the system | | | | **`name`** | string | Name of the network interface | -| | | **``** | string | Sysfs network interface attribute, available attributes: `operstate`, `speed`, `sriov_numvfs`, `sriov_totalvfs` | +| | | **``** | string | Sysfs network interface attribute, available attributes: `operstate`, `speed`, `sriov_numvfs`, `sriov_totalvfs`, `mtu` | | **`network.virtual`** | instance | | | Virtual network interfaces present in the system | | | | **`name`** | string | Name of the network interface | -| | | **``** | string | Sysfs network interface attribute, available attributes: `operstate`, `speed` | +| | | **``** | string | Sysfs network interface attribute, available attributes: `operstate`, `speed`, `mtu` | | **`pci.device`** | instance | | | PCI devices present in the system | | | | **``** | string | Value of the sysfs device attribute, available attributes: `class`, `vendor`, `device`, `subsystem_vendor`, `subsystem_device`, `sriov_totalvfs`, `iommu_group/type`, `iommu/intel-iommu/version` | | **`storage.block`** | instance | | | Block storage devices present in the system | diff --git a/source/network/network.go b/source/network/network.go index 4039b082d..124668078 100644 --- a/source/network/network.go +++ b/source/network/network.go @@ -60,10 +60,10 @@ var ( var ( // devIfaceAttrs is the list of files under /sys/class/net/ that we're reading - devIfaceAttrs = []string{"operstate", "speed", "device/sriov_numvfs", "device/sriov_totalvfs"} + devIfaceAttrs = []string{"operstate", "speed", "device/sriov_numvfs", "device/sriov_totalvfs", "mtu"} // virtualIfaceAttrs is the list of files under /sys/class/net/ that we're reading - virtualIfaceAttrs = []string{"operstate", "speed"} + virtualIfaceAttrs = []string{"operstate", "speed", "mtu"} ) // Name returns an identifier string for this feature source.