CPUtemp - A CPU Temperature Monitor

Miscellaneous tools
Message
Author
User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#61 Post by Semme »

Not knowing from where those get their info, compare:

Code: Select all

cat /proc/acpi/thermal_zone/THM/temperature

Mercedes350se
Posts: 790
Joined: Wed 16 Apr 2008, 11:28

#62 Post by Mercedes350se »

Code: Select all

# cat /proc/acpi/thermal_zone/THM/temperature
returns

cat: /proc/acpi/thermal_zone/THM/temperature: No such file or directory

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#63 Post by Semme »

No doubt we're on different systems so, going from acpi, take a closer look @ your path..

User avatar
ardvark
Posts: 1448
Joined: Tue 02 Jul 2013, 03:43
Location: USA

#64 Post by ardvark »

Mercedes350se wrote:Sure does. Thank you.
You're welcome :)

Mercedes350se
Posts: 790
Joined: Wed 16 Apr 2008, 11:28

#65 Post by Mercedes350se »

Semme wrote:No doubt we're on different systems so, going from acpi, take a closer look @ your path..
There is nothing in the thermal_zone directory.

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#66 Post by Semme »

Hmm, there's a *temperature* file aboard 431.. Don't know how 412 does it..

User avatar
8-bit
Posts: 3406
Joined: Wed 04 Apr 2007, 03:37
Location: Oregon

#67 Post by 8-bit »

After loading it87 with modprobe in Puppy Lupu 520, I actually get a display of CPU core temperatures and fan speeds.
But Pwidgets still shows the CPU temp as 0 and the fan display says CPU Fan no fans?
Is there a way to get Pwidgets to display the values?

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#68 Post by musher0 »

Hello, all.

First, thanks to rcrsn51 for opening this thread. I must say that I find his
tray icon most useful.

However, a different approach might be more suited for integration in a
dynamic menu, such as pekwm's or aewm's. I'll provide examples of
menu entries later.

The script below takes the five temperatures provided by the < sensors >
command and averages them through awk. Less accurate, no doubt, but
there's only one number to grasp.

BFN.

musher0

P.S. Keep your heat sinks clean! :)

~~~~~~~~~~~

Code: Select all

#!/bin/ash
# ~/my-applications/bin/AVGsysTEMP.sh
# musher0, July 25, 2015.
####
# variables
AVGsysTEMP="`sensors | awk '$1 ~ /temp/ { s += $2 } END { print s/5 }'`"

if [ "${LANG:0:2}" = "fr" ];then
	MSG="La température moyenne de votre système est de $AVGsysTEMP° C."
else
	MSG="The average temperature of your system is $AVGsysTEMP° C."
fi

CLR="bg SaddleBrown -bd NavajoWhite3 -fg snow"

# action
/usr/X11/bin/yaf-splash -margin 15 -bw 20 -$CLR -placement center -font "9x15B" -timeout 10 -outline 0 -text "$MSG"
Attachments
Average-system-temp.jpg
Average displayed through the traditional yaf-splash.
(6.02 KiB) Downloaded 644 times
AVGsysTEMP.sh.zip
Unzip in any /bin type folder and make executable.
(554 Bytes) Downloaded 211 times
Last edited by musher0 on Sat 25 Jul 2015, 09:32, edited 1 time in total.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#69 Post by musher0 »

(Cont'd from above.)

Here is a dynamic script for pekwm incorporating the Average System
Temperature in the pekwm menu.

Code: Select all

#!/bin/ash
# AVGTEMP.sh # for / pour pekwm
# musher0, July 25, 2015
####
MBINS="~/my-applications/bin"
AVGsysTEMP="`sensors | awk '$1 ~ /temp/ { s += $2 } END { print s/5 }'`"
AVGsysTEMP="$AVGsysTEMP C" # The sign for degrees does not carry.
echo "Dynamic {"
echo " Entry = \" Avg. Sys. Temp.: $AVGsysTEMP\" { Actions = \"Exec $MBINS/AVGsysTEMP.sh & \" }"
# Alternative to the line above if you don't want to call anything:
# echo " Entry = \" Avg. Sys. Temp.: $AVGsysTEMP\" { Actions = \"Exec &\" }"
echo " }"

####
# In pekwm menu, towards the top, after
#
# Menu config for pekwm
# Variables
# INCLUDE = "vars"
# RootMenu = "Pekwm" {
#	Entry = "" { Actions = "Dynamic $PEK/date-heure-pekwm.sh & "}

# insert:

#	Entry = "" { Actions = "Dynamic /root/.pekwm/AVGTEMP.sh &" }

# (...) (Rest of pekwm menu)
####
Attachments
AvgSysTemp-pekwm_2015-07-25.jpg
Average system temperature shown at the top of the pekwm menu
(13.16 KiB) Downloaded 643 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#70 Post by musher0 »

(Cont'd from above)

It's pretty much the same with aemenu. Here's a snippet which is later
incorporated, in this case, into a more elaborate "Internet & Browsers"
menu.

Code: Select all

#!/bin/ash
# $AEM/incorporer-date.sh # Incorporer date et heure aux (ae)aemenus
# Aussi la temp. du système.
# musher0, 25 juillet 2015.
####
[ ${LANG:0:2} = "fr" ] && JOUR="`date '+%a. %d %b.'`" || JOUR="`date '+%a. %b. %d'`";HR="`date '+%R'`";AN="`date '+%Y'`" # données
[ -f /tmp/drapeau-aepanel ] && JOUR="$JOUR $AN" || JOUR="$JOUR, $HR"
echo "cmd \"$JOUR\" /root/my-applications/bin/hic-et-nunc2.sh" > /tmp/date

AVGsysTEMP="`sensors | awk '$1 ~ /temp/ { s += $2 } END { print s/5 }'`"
AVGsysTEMP="$AVGsysTEMP° C"
echo "cmd \"Temp. sys. : $AVGsysTEMP\" \"\"" >> /tmp/date
But it's a matter of scripting style. I find it easier to build my "aemenus"
by "piling bricks", so to speak. But you could have an aemenu
incorporating date, time, RAM use, system temperature, the programs
and their categories, plus various exit options, all in one go. Forum
member aragon's spm2 and spm3 menu-buiilding scripts (elsewhere on
this forum) are good examples of that "all-in-one-go" approach.

BFN.

musher0
Attachments
AvgSysTemp-aemenu_2015-07-25.jpg
(23.01 KiB) Downloaded 638 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#71 Post by musher0 »

Hello, everyone!

Speaking of temperature, my main -- and old -- computer died on me 10 days ago,
during a humid heat wave this valley is famous for, and I had to dust off a back-up
1.9 MHz AMD I had.

(On the positive side, this weather situation generally underscores the importance of
having a good heat sensor display on your Puppy, doesn't it?)

Now the main board on this back-up Athlon AMD has only one sensor when using
the on-board video chip. If you have an AGP video card installed, the "sensors"
utility provided by rcrsn51 in the first post of this thread will pick up three readings.
Both cases make my previous script useless.

So I adapted my script, this time to divide not by a fixed number but by the number
of sensors that the "sensors" utility recognizes. Hopefully, this will solve the problem
for good.

For the calculation, in this update, "bc" is now used instead of "expr", for greater
precision and ease of use.

Also, French and Canadian-French users now get a "floating comma" in their menu
and pager displays, whereas English-speaking users keep their traditional
"floating point".

Finally, I'm including a nice temperature icon that I found here. The colors in the
icon are tentatively matched in the displayed box.

I hope this can be of help to someone. Feedback welcome. BFN.

musher0

~~~~~~~~~~~~

Code: Select all

#!/bin/ash
# ~/my-applications/bin/AVGsysTEMP-2.sh
# musher0, July 25 & Aug. 12, 2015.
#### set -xe
# variables
sysTEMP="`sensors | awk '$1 ~ /temp/ { s += $2 } END { print s }'`"
ChIpS="`sensors | grep temp | wc -l`"
AVGsysTEMP="`echo \"scale=1;$sysTEMP/$ChIpS\" | bc`"

if [ "${LANG:0:2}" = "fr" ];then
	AVGsysTEMP="`echo $AVGsysTEMP | tr . ,`"
	MSG="La température moyenne du système est de $AVGsysTEMP° C."
else
	MSG="The average temperature of the system is $AVGsysTEMP° C."
fi

COLR="bg #435167 -bd "#8F44AB" -fg snow"

# action
/usr/X11/bin/yaf-splash -margin 15 -bw 8 -$COLR -placement center -font "9x15B" -timeout 7 -outline 0 -text "$MSG"
### 30 ### set +xe
Attachments
temperature-icon-48x.png
If you need it. This icon isn't covered by a GPL or CC license, but the site says that
it's &quot;Free for non-commercial use&quot; (sic).
(2.97 KiB) Downloaded 552 times
AVGsysTEMP-2.sh.gz
(482 Bytes) Downloaded 266 times
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#72 Post by Mike Walsh »

Hi.

@rcrsn51/majorfoo:-

I concur about the P4s, with regard to CPU scaling not working. Quite simply, this is because Intel's CPUs didn't contain the requisite SpeedStep code in their instruction sets at the time of the P4's manufacture. It had been originally implemented in the 2nd-gen P3s.....but then skipped a generation, due to Intel becoming obsessed with all-out speed in the P4s..... and next appeared in the Pentium 4-M's which were developed for mobile devices. And of course, mobile devices need to watch their power consumption more than a desktop PC.

And with regard to the tray icon displaying a temp for the P4s, it largely depends on the motherboard manufacturer. The P4s didn't have an embedded temp sensor on-board the chip itself; AFAIK, the sensor was embedded, instead, in the CPU socket, for some strange reason..... Some manufacturers fitted the socket with the sensor; some didn't.

I have a 2.6 GHz, non-HT P4 in my old Dell laptop (previously running a 2.2 GHz Celeron), so I know this to be true from personal experience. It's unfortunate they chose to fit a full, desktop processor into their laptops at the time of the Inspiron 1100's manufacture. They did compensate for this to some extent by fitting the 1100 with a truly enormous battery pack; mine supplies somewhere in the region of nearly 16 volts, @ 7480 mAh (!!).....which largely contributed to the all-in weight of around 7.5 lbs. :lol:

The battery pack alone weighs more than a MacBook 'Air'..... :shock:

But despite being almost 13 yrs old, she runs Tahrpup flawlessly.....and quite nippy with it, too!


Regards,

Mike. :)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#73 Post by musher0 »

Hi, Mike.

Thanks for the sensor info on the P4's. It's good to get confirmation, to know.

@all: Witness the power of the awk! :)

Code: Select all

sensors | awk '$1 ~ /temp/ { s += $2 ;n++ } END { printf "\n\t\t\tAVG syst. temp.: " "%4.1f C\n\n", s/n }'
Except the display part, it's the entire bash script above on one line... (hehe)
I won't be changing my script, but the processes on that awk line are nice little discoveries.
For next time! :)

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#74 Post by rcrsn51 »

CPUtemp v1.9 posted above.

Mayou

VVersion 1.7 is enoughersion 1.7

#75 Post by Mayou »

Version 1.7 is enough on my old laptop
icon appears down my screen 63°C, not bad

Post Reply