FROMDEV

How to Monitor Raspberry Pi Temperature, CPU, and Storage Health

A Practical Raspberry Pi Health-Check Guide for Reliable Projects

A Raspberry Pi that runs hot, throttles its CPU, or is running out of storage can fail quietly before a project stops working. A few built-in Linux commands can help you spot those problems early. This guide shows how to monitor Raspberry Pi temperature, CPU activity and throttling, memory, and disk health—then explains what to do when a reading looks wrong.

Check Raspberry Pi Temperature from the Command Line

On Raspberry Pi OS, open a terminal or connect over SSH and run:

vcgencmd measure_temp

A typical result is temp=48.2'C. This reports the SoC temperature at the time of the command, not a long-term average. Check it while the Pi is idle and again under a representative workload; a brief high reading and sustained heat are different situations.

Read temperature through Linux thermal data

On many current Raspberry Pi OS installations, the kernel also exposes a thermal-zone reading:

cat /sys/class/thermal/thermal_zone0/temp

The value is usually in thousandths of a degree Celsius, so 48200 means 48.2°C. The available thermal-zone numbering can vary, so confirm the sensor’s meaning on your system rather than assuming every zone is the CPU.

Monitor CPU Load, Memory, and Throttling

Temperature alone does not explain poor performance. Use top or install htop to see which processes are consuming CPU and memory:

top

In top, check the CPU usage summary and process list. High CPU usage can be normal during a build or video conversion. If the Pi remains busy unexpectedly, sort processes by CPU use and investigate the service or application responsible. For a quick load snapshot, run uptime; its load averages need to be interpreted in relation to the number of CPU cores.

Check for current or past throttling

Run:

vcgencmd get_throttled

The result is a hexadecimal bit field. 0x0 means no monitored throttling or voltage flags have been recorded since boot. Other values can indicate current or past issues, including under-voltage, frequency capping, or thermal throttling. The low bits describe current conditions; corresponding higher bits record whether a condition occurred since boot.

Because the output is a bit field, don’t treat every nonzero value as proof that the Pi is throttling right now. Decode the flags using the Raspberry Pi documentation, then compare the reading before and after reproducing the workload. A historical flag can remain set until reboot, even after the cause is fixed.

Check Storage Space and Disk Health

Running out of space can prevent logs, updates, and applications from working correctly. Check mounted filesystems with:

df -h

Look at the Use% column for the root filesystem, usually mounted at /. To find large directories, use du, for example:

sudo du -xhd1 /var 2>/dev/null | sort -h

This helps identify where space is going without crossing into other mounted filesystems. Avoid deleting files you do not recognize; investigate logs, caches, and application data before removing anything.

Assess SD cards and SSDs carefully

For USB or SATA drives, smartmontools can query supported SMART health data:

sudo apt update
sudo apt install smartmontools
sudo smartctl -a /dev/sda

Replace /dev/sda with the correct device. Confirm it first with lsblk; choosing the wrong device can lead to confusion or, with other commands, data loss. USB adapters may not pass SMART commands through, and not all drives expose the same data.

Most microSD cards do not provide useful SMART health information. For them, watch for I/O errors in journalctl -k, unexpected read-only remounts, and unexplained application failures. Back up important data regularly: a clean health check cannot guarantee that flash storage will not fail.

Automate a Lightweight Health Check

For occasional checks, a short shell loop can show temperature and throttling every five seconds:

while true; do
  date
  vcgencmd measure_temp
  vcgencmd get_throttled
  sleep 5
done

Stop it with Ctrl+C. For longer-term monitoring, write readings to a log or use a monitoring system with a Raspberry Pi exporter and dashboards. Logging gives useful trends, but frequent polling and unbounded log files consume resources and storage. Choose a sensible interval, rotate logs, and monitor the monitoring system too.

What to Do When Readings Are Concerning

Test the Pi under the conditions it will actually face. A kiosk connected to a display, for example, may behave differently from an idle board; this guide to connecting a Raspberry Pi to a projector covers one such setup. For energy-monitoring projects, combine device checks with the practices in How to Monitor Home Energy Usage with Raspberry Pi and Smart Meters.

Conclusion

Reliable Raspberry Pi monitoring starts with a few simple checks: measure temperature, inspect CPU load, decode throttling flags, and keep an eye on storage space and errors. Take readings during real workloads, distinguish current issues from events recorded earlier, and treat microSD health claims with caution. Pair monitoring with backups and sensible cooling and power, and you’ll have a much better chance of catching problems before they interrupt your project.

Exit mobile version