diff options
author | Patrick Simianer <pks@pks.rocks> | 2020-08-02 09:55:31 +0200 |
---|---|---|
committer | Patrick Simianer <pks@pks.rocks> | 2020-08-02 09:55:31 +0200 |
commit | 69e575f18fe640e5d610b3d32572503cefb65e6a (patch) | |
tree | 7321b12dc34bb9418bb9a7a32b1f3cb7a76494e8 /temperatures | |
parent | bfe124440f48e23dc5b3e73dac6ead1928d885d5 (diff) |
temperatures
Diffstat (limited to 'temperatures')
-rwxr-xr-x | temperatures | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/temperatures b/temperatures new file mode 100755 index 0000000..6307ca0 --- /dev/null +++ b/temperatures @@ -0,0 +1,26 @@ +#!/usr/bin/env zsh + +host=$(hostname) + +if [[ $host == "bogues" ]]; then + echo "$(cat /proc/acpi/ibm/thermal | sed "s|\s\+| |g" | cut -d " " -f 2)°C" +elif [[ $host == "durant" ]]; then + #echo "CPU:\t$(sensors | sed "s|\s\+| |g" | grep Package | cut -d " " -f 4)" + echo "CPU: $(ipmitool sensor | sed "s|\s\+| |g" | grep CPU | cut -d " " -f 4 | cut -d. -f 1)°C" + for disk in `fdisk -l 2>/dev/null | grep -P "/dev" | grep Disk | cut -d " " -f 2 | sed "s|:||"`; do + case $disk in + /dev/nvme*) + TEMP=$(nvme smart-log $disk | grep temperature | cut -d " " -f 27 | sed "s|C||") + echo "$disk\t$TEMP°C" + ;; + /dev/sd*) + TEMP=$(smartctl -a $disk | grep Temp | cut -d " " -f 37) + if [[ $TEMP != "" ]]; then + echo "$disk\t$TEMP°C" + fi + ;; + *) + ;; + esac + done | sort +fi |