1
0
mirror of https://github.com/Spearfoot/FreeNAS-scripts synced 2025-12-06 01:23:19 +00:00

Added optional IPMI support for CPU temperatures

This commit is contained in:
Keith Nash
2017-07-08 09:43:57 -05:00
committed by GitHub
parent 470e6e5811
commit dd5a499839

View File

@@ -23,7 +23,7 @@ ipmiuser=root
# IPMI password file. This is a file containing the IPMI user's password
# on a single line and should have 0600 permissions:
ipmipwfile=/root/.ssh/password
ipmipwfile=/root/ipmi_password
# Full path to 'ipmitool' program:
ipmitool=/usr/local/bin/ipmitool
@@ -121,10 +121,13 @@ for drive in $drives; do
else
temp="${temp}C"
fi
brand=$("$smartctl" -i "$drive" | grep "Model Family" | awk '{print $3, $4, $5, $6, $7}')
if [ -z "$brand" ]; then
brand=$("$smartctl" -i "$drive" | grep "Device Model" | awk '{print $3, $4, $5, $6, $7}')
dfamily=$("$smartctl" -i "$drive" | grep "Model Family" | awk '{print $3, $4, $5, $6, $7}' | sed -e 's/[[:space:]]*$//')
dmodel=$("$smartctl" -i "$drive" | grep "Device Model" | awk '{print $3, $4, $5, $6, $7}' | sed -e 's/[[:space:]]*$//')
if [ -z "$dfamily" ]; then
dinfo="$dmodel"
else
dinfo="$dfamily ($dmodel)"
fi
printf '%6.6s: %5s %-8s %-20.20s %s\n' "$(basename "$drive")" "$temp" "$capacity" "$serial" "$brand"
printf '%6.6s: %5s %-8s %-20.20s %s\n' "$(basename "$drive")" "$temp" "$capacity" "$serial" "$dinfo"
done