Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

Temperature monitoring

qqBazz

Member
Joined
Nov 5, 2015
Messages
34
Fascinating, I see something similar on my X11SSM-F (but less pronounced). My guess is that IPMI is using a separate thermistor placed close to the CPU socket, which will naturally lead to lower numbers than those measured at the die.
Seems plausible -- I'm using a C2550D4I, which can, apparently, have temp issues ... but a full 20.0C degrees seems like an awfully big difference.
 

jimmyt

Junior Member
Joined
Oct 9, 2014
Messages
18
Hats off to seren and everyone else.. even this newbie has the script up and running! Now I am trying to get the email portion working and while I can get it to partially work I am running into issues.. If I paste the script into the shell it will send me the cpu image, but its the same image over and over - not the most current one even though the png file in the script "folder" is current. It also says it cant find the drive .png file - even though its in there and the file name is identical. Am I missing something simple? Here is the script that I paste into the shell:

Code:
#!/bin/sh

### Parameters ###
email="X@gmail.com"
subject="NAS Temps"

	uuencode temps-2min-cpus.png temps-2min-cpus.png > /tmp/out.mail
	uuencode temps-2min-drives.png temps-2min-drives.png > /tmp/out.mail
		mail -s "${subject}" "${email}" < /tmp/out.mail


the output in the shell is this:
Code:
[root@freenas ~]# #!/bin/sh																										
[root@freenas ~]#																												 
[root@freenas ~]# ### Parameters ###																								
[root@freenas ~]# email="X@gmail.com"																						
[root@freenas ~]# subject="NAS Temps"																							 
[root@freenas ~]#																												 
[root@freenas ~]#	 uuencode temps-2min-cpus.png temps-2min-cpus.png >> /tmp/out.mail											
[root@freenas ~]#	 uuencode temps-2min-drives.png temps-2min-drives.png >> /tmp/out.mail										
uuencode: temps-2min-drives.png: No such file or directory																		 
[root@freenas ~]#		 mail -s "${subject}" "${email}" < /tmp/out.mail														 
[root@freenas ~]#	 


after I hit enter on the last line, the email sends with only the cpu file attached - although it is from 4 days ago when I first got the sctipt to work - also, eventhough both the cpu and drive .png files are shown in the directory and both are correct and accurate up to the minute, it doesnt like the drive file name.

any help is appreciated!

thanks

@JohnnyGrey i create a little script to send me the files:
Code:
#!/bin/sh

### Parameters ###
email="your_email@email.com"
subject="Subject name"

### Send config backup ###
	cp /mnt/sysVault/sysDataSet/bin/
	uuencode temps-1min-cpus.png temps-1min-cpus.png > /tmp/out.mail
	uuencode temps-1min-drives.png temps-1min-drives.png >> /tmp/out.mail
	uuencode temps-5min-cpus.png temps-5min-cpus.png >> /tmp/out.mail
	uuencode temps-5min-drives.png temps-5min-drives.png >> /tmp/out.mail
	mail -s "${subject}" "${email}" < /tmp/out.mail
 

jimmyt

Junior Member
Joined
Oct 9, 2014
Messages
18
so after some more digging and trial and error I can now run the script from the shell as long as I am in the proper directory.. in my case, /mnt/Camera/script and I figured out that /tmp/out.mail will only hold 1 image. So if I change the name it works for cpu temps as well.. still cant get the script to run properly however..
 

Pezo

Member
Joined
Jan 17, 2015
Messages
60
Ooh, pedantry! :D

Actually, it's degree Celsius. Celsius is capitalized because it is a degree, whereas proper SI units are not - like tesla or newton are lowercase, whereas degree Celsius and degree Fahrenheit have this sort of camelCase going on (though it should really be dromedaryCase, since there's only one hump).
I know it's one and a half years later, but I just have to set this straight ;)

The casing has nothing to do with degrees, it's actually based on whether the unit is named after a person. For example, Tesla and Newton are both upper case because they're named after, well, Tesla and Newton. So are Celsius and Fahrenheit, but not meter or gram, for example. Sorry for going off-topic, I'm gonna be silent now :D
 

Ericloewe

Not-very-passive-but-aggressive
Moderator
Joined
Feb 15, 2014
Messages
16,769
I'm pretty sure that SI units are supposed to be lowercase when spelled out. It's the symbols that are uppercase for units named after people (hence N, T, Hz, Ω, A, V, etc., but kg, m, s, cd, etc.).
 

Pezo

Member
Joined
Jan 17, 2015
Messages
60
You're right, I knew about the symbols and thought it was the same with the names.
 

mka

Member
Joined
Sep 26, 2013
Messages
107
Is the script in the git repository compatible with FreeNAS 11 (old UI)? It says tested with 9.11 but not 11. Has anyone tried it? Any issues?
 

Ericloewe

Not-very-passive-but-aggressive
Moderator
Joined
Feb 15, 2014
Messages
16,769
It should be. There's no 9.11, so I assume that's a typo for 11.
 

mka

Member
Joined
Sep 26, 2013
Messages
107
Yes. There is a typo …but it's mine. The repo says tested on 9.3 and 9.10.
:oops:
 

Ericloewe

Not-very-passive-but-aggressive
Moderator
Joined
Feb 15, 2014
Messages
16,769
In any case, it should work.
 

beedix

Junior Member
Joined
Aug 11, 2017
Messages
20
Love this script. Using it on 11-u3. I've used it to tweak my fan speed to put my hard drives as optimally as I can centered between min and max. Currently, I'm droping the images to a volume with a simple HTML file that is accessable on a jail running a webserver. Makes it easy to view with a shortcut.

Is there any possibility of adding these images to the FreeNAS reporting tab?
 

James Beams

Member
Joined
Feb 20, 2017
Messages
60
Just discovered this script and installed it, but found that it doesn't log the temps from SAS drives. Data from smartctl is reported differently for these drives, so I needed to add a line to the awk script in rrd-lib.sh to parse the format:

Code:
BEGIN		 { attr=0; temp=-99 }
$1 ~ /Current/ { attr=$1; temp=$4}
$1 ~ /19[04]/ { if (attr != "194") { attr=$1; temp=$10 } }
END		   { if (temp != "-99") print temp }


This is my first time dealing with awk scripts, so there's probably a better regular expression to use (I couldn't get it to find the entire string for some reason). Here's an example from smartctl (up to where temperature is reported) of a drive I'm using:

Code:
smartctl 6.5 2016-05-07 r4318 [FreeBSD 11.1-STABLE amd64] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:			   WD
Product:			  WD3001FYYG-01SL3
Revision:			 VR07
Compliance:		   SPC-4
User Capacity:		3,000,592,982,016 bytes [3.00 TB]
Logical block size:   512 bytes
Rotation Rate:		7200 rpm
Form Factor:		  3.5 inches
Logical Unit id:	  0x50000c0f012cdf3c
Serial number:		WMC1F1847709
Device type:		  disk
Transport protocol:   SAS (SPL-3)
Local Time is:		Sat Dec 30 22:32:19 2017 CST
SMART support is:	 Available - device has SMART capability.
SMART support is:	 Enabled
Temperature Warning:  Enabled

=== START OF READ SMART DATA SECTION ===
SMART Health Status: OK

Current Drive Temperature:	 45 C
Drive Trip Temperature:		69 C
 

EsTaF

Member
Joined
Sep 20, 2013
Messages
130
Code:
root@freenas:/mnt/media1/media/bin/freenas-temperature-graphing # /mnt/media1/media/bin/freenas-temperature-graphing/rrd.sh -v /mnt/media1/media/bin/freenas-temperature-graphing/temps-1min.rrd
Script version: 1.0
Rrdtool database filename: /mnt/media1/media/bin/freenas-temperature-graphing/temps-1min.rrd
Current working directory is: /mnt/media1/media/bin/freenas-temperature-graphing
Running script: '/mnt/media1/media/bin/freenas-temperature-graphing/temps-rrd-format.sh -v '


37:41:39:42:43:48:40


(running script again non-verbosely)
Data: 36:41:39:42:43:48:40

Updating the db: '/usr/local/bin/rrdtool update /mnt/media1/media/bin/freenas-temperature-graphing/temps-1min.rrd N:36:41:39:42:43:48:40'
ERROR: /mnt/media1/media/bin/freenas-temperature-graphing/temps-1min.rrd: found extra data on update argument: 40
ERROR: Couldn't update /mnt/media1/media/bin/freenas-temperature-graphing/temps-1min.rrd with the data provided. Running diagnostics...
rrd.sh version: 1.0
rrd-graph.sh version:
rrd-lib.sh version: 1.0
Testing file permissions...
Testing chmod...
chmod: /mnt/media1/media/bin/freenas-temperature-graphing/chmodtest_fe05f7d0de03b46ed02203601f76d7035a59deda6a3c5ef9a2a02546fa630386: Operation not permitted

Error: Couldn't use chmod in /mnt/media1/media/bin/freenas-temperature-graphing. Is the filesystem a Windows filesystem?
Permissions in /mnt/media1/media/bin/freenas-temperature-graphing:
total
drwxrwxr-x+
-rwxrwxr-x+
-rwxrwxr-x+
drwxrwxr-x+
-rwxrwxr-x+
-rwxrwxr-x+
-rwxrwxr-x+
-rwxrwxr-x+
-rwxrwxr-x+
-rwxrwxr-x+
-rwxrwxr-x+
-rwxrwxr-x+
Test failed (returned 1)


But (from Readme):
"
Installation:
-------------

1. Copy the .sh files to a share on your server. Take note of the full path to
the files (ex. `/mnt/mainpool/myshare/temperature-monitoring/rrd.sh`)"

What must I change?
(FreeNAS-11.1-U4)
 

sretalla

Dedicated Sage
Joined
Jan 1, 2016
Messages
3,036
Or you could just look at the charts now baked into FreeNAS in 11.2 (you can try the beta and look at the disks report in the legacy GUI, or just wait for the final release).
 

EsTaF

Member
Joined
Sep 20, 2013
Messages
130
The beta one isn't good idea.
will be waiting 11.2 release.
And can I install the hddtemp tool at the least, as under Linux OS?
Code:
pkg update
Updating local repository catalogue...
pkg: file:///usr/ports/packages/meta.txz: No such file or directory
repository local has no meta file, using default settings
pkg: file:///usr/ports/packages/packagesite.txz: No such file or directory
Unable to update repository local
Error updating repositories!
 

sretalla

Dedicated Sage
Joined
Jan 1, 2016
Messages
3,036
hddtemp looks like a great option if it can be compiled for FreeBSD/FreeNAS... I had learned about it over the weekend when looking into options to integrate my FreeNAS boxes into homeassistant. I will have a shot at doing that soon.

As far as I could tell by googling, there's no pkg for it already ported, so it will be a case of doing a git clone of the project and seeing if the gcc can handle what's there to compile it.

The 11.2 release will not be too long, but I would still like to have the hddtemp daemon for homeassistant.
 

EsTaF

Member
Joined
Sep 20, 2013
Messages
130
In short, "tin"/hardcore) (about hdd monitoring). still have to wait for 11.2..
 
Joined
Jul 13, 2013
Messages
240
11.2 doesn't seem to have made it out yet, and I'm also unwilling to go beta on this system, but I'll look forward to it. Although I may have to continue my own system as well, because mostly I look at it combined with two other systems on a "dashboard" web page, and mostly I look at it from places that I don't want to give access to the real control GUI of the systems.
 

Rand0mUser

Junior Member
Joined
Jun 1, 2019
Messages
22
Hello,

I'm using the nice script made by @Seren here so I can monitor my HDDs drives temps on my server. I'm running on FreeNAS 11.2 stable.

I found out that a very convenient way for me to check the temps in my web browser is just to launch a little python server on any port like that:

Code:
cd scripts
python -m http.server 8014


So I just have to auto refresh url

Code:
http://myserverip:8014/temps-5min-drives.png


From any web browser and I can see my live temps.

Problem is it's really boring to launch those commands manually each time I need to check temps from one computer, so is there any way to automatize the process by launching the python server using Init/Shutdown Scripts?

I tried a few commands, still with no success. For example, this one is not working when setup in Init/Shutdown Scripts as a Post Init Command:

Code:
cd /root/scripts/ && python -m http.server 8014


Thanks for any helpful advice.
 
Top