Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions internal/report/table_defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)"},
Comment thread
harp-intel marked this conversation as resolved.
{Name: "Model (ID)"},
{Name: "Speed"},
{Name: "Link"},
{Name: "Bus"},
Expand All @@ -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)
Expand Down
8 changes: 8 additions & 0 deletions internal/report/table_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: ")
}
Expand Down
11 changes: 7 additions & 4 deletions internal/script/script_defs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand All @@ -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"},
Expand Down