LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-11-2019, 09:21 PM   #1
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,365

Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
Best practice CPU temp monitoring: -current


I have a new computer build and I am keen to watch the CPU temp while I am getting used to it and the AIO cooler I have installed. At the moment I am using conky with:

Code:
${color black}CPU Temp:${alignr}${execi 10 cat /sys/class/hwmon/hwmon0/temp1_input | cut -c 1-2}°C
Does this seem reasonable to more experienced users? This certainly tracks rise and fall pretty accurately. I had a look at sensors but I do not understand the output:

Code:
andrew@ilium~$ sensors
k10temp-pci-00c3
Adapter: PCI adapter
Tdie:         +21.8°C  (high = +70.0°C)
Tctl:         +48.8°C  

k10temp-pci-00cb
Adapter: PCI adapter
Tdie:         +21.5°C  (high = +70.0°C)
Tctl:         +48.5°C  

andrew@ilium~$
Thanks...
 
Old 06-11-2019, 10:39 PM   #2
3rensho
Senior Member
 
Registered: Mar 2008
Location: Deutschland
Distribution: Slackware64-current
Posts: 1,019

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
I use glances for monitoring my system in real time. If you're running KDE then ksysguard can be configured to monitor what you want.

Last edited by 3rensho; 06-11-2019 at 10:40 PM.
 
1 members found this post helpful.
Old 06-11-2019, 10:58 PM   #3
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,365

Original Poster
Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
Quote:
Originally Posted by 3rensho View Post
I use glances for monitoring my system in real time. If you're running KDE then ksysguard can be configured to monitor what you want.
I confess that I had not heard of either of these and a quick inspection shows that they both make conky look a little 'old school'
 
Old 06-12-2019, 01:32 AM   #4
3rensho
Senior Member
 
Registered: Mar 2008
Location: Deutschland
Distribution: Slackware64-current
Posts: 1,019

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
I just upgraded psutil to 5.6.3 and glances reports diskio now.
 
Old 06-12-2019, 07:35 AM   #5
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 836
Blog Entries: 3

Rep: Reputation: 297Reputation: 297Reputation: 297
Another way to get that info without having to use cat / shell commands is to use hwmon in your conky config. Should be more efficient than execi.


Something like:
Code:
${hwmon 0 temp 1}

http://conky.sourceforge.net/variables.html
Quote:
Hwmon sensor from sysfs (Linux 2.6). Parameter dev may be omitted if you have only one hwmon device. Parameter type is either 'in' or 'vol' meaning voltage; 'fan' meaning fan; 'temp' meaning temperature. Parameter n is number of the sensor. See /sys/class/hwmon/ on your local computer. The optional arguments 'factor' and 'offset' allow precalculation of the raw input, which is being modified as follows: 'input = input * factor + offset'. Note that they have to be given as decimal values (i.e. contain at least one decimal place).
 
Old 06-12-2019, 05:11 PM   #6
mrapathy
Member
 
Registered: Nov 2005
Distribution: Slackware,Debian
Posts: 366

Rep: Reputation: 66
used gkrellm for years give it a try
 
1 members found this post helpful.
Old 06-15-2019, 05:55 AM   #7
FlinchX
Member
 
Registered: Nov 2017
Distribution: Slackware Linux
Posts: 666

Rep: Reputation: Disabled
conky/gkrellm will show temperatures in real time as mentioned above. But I don't think you are happy with the idea of wasting your life staring at the monitor to watch that :-)

Additionally, run something that tracks temperature and saves it over time, so you could fire up a web browser and have a look at a graph for a long period of time whenever you need. You'll have to investigate because there's plenty of options. It can be an enterprise-scale behemoth like nagios/zabbix, collectd with sensors plugin enabled, or something more lightweight to run on a desktop. My personal favorite is monitorix. SBo has a buildscript for it. I can get daily/weekly/monthly/yearly graphs there for a lot of things, including CPU temperatures.
 
1 members found this post helpful.
Old 08-02-2020, 11:25 PM   #8
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,365

Original Poster
Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
Like a dog with a bone I cannot let go of this thread . Spurred along by some undoubtedly spurious temps generated with kernel 5.7.x and 5.8 I have had a closer look at lm-sensors and hopefully sorted out a more definitive CPU temperature monitoring. With lm-sensors configured properly and the appropriate modules loaded I have the following:

Code:
andrew@ilium~$ sensors
nct6797-isa-0a20
Adapter: ISA adapter
in0:                   768.00 mV (min =  +0.00 V, max =  +1.74 V)
in1:                   1000.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in2:                     3.33 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in3:                     3.31 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in4:                     1.02 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:                   144.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in6:                   944.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in7:                     3.33 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in8:                     3.23 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in9:                     1.82 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in10:                  680.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in11:                  648.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in12:                    1.15 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in13:                  680.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in14:                    1.51 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
fan1:                     0 RPM  (min =    0 RPM)
fan2:                  2073 RPM  (min =    0 RPM)
fan3:                     0 RPM  (min =    0 RPM)
fan4:                     0 RPM  (min =    0 RPM)
fan5:                     0 RPM  (min =    0 RPM)
fan6:                     0 RPM  (min =    0 RPM)
fan7:                   851 RPM  (min =    0 RPM)
SYSTIN:                 +32.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = CPU diode
CPUTIN:                 +27.0°C  (high = +107.0°C, hyst = +89.0°C)  sensor = thermistor
AUXTIN0:                +29.0°C  (high = +107.0°C, hyst = +89.0°C)  sensor = thermistor
AUXTIN1:                +44.0°C    sensor = thermistor
AUXTIN2:                +46.0°C    sensor = thermistor
AUXTIN3:                 -1.0°C    sensor = thermistor
SMBUSMASTER 0:          +53.0°C  
PCH_CHIP_CPU_MAX_TEMP:   +0.0°C  
PCH_CHIP_TEMP:           +0.0°C  
PCH_CPU_TEMP:            +0.0°C  
intrusion0:            ALARM
intrusion1:            ALARM
beep_enable:           disabled

k10temp-pci-00c3
Adapter: PCI adapter
Tctl:         +53.0°C  
Tdie:         +26.0°C  
Tccd1:        +52.5°C  

k10temp-pci-00cb
Adapter: PCI adapter
Tctl:         +52.5°C  
Tdie:         +25.5°C  

andrew@ilium~$
The temp that has drawn my attention is CPUTIN which I believe is CPU temp reported by the motherboard and I have added this to ~/.conkyrc with:

Code:
CPU Temp:${alignr}${execi 10 sensors | grep CPUTIN | cut -d '+' -f 2 | cut -d ' ' -f1}
But I guess the issue is that there can never really be a definitive method of monitoring CPU temp as there will be too much variability with available sensors, mobo types, Linux kernel and even installed version of lm-sensors. Fascinating though

On a rainy weekend I will work on that syntax a little as a 'serial' cut command is never the most efficient way of doing things...
 
1 members found this post helpful.
Old 08-03-2020, 01:22 AM   #9
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,682

Rep: Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375
Quote:
Originally Posted by coralfang View Post
Another way to get that info without having to use cat / shell commands is to use hwmon in your conky config. Should be more efficient than execi.


Something like:
Code:
${hwmon 0 temp 1}

http://conky.sourceforge.net/variables.html
coralfang is right, this is the correct way to monitor CPU temps with conky. This way will give you real time monitoring.
 
2 members found this post helpful.
Old 08-03-2020, 04:02 AM   #10
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,784

Rep: Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434
Quote:
Originally Posted by Daedra View Post
coralfang is right, this is the correct way to monitor CPU temps with conky. This way will give you real time monitoring.
I really don't see any justification for calling one method correct over another especially when the kernel dev team specifically recommends lm-sensors to interpret hwmon. They act essentially the same with the same API but "sensors" is specific to the chipset kernel modules and labels it's reports.

I've used bare lm-sensors, gkrellm (which is a rather old and clunky interface) and conky. Conky requires knowing some code instead of just selecting someone else's work as a kind of module with very minor specifics in how much is reported in what fields. GKrellm works and is a perfectly fine choice but it does show it's age and limitations in display. Conky is definitely more flexible and individual, even if it is sometimes a pita but that's actually because of the many variations in WM/DEs.

Presently and for a few years now I've been using this format for CPU temps in real time

Code:
  ###Conky CPU Temps
###core temps
###
${offset 400}${color red}${exec sensors | grep 'Core 0' | awk '{print $0,$1,$2,$3}'| cut -c1-24} 
${offset 410}${color red}${exec sensors | grep 'Core 1' | awk '{print $0,$1,$2,$3}'| cut -c1-24}
${offset 420}${color red}${exec sensors | grep 'Core 2' | awk '{print $0,$1,$2,$3}'| cut -c1-24}
${offset 430}${color red}${exec sensors | grep 'Core 3' | awk '{print $0,$1,$2,$3}'| cut -c1-24}
###
It works just fine
 
1 members found this post helpful.
Old 08-03-2020, 04:19 AM   #11
slalik
Member
 
Registered: Nov 2014
Location: Moscow
Distribution: Slackware
Posts: 233

Rep: Reputation: 203Reputation: 203Reputation: 203
To get an approximate idea instead of exact degrees, I use the bar:
Code:
CPU Temp:  ${execibar 10 echo \
  $((`cat /sys/devices/platform/coretemp.0/hwmon/hwmon0/temp1_input`/1000))}
 
2 members found this post helpful.
Old 08-03-2020, 05:21 PM   #12
Daedra
Senior Member
 
Registered: Dec 2005
Location: Springfield, MO
Distribution: Slackware64-15.0
Posts: 2,682

Rep: Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375Reputation: 1375
Quote:
Originally Posted by enorbet View Post
I really don't see any justification for calling one method correct over another especially when the kernel dev team specifically recommends lm-sensors to interpret hwmon. They act essentially the same with the same API but "sensors" is specific to the chipset kernel modules and labels it's reports.

I've used bare lm-sensors, gkrellm (which is a rather old and clunky interface) and conky. Conky requires knowing some code instead of just selecting someone else's work as a kind of module with very minor specifics in how much is reported in what fields. GKrellm works and is a perfectly fine choice but it does show it's age and limitations in display. Conky is definitely more flexible and individual, even if it is sometimes a pita but that's actually because of the many variations in WM/DEs.

Presently and for a few years now I've been using this format for CPU temps in real time

Code:
  ###Conky CPU Temps
###core temps
###
${offset 400}${color red}${exec sensors | grep 'Core 0' | awk '{print $0,$1,$2,$3}'| cut -c1-24} 
${offset 410}${color red}${exec sensors | grep 'Core 1' | awk '{print $0,$1,$2,$3}'| cut -c1-24}
${offset 420}${color red}${exec sensors | grep 'Core 2' | awk '{print $0,$1,$2,$3}'| cut -c1-24}
${offset 430}${color red}${exec sensors | grep 'Core 3' | awk '{print $0,$1,$2,$3}'| cut -c1-24}
###
It works just fine
I didn't mean to insinuate one way is wrong over another. What I mean is that conky devs and users generally accept ${hwmon 0 temp 1} is the most universally excepted way to get real time monitoring of CPU temps. But conky is not picky, if it works it works.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
lm_sensors cpu temp v.slightly different to MOBO temp on Intel D865GLC sc_3007 Linux - Hardware 5 11-13-2009 12:17 PM
nForce 4 CPU temp monitoring Slagathor Linux - Software 5 02-19-2006 11:44 PM
Monitoring CPU temp.? NSKL Linux - General 28 06-21-2002 09:11 PM
monitoring cpu temp within linux jonfa Linux - General 7 02-24-2002 05:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration