From 6e3cafa98d87023b1581b26a85588c6192857af8 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Sat, 24 Jan 2026 21:29:14 -0500 Subject: [PATCH] Fix memory count, HBA detection, remove redundant disk health - Fix memory slot counting: use grep on Locator/Size fields instead of awk pattern that wasn't matching dmidecode output correctly - Add SATA to HBA detection patterns - was missing SATA controllers - Remove get_disk_health from runDiags - redundant with DriveAtlas which shows the same info in a better format Co-Authored-By: Claude Opus 4.5 --- proxDoc.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/proxDoc.sh b/proxDoc.sh index 0171115..7cedbc7 100755 --- a/proxDoc.sh +++ b/proxDoc.sh @@ -209,10 +209,11 @@ get_memory_details() { } ' echo -e "\n${GREEN}Memory Summary:${NC}" - # Count total memory device slots (excluding Physical Memory Array entries) - local total_slots=$(dmidecode -t memory | awk '/^Memory Device$/,/^$/ {if (/Size:/) count++} END {print count}') - # Count populated slots (Size: lines with actual values, not "No Module Installed") - local populated=$(dmidecode -t memory | awk '/^Memory Device$/,/^$/ {if (/Size:/ && !/No Module/) count++} END {print count}') + # Count actual DIMM slots by looking for Locator entries with slot-like names (DIMM, BANK, ChannelA, etc.) + # Filter out Bank Locator lines and count unique slot names + local total_slots=$(dmidecode -t memory | grep -E "^\s+Locator:" | grep -v "Bank Locator" | wc -l) + # Count populated slots - those with actual size values (not "No Module Installed" or "Not Installed") + local populated=$(dmidecode -t memory | grep -E "^\s+Size:" | grep -v -E "No Module|Not Installed" | wc -l) echo -e " Total Slots: $total_slots" echo -e " Populated: $populated" echo -e " Max Capacity: $(dmidecode -t memory | grep "Maximum Capacity" | head -1 | awk '{print $3" "$4}')" @@ -261,10 +262,10 @@ get_nic_details() { get_hba_info() { echo -e "\n${GREEN}=== HBA/Storage Controller Information ===${NC}" - # Find RAID, SAS, SCSI, and storage controllers + # Find RAID, SAS, SATA, SCSI, and storage controllers lspci -vmm 2>/dev/null | awk ' BEGIN { RS=""; FS="\n" } - /RAID|SAS|SCSI|Mass storage|Serial Attached|Fibre Channel|NVMe/ { + /RAID|SAS|SATA|SCSI|Mass storage|Serial Attached|Fibre Channel|NVMe/ { for (i=1; i<=NF; i++) { if ($i ~ /^Slot:/) slot = substr($i, 7) if ($i ~ /^Class:/) class = substr($i, 8) @@ -283,7 +284,7 @@ get_hba_info() { # Show detailed info for storage controllers echo -e "\n${GREEN}=== Storage Controller Details ===${NC}" - for ctrl in $(lspci | grep -iE "RAID|SAS|SCSI|Mass storage|NVMe" | awk '{print $1}'); do + for ctrl in $(lspci | grep -iE "RAID|SAS|SATA|SCSI|Mass storage|NVMe" | awk '{print $1}'); do echo -e "\n${GREEN}Controller $ctrl:${NC}" lspci -vvs "$ctrl" 2>/dev/null | grep -E "^\s+(Subsystem|LnkSta|Kernel driver)" | head -5 done @@ -476,7 +477,6 @@ runDiags() { get_ram_info get_memory_details get_storage_info - get_disk_health get_drive_atlas get_network_info get_detailed_network