#!/bin/sh
 
### Parameters ###
cores=8
drives="da0 da1 da2 da3 da4 da5 da6 da7 da8 da9 da10 da11 da12 da13 da14 da15"
 
### CPU ###
echo ""
cores=$((cores - 1))
for core in $(seq 0 $cores)
do
    temp="$(sysctl -a | grep "cpu.${core}.temp" | cut -c24-25 | tr -d "\n")"
    printf "CPU %s: %s C\n" "$core" "$temp"
done
 
### Disks ###
echo ""
for drive in $drives
do
    serial="$(smartctl -i /dev/${drive} | grep "Serial Number" | awk '{print $3}')"
    temp="$(smartctl -A /dev/${drive} | grep "Temperature_Celsius" | awk '{print $10}')"
    printf "%s %-15s: %s C\n" "$drive" "$serial" "$temp"
done
echo ""
