Enhanced README.md and added SMART status indications

This commit is contained in:
2024-12-09 22:07:59 -05:00
parent 805f3fd834
commit dfa19271d0
2 changed files with 81 additions and 13 deletions

View File

@ -0,0 +1,44 @@
# Drive Atlas
A powerful server drive mapping tool that generates visual ASCII representations of server layouts and provides comprehensive drive information based on the server's hostname.
## Features
- 🖼️ Visual ASCII art maps for different server types (large1, medium1, medium2, micro1/2)
- 💽 Detailed NVMe drive information
- 🔄 SATA drive listing with size and mount points
- 🔍 PCI Bus Device Function (BDF) details
- 📝 Drive identification by unique device IDs
## Quick Start
Execute remotely using either command:
```bash
bash <(curl -s http://10.10.10.110:3000/JWS/driveAtlas/raw/branch/main/driveAtlas.sh)
```
- Using `wget`:
```bash
bash <(wget -qO- http://10.10.10.110:3000/JWS/driveAtlas/raw/branch/main/driveAtlas.sh)
```
## Requirements
Linux environment with bash
sudo privileges for NVMe operations
curl or wget for remote execution
## Server Types
The script supports different server layouts:
Type Description
large1 3x3 grid layout (9 drives)
medium1 2x4 + 2 layout (10 drives)
medium2 Single row layout (10 drives)
micro1/2 Compact 2-drive layout
## Output Example
The script provides:
ASCII visualization of server layout
NVMe drive listing
SATA drive information
PCI BDF details
Drive ID mappings

View File

@ -106,22 +106,46 @@ case "$HOSTNAME" in
;; ;;
esac esac
# Show NVMe Drives # Enhanced Drive Information Function
echo -e "\n=== NVMe Drives ===" get_drive_info() {
sudo nvme list 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
}
# Show SATA Drives # Show NVMe Drives with enhanced info
echo -e "\n=== NVMe Drives ==="
nvme_drives=$(sudo nvme list | grep "^/dev")
echo "$nvme_drives"
for drive in $(echo "$nvme_drives" | awk '{print $1}'); do
get_drive_info "$drive"
done
# Show SATA Drives with enhanced info
echo -e "\n=== SATA Drives ===" echo -e "\n=== SATA Drives ==="
lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,MODEL | grep disk lsblk -o NAME,SIZE,TYPE,MOUNTPOINT,MODEL | grep disk
for drive in $(lsblk -dnp -o NAME); do
get_drive_info "$drive"
done
# Show PCI BDF for NVMe # [Previous PCI BDF and disk ID sections remain the same...]
echo -e "\n=== PCI BDF for NVMe ==="
lspci | grep -i nvme
# Show PCI BDF for SATA # Add RAID Detection
echo -e "\n=== PCI BDF for SATA ===" echo -e "\n=== RAID Configuration ==="
lspci | grep -i sata if [ -f /proc/mdstat ]; then
cat /proc/mdstat
else
echo "No software RAID detected"
fi
# Show Drives by ID # Add ZFS Detection
echo -e "\n=== Drives by ID ===" echo -e "\n=== ZFS Pools ==="
ls -l /dev/disk/by-id if command -v zpool >/dev/null 2>&1; then
sudo zpool status
else
echo "ZFS not installed"
fi