How to monitor system (CPU, HDD, mobo, GPU) temperatures on FreeNAS 8?

styno

Patron
Joined
Apr 11, 2016
Messages
466

Freenasboy

Cadet
Joined
May 21, 2017
Messages
6
smartctl 7.1 2019-12-30 r5022 [FreeBSD 12.2-RELEASE-p3 amd64] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Number: INTEL SSDPE2MD400G4
Serial Number: CVFT649200BW400GGN
Firmware Version: 8DV101H0
PCI Vendor/Subsystem ID: 0x8086
IEEE OUI Identifier: 0x5cd2e4
Controller ID: 0
Number of Namespaces: 1
Namespace 1 Size/Capacity: 400,088,457,216 [400 GB]
Namespace 1 Formatted LBA Size: 512
Local Time is: Fri Apr 23 08:37:42 2021 PST
Firmware Updates (0x02): 1 Slot
Optional Admin Commands (0x0006): Format Frmw_DL
Optional NVM Commands (0x0006): Wr_Unc DS_Mngmt
Maximum Data Transfer Size: 32 Pages

Supported Power States
St Op Max Active Idle RL RT WL WT Ent_Lat Ex_Lat
0 + 25.00W - - 0 0 0 0 0 0

Supported LBA Sizes (NSID 0x1)
Id Fmt Data Metadt Rel_Perf
0 + 512 0 2
1 - 512 8 2
2 - 512 16 2
3 - 4096 0 0
4 - 4096 8 0
5 - 4096 64 0
6 - 4096 128 0

=== START OF SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

SMART/Health Information (NVMe Log 0x02)
Critical Warning: 0x00
Temperature: 33 Celsius
Available Spare: 100%
Available Spare Threshold: 10%
Percentage Used: 0%
Data Units Read: 13,301,733 [6.81 TB]
Data Units Written: 39,850,216 [20.4 TB]
Host Read Commands: 342,337,815
Host Write Commands: 1,116,285,541
Controller Busy Time: 0
Power Cycles: 179
Power On Hours: 18,933
Unsafe Shutdowns: 0
Media and Data Integrity Errors: 0
Error Information Log Entries: 0

Error Information (NVMe Log 0x01, max 64 entries)
No Errors Logged
 

styno

Patron
Joined
Apr 11, 2016
Messages
466
Right, to get you started try the following changes:
(mind you that I don't have an nvme disk in my FreeBSD systems so I can't test this)

change
for disk in $(sysctl -n kern.disks)
to
for disk in $(ls /dev/nvme* | grep -v p | cut -f 3 -d "/")

then change
HDTEMP=$(smartctl -A /dev/"$disk" | grep -i temperature | awk '{print $10}')
to
HDTEMP=$(smartctl -A /dev/"$disk" | grep -i temperature | awk '{print $2}')
 

Freenasboy

Cadet
Joined
May 21, 2017
Messages
6
Thanks! I edited the script based on yours

#! /bin/bash
adastat () { echo -n `camcontrol cmd $1 -a "E5 00 00 00 00 00 00 00 00 00 00 00" -r - | awk '{print $10 " " ; }'` " " ; }
echo
echo System Temperatures - `date`
cat /etc/version
uptime | awk '{ print "\nSystem Load:",$8,$9,$10,"\n" }'
echo
echo "HDD Temperature:"
for disk in $(ls /dev/nvme* | grep -v p | cut -f 3 -d "/")
do
echo $disk `smartctl -a /dev/"$disk" | awk '/Temperature/{DevTemp=$2;} /Serial Number:/{DevSerNum=$3}; /Model Number:/{DevName=$3} END { print DevTemp,DevSerNum,DevName }'`
done
echo


Now it outputs


System Temperatures - Fri Apr 23 19:19:56 PST 2021
TrueNAS-12.0-U2.1 (ff1fe0fc68)

System Load: load averages: 0.38,


HDD Temperature:
nvme0 30 CVFT649200BW400GGN INTEL
nvme0ns1 30 CVFT649200BW400GGN INTEL


Is it normal for nvme0ns1 to be displayed or there's something with my edited script?
 

styno

Patron
Joined
Apr 11, 2016
Messages
466
To get that last bit sorted out for nvme change
grep -v p
To
grep -v ns
 
Top