diff --git a/internal/report/table_defs.go b/internal/report/table_defs.go index bda3dad5..5714bce4 100644 --- a/internal/report/table_defs.go +++ b/internal/report/table_defs.go @@ -1514,8 +1514,8 @@ func dimmTableInsights(outputs map[string]script.ScriptOutput, tableValues Table func nicTableValues(outputs map[string]script.ScriptOutput) []Field { fields := []Field{ {Name: "Name"}, - {Name: "Vendor"}, - {Name: "Model"}, + {Name: "Vendor (ID)"}, + {Name: "Model (ID)"}, {Name: "Speed"}, {Name: "Link"}, {Name: "Bus"}, @@ -1530,7 +1530,13 @@ func nicTableValues(outputs map[string]script.ScriptOutput) []Field { for _, nicInfo := range allNicsInfo { fields[0].Values = append(fields[0].Values, nicInfo.Name) fields[1].Values = append(fields[1].Values, nicInfo.Vendor) + if nicInfo.VendorID != "" { + fields[1].Values[len(fields[1].Values)-1] += fmt.Sprintf(" (%s)", nicInfo.VendorID) + } fields[2].Values = append(fields[2].Values, nicInfo.Model) + if nicInfo.ModelID != "" { + fields[2].Values[len(fields[2].Values)-1] += fmt.Sprintf(" (%s)", nicInfo.ModelID) + } fields[3].Values = append(fields[3].Values, nicInfo.Speed) fields[4].Values = append(fields[4].Values, nicInfo.Link) fields[5].Values = append(fields[5].Values, nicInfo.Bus) diff --git a/internal/report/table_helpers.go b/internal/report/table_helpers.go index e0218122..6400273d 100644 --- a/internal/report/table_helpers.go +++ b/internal/report/table_helpers.go @@ -1330,7 +1330,9 @@ func clusteringModeFromOutput(outputs map[string]script.ScriptOutput) string { type nicInfo struct { Name string Vendor string + VendorID string Model string + ModelID string Speed string Link string Bus string @@ -1358,10 +1360,16 @@ func parseNicInfo(scriptOutput string) []nicInfo { if strings.HasPrefix(line, "Vendor: ") { nic.Vendor = strings.TrimPrefix(line, "Vendor: ") } + if strings.HasPrefix(line, "Vendor ID: ") { + nic.VendorID = strings.TrimPrefix(line, "Vendor ID: ") + } if strings.HasPrefix(line, "Model: ") { // sometimes the model name has additional information in parentheses, we want to keep only the model name nic.Model = strings.TrimSpace(strings.TrimPrefix(strings.Split(line, "(")[0], "Model: ")) } + if strings.HasPrefix(line, "Model ID: ") { + nic.ModelID = strings.TrimPrefix(line, "Model ID: ") + } if strings.HasPrefix(line, "Speed: ") { nic.Speed = strings.TrimPrefix(line, "Speed: ") } diff --git a/internal/script/script_defs.go b/internal/script/script_defs.go index d99b6f0c..e52a40e8 100644 --- a/internal/script/script_defs.go +++ b/internal/script/script_defs.go @@ -734,9 +734,12 @@ rdmsr 0x2FFE if ! ethtool_i_out=$(ethtool -i "$ifc" 2>/dev/null); then continue fi - echo "Interface: $ifc" - echo "Vendor: $(udevadm info --query=all --path=/sys/class/net/"$ifc" | grep ID_VENDOR_FROM_DATABASE= | cut -d'=' -f2)" - echo "Model: $(udevadm info --query=all --path=/sys/class/net/"$ifc" | grep ID_MODEL_FROM_DATABASE= | cut -d'=' -f2)" + echo "Interface: $ifc" + udevadm_out=$(udevadm info --query=all --path=/sys/class/net/"$ifc") + echo "Vendor ID: $(echo "$udevadm_out" | grep ID_VENDOR_ID= | cut -d'=' -f2)" + echo "Model ID: $(echo "$udevadm_out" | grep ID_MODEL_ID= | cut -d'=' -f2)" + echo "Vendor: $(echo "$udevadm_out" | grep ID_VENDOR_FROM_DATABASE= | cut -d'=' -f2)" + echo "Model: $(echo "$udevadm_out" | grep ID_MODEL_FROM_DATABASE= | cut -d'=' -f2)" echo "$ethtool_out" echo "$ethtool_i_out" echo "MAC Address: $(cat /sys/class/net/"$ifc"/address 2>/dev/null)" @@ -749,7 +752,7 @@ rdmsr 0x2FFE done printf "\n" echo "IRQ Balance: $(pgrep irqbalance >/dev/null 2>&1 && echo "Enabled" || echo "Disabled")" - echo "----------------------------------------" + echo "----------------------------------------" done `, Depends: []string{"ethtool"},