Measure CPU Temp and CPU Load

Ok, tried some self-help...
Did nano tempcpu.py
Pasted in the contents of what you created
Write
Exit

Ah ha!

Saved as tempcpu.sh
sudo chmod +x tempcpu.sh

Then to run..

sh tempcpu.sh

And I get temp then 10 seconds of CPU and memory stuff. I wish there was something a bit different to show the 4 cores load....nmon showed a lot but it's interesting finding out these two things

Current Temp in Celsius is 40
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 0 685612 20016 103768 0 0 27 4 264 190 1 1 98 0 0
0 0 0 685472 20016 103768 0 0 0 0 913 402 1 0 98 0 0
0 0 0 685488 20016 103768 0 0 0 0 812 332 0 0 100 0 0
0 0 0 685488 20016 103768 0 0 0 0 784 274 0 0 100 0 0
^X 0 0 0 685488 20016 103768 0 0 0 0 821 332 0 0 100 0 0
0 0 0 685488 20016 103768 0 0 0 0 808 312 0 0 99 0 0
0 0 0 685488 20016 103768 0 0 0 0 791 281 1 0 99 0 0

Also...what setting in PuTTY gives the correct ANSI like codes? nmon looks off and I suspect there's a setting in PuTTY I don't have set right

For example...my nmon view...can't figure out how to get lines instead of garbage text

nmonq16fqqqqqqqqqqqqqqqqqqqqqHostname=CR10SqqqqqqqqRefresh= 2secs qqq18:44.55qqqqqqqqqqqk
x x
x ------------------------------ x
x _ __ _ __ ___ ___ _ __ For help type H or ... x
x | '_ | '_ ` _ \ / _ | '_ \ nmon -? - hint x
x | | | | | | | | | () | | | | nmon -h - full details x
x |
| ||| || ||___/|| || x
x To stop nmon type q to Quit x
x ------------------------------ x
x x
x x
x x
x x
x x
x x
x x
x Use these keys to toggle statistics on/off: x
x c = CPU l = CPU Long-term - = Faster screen updates x
x C = " WideView U = Utilisation + = Slower screen updates x
x m = Memory V = Virtual memory j = File Systems x
x d = Disks n = Network . = only busy disks/procs x
x r = Resource N = NFS h = more options x
x k = Kernel t = Top-processes q = Quit x
mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj

Are you using PuTTY on Windows?

If so:

PuTTY β†’ Window β†’ Translation β†’ Remote character set β†’ DEC-MCS

worked for me.

YES!

You, sir, deserve a Nobel Peace Prize!

Are there other commands that give CPU Load?
vmstat is giving me too much other data

Sure, just google "CPU stats Raspberry Pi" lots of utilities you can install.
The command "top" is installed.. like nmon ..

Think of UNIX/Linux/Debian/Raspbian as like a collection of Lego bricks. There are tons of built-in building blocks so that you can do almost anything you can dream up.

When you get a problem you can't solve, Google is your friend: windows putty line draw characters

Great info in this thread! Thanks all.

You just need to quote it more:

watch -n 10 'awk \'{s=$1/1000} END {print s" C"}\' /sys/class/thermal/thermal_zone0/temp'
1 Like