summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpks <pks@pks.rocks>2022-06-11 16:34:52 +0200
committerpks <pks@pks.rocks>2022-06-11 16:34:52 +0200
commit388486b463a2f596a20a2fe26d0160650be08f64 (patch)
treee8558608b47b26ef0cbd96e14d3da73c4cd263fb
parent52ecf61db173556aa45d8a6848a6c06989cc3a45 (diff)
temperatures: update
-rwxr-xr-xtemperatures12
1 files changed, 5 insertions, 7 deletions
diff --git a/temperatures b/temperatures
index 6307ca0..a542773 100755
--- a/temperatures
+++ b/temperatures
@@ -2,19 +2,17 @@
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"
+if [[ $host == "durant" ]]; then
+ #echo "CPU: $(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||")
+ TEMP=$(nvme smart-log $disk | grep temperature | sed "s|\s\+| |g" | cut -d " " -f 3 | sed "s|C||")
echo "$disk\t$TEMP°C"
;;
/dev/sd*)
- TEMP=$(smartctl -a $disk | grep Temp | cut -d " " -f 37)
+ TEMP=$(smartctl -a $disk | grep Temp | cut -d " " -f 37 | tr '\n' ' ' | sed "s|\s*||g")
if [[ $TEMP != "" ]]; then
echo "$disk\t$TEMP°C"
fi