From 7f6669eb921c7ef76c45f49e9d3c61085e2f2b5d Mon Sep 17 00:00:00 2001 From: Kazuki Suda Date: Tue, 10 Sep 2024 14:42:08 +0900 Subject: [PATCH] source/system: Add reading product name information --- docs/usage/customization-guide.md | 1 + source/system/system.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/usage/customization-guide.md b/docs/usage/customization-guide.md index d1fdc50a6..09094d838 100644 --- a/docs/usage/customization-guide.md +++ b/docs/usage/customization-guide.md @@ -1027,6 +1027,7 @@ The following features are available for matching: | | | **``** | string | One parameter from `/etc/os-release` | | **`system.dmiid`** | attribute | | | DMI identification data from `/sys/devices/virtual/dmi/id/` | | | | **`sys_vendor`** | string | Vendor name from `/sys/devices/virtual/dmi/id/sys_vendor` | +| | | **`product_name`** | string | Product name from `/sys/devices/virtual/dmi/id/product_name` | | **`system.name`** | attribute | | | System name information | | | | **`nodename`** | string | Name of the kubernetes node object | | **`usb.device`** | instance | | | USB devices present in the system | diff --git a/source/system/system.go b/source/system/system.go index 3f32d21c6..bcbf0c00a 100644 --- a/source/system/system.go +++ b/source/system/system.go @@ -103,7 +103,7 @@ func (s *systemSource) Discover() error { } // Get DMI ID attributes - dmiIDAttributeNames := []string{"sys_vendor"} + dmiIDAttributeNames := []string{"sys_vendor", "product_name"} dmiAttrs := make(map[string]string) for _, name := range dmiIDAttributeNames { val, err := getDmiIDAttribute(name)