How to see CPU temperature on CentOS/RHEL

Kaz Wolfe

Well-known member
Registered
Joined
Jul 7, 2016
Messages
609
Points
28
I am not a sysadmin of CentOS server. How can I get my CPU temperature information on CentOS Linux or Red Hat Enterprise Linux server? many thanks!
 

MooseLucifer

Well-known member
Registered
Joined
May 20, 2016
Messages
149
Points
28
You can install Linux hardware monitoring tool such as lm_sensor. This tool will provide some essential command line utilities for monitoring the hardware health for your Linux systems containing hardware health monitoring hardware including CPU and fan speed.

How to do? you need to run these simple commands

First off, find out your OS version
Code:
cat /etc/centos-release
or

Code:
cat /etc/redhat-release
The output is

Code:
root@myvps1 [~]# cat /etc/centos-release
CentOS release 6.8 (Final)

Install lm_sensors package on CentOS/RHEL

Type the following yum command:
Code:
root@myvps1 [~]# sudo yum install lm_sensors
The output should be:

Code:
root@myvps1 [~]# sudo yum install lm_sensors
Loaded plugins: fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.firehosted.com
 * epel: fedora-epel.mirror.lstn.net
 * extras: mirror.compevo.com
 * rpmforge: mirror.team-cymru.org
 * updates: pubmirrors.dal.corespace.com
Resolving Dependencies
--> Running transaction check
---> Package lm_sensors.x86_64 0:3.1.1-17.el6 will be installed
--> Processing Dependency: lm_sensors-libs(x86-64) = 3.1.1-17.el6 for package: l                                                                                m_sensors-3.1.1-17.el6.x86_64
--> Processing Dependency: libsensors.so.4()(64bit) for package: lm_sensors-3.1.1-17.el6.x86_64
--> Running transaction check
---> Package lm_sensors-libs.x86_64 0:3.1.1-17.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================================================================================================
 Package                                     Arch                               Version                                  Repository                        Size
================================================================================================================================================================
Installing:
 lm_sensors                                  x86_64                             3.1.1-17.el6                             base                             123 k
Installing for dependencies:
 lm_sensors-libs                             x86_64                             3.1.1-17.el6                             base                              38 k

Transaction Summary
================================================================================================================================================================
Install       2 Package(s)

Total download size: 161 k
Installed size: 414 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): lm_sensors-3.1.1-17.el6.x86_64.rpm                                                                                                | 123 kB     00:00
(2/2): lm_sensors-libs-3.1.1-17.el6.x86_64.rpm                                                                                           |  38 kB     00:00
----------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                           732 kB/s | 161 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : lm_sensors-libs-3.1.1-17.el6.x86_64                                                                                                          1/2
  Installing : lm_sensors-3.1.1-17.el6.x86_64                                                                                                               2/2
  Verifying  : lm_sensors-libs-3.1.1-17.el6.x86_64                                                                                                          1/2
  Verifying  : lm_sensors-3.1.1-17.el6.x86_64                                                                                                               2/2

Installed:
  lm_sensors.x86_64 0:3.1.1-17.el6

Dependency Installed:
  lm_sensors-libs.x86_64 0:3.1.1-17.el6

Complete!

How to configure lm_sensors

Type the following command and say YES to all prompts:
Code:
root@myvps1 [~]# sudo sensors-detect
My output is

Code:
root@myvps1 [~]# sudo sensors-detect
# sensors-detect revision 1.1
# System: Microsoft Corporation Virtual Machine

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): YES
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 11h thermal sensors...                           No
Intel digital thermal sensor...                             No
Intel AMB FB-DIMM thermal sensor...                         No
VIA C7 thermal and voltage sensors...                       No

Some Super I/O chips contain embedded sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no): YES
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Nuvoton/Fintek'...               No
Trying family `ITE'...                                      No
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Nuvoton/Fintek'...               No
Trying family `ITE'...                                      No

Some systems (mainly servers) implement IPMI, a set of common interfaces
through which system health data may be retrieved, amongst other things.
We first try to get the information from SMBIOS. If we don't find it
there, we have to read from arbitrary I/O ports to probe for such
interfaces. This is normally safe. Do you want to scan for IPMI
interfaces? (YES/no): YES
Probing for `IPMI BMC KCS' at 0xca0...                      No
Probing for `IPMI BMC SMIC' at 0xca8...                     No

Some hardware monitoring chips are accessible through the ISA I/O ports.
We have to write to arbitrary I/O ports to probe them. This is usually
safe though. Yes, you do have ISA I/O ports even if you do not have any
ISA slots! Do you want to scan the ISA I/O ports? (YES/no): YES
Probing for `National Semiconductor LM78' at 0x290...       No
Probing for `National Semiconductor LM79' at 0x290...       No
Probing for `Winbond W83781D' at 0x290...                   No
Probing for `Winbond W83782D' at 0x290...                   No

Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): YES
Using driver `i2c-piix4' for device 0000:00:07.3: Intel 82371AB PIIX4 ACPI
Module i2c-piix4 loaded successfully.
Module i2c-dev loaded successfully.

Sorry, no sensors were detected.
Either your system has no sensors, or they are not supported, or
they are connected to an I2C or SMBus adapter that is not
supported. If you find out what chips are on your board, check
http://www.lm-sensors.org/wiki/Devices for driver status.

How to get CPU temperature information on CentOS/RHEL Linux

Type the following command:
Code:
root@myvps1 [~]# sensors
You can get the output like these

Code:
coretemp-isa-0000
Adapter: ISA adapter
Core 0:       +46.0°C  (high = +98.0°C, crit = +98.0°C)
Core 1:       +46.0°C  (high = +98.0°C, crit = +98.0°C)
Core 2:       +46.0°C  (high = +98.0°C, crit = +98.0°C)
Core 3:       +45.0°C  (high = +98.0°C, crit = +98.0°C)
Hope it helps!
 

forumside

New member
Registered
Joined
Aug 27, 2016
Messages
1
Points
0
You can use smart for smart enabled disks by using this command:
smartctl -A /dev/hda | grep Temperature_Celsius
 

LJSHost

Well-known member
Hosting Provider
Registered
Joined
Jul 5, 2016
Messages
1,031
Points
63
Great post Moose

Just to add:

watch -n 3 sensors|grep Core”

This will update the output in real time :D
 
Latest Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top