Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: how to check temperature on ubuntu server

  1. #1
    Join Date
    Jul 2021
    Beans
    2

    how to check temperature on ubuntu server

    Hi,

    I want to check my system temperature on my ubuntu server.
    If I google, I read a lot about installing lm-sensors and things like that.
    To be honest; I do not want to install anything at this moment; whenever I log in with SSH to my server, it gives me the temperature already.
    So my main question is: where is this information comming from and how do I obtain that information without installing anything else?

    See screenshot.
    temp.png

    Thanks for the help!

  2. #2
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    3,026
    Distro
    Ubuntu Development Release

    Re: how to check temperature on ubuntu server

    For the restrictions of not wanting to install anything else, then:

    Step 1: Determine what devices there are:
    Code:
    doug@s19:~$ grep . /sys/devices/virtual/thermal/thermal_zone*/type
    /sys/devices/virtual/thermal/thermal_zone0/type:acpitz
    /sys/devices/virtual/thermal/thermal_zone1/type:x86_pkg_temp
    Step 2: List the temperatures of those devices:
    Code:
    doug@s19:~$ grep . /sys/devices/virtual/thermal/thermal_zone*/temp
    /sys/devices/virtual/thermal/thermal_zone0/temp:27800
    /sys/devices/virtual/thermal/thermal_zone1/temp:36000
    Noting that the values are in units of millidegrees C. So my processor package temperature is currently 36 degrees C and my acpitz-acpi-0, ACPI interface, is 27.8 degrees.

    Now, apply some CPU load and read again:
    Code:
    doug@s19:~$ grep . /sys/devices/virtual/thermal/thermal_zone*/temp
    /sys/devices/virtual/thermal/thermal_zone0/temp:27800
    /sys/devices/virtual/thermal/thermal_zone1/temp:68000
    And observe the processor has gone up to 68 degrees (it is water cooled, it'll take awhile to go higher. The power has gone from 1.4 to 130 watts and will throttle to 125 watts shortly.)

    EDIT: Supporting data, using turbostat (an installed utility via linux-tools-common (I think)):
    Code:
    doug@s19:~$ sudo turbostat --Summary --quiet --show Busy%,Bzy_MHz,IRQ,PkgWatt,PkgTmp,RAMWatt,GFXWatt --interval 6
    Busy%   Bzy_MHz IRQ     PkgTmp  PkgWatt GFXWatt RAMWatt
    0.01    2438    262     39      1.39    0.00    0.89
    0.01    1301    114     39      1.38    0.00    0.89
    0.01    908     117     39      1.37    0.00    0.89
    5.38    4478    1243    66      8.16    0.00    0.89
    98.67   4530    18091   69      129.24  0.00    0.89  <<< 1st level power throttle
    98.67   4527    18085   70      129.05  0.00    0.89
    98.68   4527    18075   72      129.02  0.00    0.89
    98.68   4523    18075   72      128.84  0.00    0.89
    99.01   4496    18092   72      127.09  0.00    0.89
    99.68   4490    18078   72      124.93  0.00    0.89 <<< 2nd level power throttle
    Note temperatures are higher, because this was done later, and the coolant was already warmer to start with.
    Last edited by Doug S; July 1st, 2021 at 04:20 PM.
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  3. #3
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: how to check temperature on ubuntu server

    Put a thermometer inside the case?

    Sensors are drivers specific to the different chips. If they were automatically installed, great. Now you just need a program to display those - which you'll likely need to install.
    Some chips don't have drivers that work with the included sensors, so those drivers are necessary. For example AMD Ryzen CPUs and the north bridge often don't provide data without extra modules loaded.

    As for how any information is displayed at login, you can trace back through the different login files until you locate which value is actually being displayed.

    For example, AMD CPUs provide 1 temperature, but Intel CPUs provide a different temperature per core.
    There are temperature sensors in different chips on the motherboard, inside the GPU, and near fans. Most HDDs and SSDs also have temperatures. Accessing this information requires different drivers to make the information available, then a program or 2 or 5 to display the data.

    Why are you afraid to install a program that displays data? That's all a computer really does, right?

  4. #4
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: how to check temperature on ubuntu server

    Thread moved to Server Platforms.

  5. #5
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: how to check temperature on ubuntu server

    Quote Originally Posted by Doug S View Post
    For the restrictions of not wanting to install anything else, then:

    Step 1: Determine what devices there are:
    ...
    This where mine fails... It has no extra's installed (although I have in the past for other boxes for Conky to use):
    Code:
    mafoelffen@Opti-Ubuntu-Main:~/Scripts$ ls /sys/devices/virtual/thermal/
    cooling_device0   cooling_device12  cooling_device2  cooling_device6
    cooling_device1   cooling_device13  cooling_device3  cooling_device7
    cooling_device10  cooling_device14  cooling_device4  cooling_device8
    cooling_device11  cooling_device15  cooling_device5  cooling_device9
    Which is one per CPU core, but type on them shows Processor, and it's ahs no temp values to it shown there...

    But my "mtod" banner on the host does not show the temp... Maybe because either it's not had additional installed, a different processor and/or server board(?)

    EDIT : Yes. The CPU model changes that. "Doug S' is using Intel CPU... For the AMD, there is no "Temp" found anywhere recursively below /sys/devices/virtual/thermal/...
    Last edited by MAFoElffen; July 2nd, 2021 at 02:57 AM.

    Concurrent coexistance of Windows, Linux and UNIX...
    Ubuntu user # 33563, Linux user # 533637
    Sticky: [all variants] Graphics Resolution- Upgrade /Blank Screen after reboot
    UbuntuForums system-info Script

  6. #6
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: how to check temperature on ubuntu server

    Some observations:
    • Intel is better supported than AMD.
    • Some AMD support of newer chipsets/MBs has been "coming" for 2 yrs. It hasn't arrived for many. Slight differences in the MB names drastically changes sensors support.
    • Higher end CPUs and MBs get better support.
    • Some chipsets don't ever get supported. It takes someone with C programming skills to have "an itch" to scratch to get anything working. Getting that stuff included in the kernel is much harder and some people just don't want to spend the effort.


    The OP will need to do a little research for the exact CPU and exact MB to determine what is easy and what is hard to get working.

    I think
    Code:
    $ inxi -CM
    provides the needed hardware information in a compact way, at least for the CPU, motherboard, BIOS version and date.
    From that, searching for sensor support linux for the exact motherboard might find instructions. Maybe "it just works", if lucky.

    I haven't been lucky with MBs.

    But with HDDs,
    Code:
    $ sudo /usr/sbin/hddtemp /dev/sd[a-z]
    /dev/sda: WD easystore 25FB: S.M.A.R.T. not available
    /dev/sdb: WD easystore 25FB: S.M.A.R.T. not available
    /dev/sdc: HGST HMS5C4040ALE640: 37°C
    /dev/sdd: ST3320620AS: 42°C
    /dev/sde: HGST HUS726T4TALA6L4: 40°C
    /dev/sdf: WDC WD40EFRX-68WT0N0: 39°C
    /dev/sdg: HGST HMS5C4040ALE640: 42°C
    And for a different system, the WD-Black 1TB runs hot:
    Code:
    $ sudo /usr/sbin/hddtemp /dev/sd[a-z]
    /dev/sda: PluagablUSB3-SATA-U3:  drive supported, but it doesn't have a temperature sensor.
    /dev/sdb: WD My Book 1140: S.M.A.R.T. not available
    /dev/sdc: WDC WD1001FALS-00J7B0: 46°C
    /dev/sdd: TOSHIBA DT01ACA200: 34°C
    /dev/sde: Hitachi HUA723020ALA641: 37°C
    /dev/sdf: WDC WD20EFRX-68AX9N0: 34°C
    /dev/sdg: WDC WD20EFRX-68AX9N0: 32°C
    SSDs run a little hotter:
    Code:
    $ sudo /usr/sbin/hddtemp /dev/sd[a-z]
    /dev/sda: Hitachi HDP725050GLA360: 44°C
    /dev/sdb: Micron_1100_MTFDDAV512TB N              �@: 51°C
    I find this a little concerning:
    Code:
    /dev/sda: Samsung SSD 860 EVO 500G B              �@:  no sensor
    I feel pretty lucky to get that drive temperature data so easily.

  7. #7
    Join Date
    Mar 2010
    Location
    USA
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: how to check temperature on ubuntu server

    LOL. Same for mine:
    Code:
    mafoelffen@Opti-Ubuntu-Main:~$ sudo /usr/sbin/hddtemp /dev/sd[a-z]
    /dev/sda: WDC WD40EZAZ-00SF3B0: 34°C
    WARNING: Drive /dev/sdb doesn't seem to have a temperature sensor.
    WARNING: This doesn't mean it hasn't got one.
    WARNING: If you are sure it has one, please contact me (hddtemp@guzu.net).
    WARNING: See --help, --debug and --drivebase options.
    /dev/sdb: Samsung SSD 870 EVO 500G B              �@:  no sensor
    /dev/sdc: ST5000DM000-1FK178: 36°C
    /dev/sdd: WDC WD40EZRZ-22GXCB0: 35°C
    /dev/sde: WDC WD40EZAZ-00SF3B0: 34°C

    Concurrent coexistance of Windows, Linux and UNIX...
    Ubuntu user # 33563, Linux user # 533637
    Sticky: [all variants] Graphics Resolution- Upgrade /Blank Screen after reboot
    UbuntuForums system-info Script

  8. #8
    Join Date
    Feb 2011
    Location
    Coquitlam, B.C. Canada
    Beans
    3,026
    Distro
    Ubuntu Development Release

    Re: how to check temperature on ubuntu server

    Quote Originally Posted by MAFoElffen View Post
    This where mine fails... It has no extra's installed (although I have in the past for other boxes for Conky to use):
    Code:
    mafoelffen@Opti-Ubuntu-Main:~/Scripts$ ls /sys/devices/virtual/thermal/
    cooling_device0   cooling_device12  cooling_device2  cooling_device6
    cooling_device1   cooling_device13  cooling_device3  cooling_device7
    cooling_device10  cooling_device14  cooling_device4  cooling_device8
    cooling_device11  cooling_device15  cooling_device5  cooling_device9
    Which is one per CPU core, but type on them shows Processor, and it's ahs no temp values to it shown there...

    But my "mtod" banner on the host does not show the temp... Maybe because either it's not had additional installed, a different processor and/or server board(?)

    EDIT : Yes. The CPU model changes that. "Doug S' is using Intel CPU... For the AMD, there is no "Temp" found anywhere recursively below /sys/devices/virtual/thermal/...
    Interesting, no default thermal zones at all, and only processor cooling types. Here's mine:

    Code:
    doug@s19:~/idle/teo/pipe-test/powersave$ grep . /sys/devices/virtual/thermal/*/type
    /sys/devices/virtual/thermal/cooling_device0/type:Fan
    /sys/devices/virtual/thermal/cooling_device10/type:Processor
    /sys/devices/virtual/thermal/cooling_device11/type:Processor
    /sys/devices/virtual/thermal/cooling_device12/type:Processor
    /sys/devices/virtual/thermal/cooling_device13/type:Processor
    /sys/devices/virtual/thermal/cooling_device14/type:Processor
    /sys/devices/virtual/thermal/cooling_device15/type:Processor
    /sys/devices/virtual/thermal/cooling_device16/type:Processor
    /sys/devices/virtual/thermal/cooling_device17/type:intel_powerclamp
    /sys/devices/virtual/thermal/cooling_device18/type:TCC Offset
    /sys/devices/virtual/thermal/cooling_device1/type:Fan
    /sys/devices/virtual/thermal/cooling_device2/type:Fan
    /sys/devices/virtual/thermal/cooling_device3/type:Fan
    /sys/devices/virtual/thermal/cooling_device4/type:Fan
    /sys/devices/virtual/thermal/cooling_device5/type:Processor
    /sys/devices/virtual/thermal/cooling_device6/type:Processor
    /sys/devices/virtual/thermal/cooling_device7/type:Processor
    /sys/devices/virtual/thermal/cooling_device8/type:Processor
    /sys/devices/virtual/thermal/cooling_device9/type:Processor
    /sys/devices/virtual/thermal/thermal_zone0/type:acpitz
    /sys/devices/virtual/thermal/thermal_zone1/type:x86_pkg_temp
    As a side note, I find the cooling/thermal file structure in linux extremely confusing and difficult to follow.

    And yes, my processor is: Intel(R) Core(TM) i5-10600K CPU @ 4.10GHz

    I don't seem to have the hddtemp command installed (server):

    Code:
    $ sudo /usr/sbin/hddtemp /dev/sd[a-z]
    sudo: /usr/sbin/hddtemp: command not found
    Any follow-up information on your issue would be appreciated. Please have the courtesy to report back.

  9. #9
    Join Date
    Jul 2021
    Beans
    2

    Re: how to check temperature on ubuntu server

    Hi all,

    Thank you so much for the information, I will try some of the suggestions!

    To be clear: of course I can install additional drivers and/or applications. But I was wondering why the temperature states in my screen when I connect by SSH, so my thoughs were that I should be able to obtain that information, without installing software...
    But with the suggested answers, I will set this threat as solved; If those options do not work for me, I will install some software, or maybe I will skip the check on temperature; I was just curious, no really need for knowing (or monitoring) the temperature.

    [edit]
    The suggestions of Doug S worked quite well! Thanks!!
    Last edited by s-grind; July 2nd, 2021 at 10:26 PM.

  10. #10
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: how to check temperature on ubuntu server

    Code:
    man update-motd
    explains how the messages are updated to be shown at login. Those can be disabled. The systemctl term is "mask". Look in /etc/update-motd.d/ for the scripts.
    I just
    Code:
    chmod -x /etc/update-motd.d/*
    to get silence.

    If you want to be reminded to reboot or that fsck will to be run at the next reboot, don't chmod those scripts.

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •