Create ESXi-GetPercDriveTemps.sh

This commit is contained in:
2025-03-22 11:07:39 -05:00
parent 42ac2c5435
commit 6948cf0805

21
ESXi-GetPercDriveTemps.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/usr/bin/env bash
for c in $(/opt/lsi/perccli64/perccli64 show | grep PERC | cut -d' ' -f 3); do
echo "Controller #${c}"
for e in $(/opt/lsi/perccli64/perccli64 /c${c} show | grep " OK" | cut -d' ' -f 2); do
echo "Enclosure #${e}"
for s in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24; do
info=$(/opt/lsi/perccli64/perccli64 /c${c}/e${e}/s${s} show all)
if [ "${info}" != "" ]; then
sn=$(echo ${info} | grep "SN =" | cut -d' ' -f 3)
model=$(echo ${info} | grep "Model Number" | cut -d' ' -f 4)
temp=$(echo ${info} | grep Temperature | cut -d'=' -f 2)
echo "Slot #${s} - ${model} (SN:${sn}) =${temp}"
fi
done
done
done
exit 0