To totally unlock this section you need to Log-in
Login
This is a small guide on How to Monitor Laptop CPU Temperature and Hard Disk in Linux – CLI Command Line and GUI. In this guide we will show few methods to get temperatures.
Commonly used tools to Monitor Laptop CPU Temperature and Hard Disk
- cat temperature file. (no additional software required).
- Using ACPI tool (acpi installation required).
- Using sensors tools (lm-sensors installation required).
The elite way, cat the temperature file
# cat /proc/acpi/thermal_zone/THM/temperature
Sample outputs:
temperature: 55 C
That’s it, no software’s required.
Old school CLI, using ACPI
In Debian flavour linux such as Debian, Ubuntu, Kali, use the following command:
# apt-get install acpi
Usage:
# acpi -t
Sample Output:
Thermal 0: ok, 55.0 degrees C Thermal 1: ok, 54.0 degrees C
You can check all the status together:
# acpi -V
Sample Output:
Battery 0: Discharging, 96%, 02:33:55 remaining Battery 0: design capacity 1773 mAh, last full capacity 1723 mAh = 97% Adapter 0: off-line Thermal 0: ok, 55.0 degrees C Thermal 0: trip point 0 switches to mode critical at temperature 105.0 degrees C Thermal 0: trip point 1 switches to mode passive at temperature 90.5 degrees C Thermal 1: ok, 54.0 degrees C Thermal 1: trip point 0 switches to mode critical at temperature 127.0 degrees C Cooling 0: LCD 8 of 15 Cooling 1: Processor 0 of 10 Cooling 2: Processor 0 of 10
acpi can also be used to check battery and power status.
Using Sensors tools – The full thrust
The following packages need to be installed:
- lm-sensors – a hardware health monitoring package for Linux. It allows you to access information from temperature, voltage, and fan speed sensors. It works with most newer systems.
- hddtemp – monitors and reports the temperature of PATA, SATA or SCSI hard drives by reading Self-Monitoring Analysis and Reporting Technology (S.M.A.R.T.) information on drives that support this feature.
- sensors-applet – an applet for the GNOME panel that displays readings from hardware sensors, including temperatures, fan speeds and voltage readings.
- computertemp – little applet for the GNOME desktop that shows the temperature of your CPU and disks in the panel.
Both sensors-applet and computertemp are applets that can be added to GNOME panel – you do not need both. Which one to use is your personal preference.
Open terminal window and type the following command:
# apt-get install lm-sensors hddtemp sensors-applet computertemp
Before we can monitor the temperatures we need to configure the sensors.sensors-detect command helps determine which kernel modules need to be loaded to use lm_sensors most effectively.
Open terminal window and type the following command:
# sensors-detect
You will be asked a few questions. It is generally safe and recommended to accept the default answers to all questions except the last one – the default is NO. You need to answer yes so that the required entries are made in /etc/modules file. Next step is to load the new modules into the kernel.
# /etc/init.d/module-init-tools
Now that you have everything in place you can monitor the CPU and hard drive temperatures either from the command line or add an applet to the GNOME panel.
CLI Options
Open terminal window and type the following command(s):
sensors
Check Hard Disk temperature from CLI
# hddtemp /dev/sda
Sample Output:
Using sensors applet
Add sensors applet to the panel:
- Right click on the top or bottom panel.
- Click Add to Panel.
- Scroll down and select Hardware Sensors Monitor.
- Click Add.
- Click Close.
By default sensors applet does not display hard drive temperature. To add it:
- Right click on the applet and select Preferences.
- Select Sensors tab.
- Expand hddtemp.
- Check the box in Enabled.
- Click Close.
You should now see the CPU and hard drive temperatures in your panel:
Using computertemp applet
- Right click on the top or bottom panel.
- Click Add to Panel.
- Scroll down and select Computer Temperature Monitor.
- Click Add.
- Click Close.
To display hard drive temperature you need to add another copy of the computertemp applet.
- Repeat the steps above and add the computertemp applet to the panel.
- Right the newly added computertemp applet and select Preferences.
- Select HDDTEMP as the sensor to monitor.
- Select /dev/sda as the Thermal Zone.
- Click Close.
You should now see the CPU and hard drive temperatures in your panel: