How can I monitor CPU temperature and fan speed?

olav

Well-Known Member

Reaction score: 28
Messages: 374

I've tried to google for this, but I've only found half answers, and theyre also often very different when it comes to what you should install from ports.

So I need some help, what is the recommended hardware monitoring software to install? How do I do it? And how do I use it?
 

sverreh

Active Member

Reaction score: 25
Messages: 124

Try mbmon:

/usr/ports/sysutils/mbmon

Works nicely for me.
 

paean

Active Member

Reaction score: 10
Messages: 111

I use conky to monitor temps, fan speed, disc and net usage. There are plenty of nicely prepared scripts available. A few people have shared theirs here on the forums.
 

OH

Active Member

Reaction score: 33
Messages: 209

Younger intel processors, supported by coretemp(), will have their temperature noted in sysctl
$ sysctl dev.cpu | grep temp
Code:
dev.cpu.0.temperature: 36,0C
dev.cpu.1.temperature: 37,0C
 

User23

Well-Known Member

Reaction score: 67
Messages: 495

my kernel config always have the following lines:

Code:
# CPU frequency control
device          [url=http://www.FreeBSD.org/cgi/man.cgi?query=cpufreq&apropos=0&sektion=0&manpath=FreeBSD+8.0-RELEASE&format=html]cpufreq[/URL] 
device          [url=http://www.FreeBSD.org/cgi/man.cgi?query=amdtemp&apropos=0&sektion=0&manpath=FreeBSD+8.0-RELEASE&format=html]amdtemp[/URL]  # for AMD CPU
#device         [url=http://www.FreeBSD.org/cgi/man.cgi?query=coretemp&apropos=0&sektion=0&manpath=FreeBSD+8.0-RELEASE&format=html]coretemp[/URL]  # for Intel CPU
 

sk8harddiefast

Daemon

Reaction score: 198
Messages: 2,157

set this line on /boot/loader.conf
Code:
coretemp_load="YES"
reboot and sysctl dev.cpu | grep temp show you something like this:
Code:
dev.cpu.0.temperature: 59.0C
dev.cpu.1.temperature: 57.0C
dev.cpu.2.temperature: 55.0C
dev.cpu.3.temperature: 56.0C
Now i am trying to exec somehow sysctl dev.cpu | grep temp on conky
there is also xmbmon where is the graphical mbmon if you like it :)
 

DutchDaemon

Administrator
Staff member
Administrator
Moderator
Developer

Reaction score: 2,938
Messages: 11,343

Don't grep sysctl output, just run something like sysctl -n dev.cpu.0.temperature.
 

sk8harddiefast

Daemon

Reaction score: 198
Messages: 2,157

DutchDaemon solutions sounds much better :)
There Is difference of grep and -n on sysctl? (except the output of "sysctl -n dev.cpu.0.temperature" shows the temp of the first core and "sysctl dev.cpu | grep" shows temp of all cores)
 
OP
olav

olav

Well-Known Member

Reaction score: 28
Messages: 374

Coretemp works great! Ive tried mbmon too, but it reports a different temperature? And the fan speed, is it rotations per hour?
 

Beastie

Daemon

Reaction score: 532
Messages: 2,271

sk8harddiefast said:
There Is difference of grep and -n on sysctl? (except the output of "sysctl -n dev.cpu.0.temperature" shows the temp of the first core and "sysctl dev.cpu | grep" shows temp of all cores)
You're on FreeBSD, and the documentation is at your fingertips!

-n shows the variable without the names. You get the difference you mentioned because DutchDaemon specified core 0. You could just as well use % sysctl -n dev.cpu or better, call % sysctl -n dev.cpu.n.temperature four times one for each core. Like this:
Code:
#!/bin/sh

cores=0

until [ $cores -eq 4 ]
do
	echo Core \#$cores: `sysctl -n dev.cpu.$cores.temperature`
	cores=`expr $cores + 1`
done
 

sk8harddiefast

Daemon

Reaction score: 198
Messages: 2,157

Code:
#!/bin/sh

cores=0

until [ $cores -eq 4 ]
do
	echo Core \#$cores: `sysctl -n dev.cpu.$cores.temperature`
	cores=`expr $cores + 1`
done
if i exec this script on conky i will get core temp?
 

sk8harddiefast

Daemon

Reaction score: 198
Messages: 2,157

worked find but i have a little problem.Temp shows vertical but i have horizontal conky.Any ideas?
 

Beastie

Daemon

Reaction score: 532
Messages: 2,271

Code:
#!/bin/sh
echo `sysctl -n dev.cpu.0.temperature`/`sysctl -n dev.cpu.1.temperature`/`sysctl -n dev.cpu.2.temperature`/`sysctl -n dev.cpu.3.temperature`
 

klabacita

Active Member

Reaction score: 2
Messages: 146

Hi.

Guys, where I can see all the CPU's that coretemp support or how do I know?
Xeon is on them right?

Thanks!!!
 

User23

Well-Known Member

Reaction score: 67
Messages: 495

from the coretemp man page:

DESCRIPTION
The coretemp driver provides support for the on-die digital thermal sen-
sor present in Intel Core and newer CPUs

---

Code:
sysctl -a | grep temp
and you will get for example:

Code:
net.inet6.ip6.use_tempaddr: 0
net.inet6.ip6.temppltime: 86400
net.inet6.ip6.tempvltime: 604800
net.inet6.ip6.prefer_tempaddr: 0
dev.cpu.0.temperature: 33.0C
dev.cpu.1.temperature: 32.0C
dev.cpu.2.temperature: 28.0C
dev.cpu.3.temperature: 32.0C
dev.coretemp.0.%desc: CPU On-Die Thermal Sensors
dev.coretemp.0.%driver: coretemp
dev.coretemp.0.%parent: cpu0
dev.coretemp.1.%desc: CPU On-Die Thermal Sensors
dev.coretemp.1.%driver: coretemp
dev.coretemp.1.%parent: cpu1
dev.coretemp.2.%desc: CPU On-Die Thermal Sensors
dev.coretemp.2.%driver: coretemp
dev.coretemp.2.%parent: cpu2
dev.coretemp.3.%desc: CPU On-Die Thermal Sensors
dev.coretemp.3.%driver: coretemp
dev.coretemp.3.%parent: cpu3
now you know the variable you are able to ask with sysctl directly for it, without wasting cpu time while asking for all of the variables :)

example:

Code:
sysctl dev.cpu | grep temp
for
Code:
dev.cpu.0.temperature: 32.0C
dev.cpu.1.temperature: 31.0C
dev.cpu.2.temperature: 28.0C
dev.cpu.3.temperature: 31.0C
or directly:

Code:
sysctl dev.cpu.0.temperature
 

klabacita

Active Member

Reaction score: 2
Messages: 146

This is just for reference, I see that my current Xeon is able to give this info.

Thanks User23.
 
Top