diff --git a/driveAtlas.sh b/driveAtlas.sh index 9579fe2..dd78ea4 100644 --- a/driveAtlas.sh +++ b/driveAtlas.sh @@ -3,9 +3,16 @@ # Define the ASCII art maps large1=''' ┌─────────────────────────────────────────────────────────────┐ -│ │ │ large1 │ │ │ +│ ┌──────────────────────────────────────────────┐ │ +│ │ Motherboard │ │ +│ │ │ │ +│ │ ┌──┐┌──┐ │ │ +│ │ │M1││M2│ │ │ +│ │ └──┘└──┘ │ │ +│ └──────────────────────────────────────────────┘ │ +│ │ │ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │ │ │ │ │ │ │ │ │ │ │ 1 │ │ 2 │ │ 3 │ │ @@ -106,17 +113,30 @@ case "$HOSTNAME" in ;; esac -# Enhanced Drive Information Function -get_drive_info() { - local drive=$1 - echo "=== Detailed info for $drive ===" - if [[ $drive == *"nvme"* ]]; then - sudo nvme smart-log "$drive" - else - sudo smartctl -A "$drive" | grep -E "Temperature|Power|Health" - fi +map_drives_to_layout() { + local server_type=$1 + case $server_type in + "large1") + for i in {1..9}; do + local drive_info=$(get_drive_info_for_position $i) + echo "Position $i: $drive_info" + done + ;; + esac } +# Enhanced Drive Information Function +get_drives_info() { + local path="/dev/disk/by-path" + for drive in "$path"/*; do + if [ -L "$drive" ]; then + echo "$(basename "$drive") $(readlink -f "$drive")" + fi + done +} + +DRIVE_PATHS=$(get_drives_info | awk '{print $1, $2}') + # Initialize array for "not found" messages not_found=() @@ -141,7 +161,7 @@ if [ -n "$mmc_output" ]; then fi # Show SATA Drives only if present -sata_output=$(lsblk -o NAME,SIZE,TYPE,MOUNTPOINT | grep "disk" | grep -v "mmcblk" | grep -v "rbd" | sort) +sata_output=$(lsblk -d -o NAME,SIZE,TYPE,MOUNTPOINT | grep "disk" | grep -v "nvme" | grep -v "rbd" | sort | column -t)s if [ -n "$sata_output" ]; then echo -e "\n=== SATA Drives ===\n" printf "%-15s %-10s %-10s %-20s\n" "DEVICE" "SIZE" "TYPE" "MOUNTPOINT"