How do I find the temperatures without 3rd party software?












8















I'm running sensors-detect on my system with lm-sensors because my system keep shutting down when I watch youtube videos



So I'm wondering how can I find the temperatures of the fan and cpu manually without a 3rd party software like lm-sensors? I'm just not sure where they're stored.



processor   : 0
vendor_id : AuthenticAMD
cpu family : 16
model : 6
model name : AMD Athlon(tm) II X2 240e Processor
power management: ts ttp tm stc 100mhzsteps hwpstate


x86_64










share|improve this question

























  • What version of Ubuntu are you running?

    – wjandrea
    Jul 24 '18 at 21:50






  • 1





    It depends on your processor. For many recent Intel processors the turbostat program will read the MSRs (Machine Specific Registers) and display the package and core temperatures. Edit your question and add your processor make an model. If it is one that I know, I'll answer with how to do it manually.

    – Doug Smythies
    Jul 24 '18 at 21:50













  • would the additional RAM i added have a problem.., RAM is 1333 megatransfers per second, and cpu is max MHz: 2800.0000

    – hello moto
    Jul 24 '18 at 22:14











  • I do not know the specific MSRs for that processor. Suggest to try turbostat, just to know if it knows about it. If you want, I can write an answer with how I do it manually for Intel processors.

    – Doug Smythies
    Jul 24 '18 at 22:15






  • 11





    What do you mean by third-party? How much of Ubuntu do you think is first-party software?

    – muru
    Jul 25 '18 at 0:13
















8















I'm running sensors-detect on my system with lm-sensors because my system keep shutting down when I watch youtube videos



So I'm wondering how can I find the temperatures of the fan and cpu manually without a 3rd party software like lm-sensors? I'm just not sure where they're stored.



processor   : 0
vendor_id : AuthenticAMD
cpu family : 16
model : 6
model name : AMD Athlon(tm) II X2 240e Processor
power management: ts ttp tm stc 100mhzsteps hwpstate


x86_64










share|improve this question

























  • What version of Ubuntu are you running?

    – wjandrea
    Jul 24 '18 at 21:50






  • 1





    It depends on your processor. For many recent Intel processors the turbostat program will read the MSRs (Machine Specific Registers) and display the package and core temperatures. Edit your question and add your processor make an model. If it is one that I know, I'll answer with how to do it manually.

    – Doug Smythies
    Jul 24 '18 at 21:50













  • would the additional RAM i added have a problem.., RAM is 1333 megatransfers per second, and cpu is max MHz: 2800.0000

    – hello moto
    Jul 24 '18 at 22:14











  • I do not know the specific MSRs for that processor. Suggest to try turbostat, just to know if it knows about it. If you want, I can write an answer with how I do it manually for Intel processors.

    – Doug Smythies
    Jul 24 '18 at 22:15






  • 11





    What do you mean by third-party? How much of Ubuntu do you think is first-party software?

    – muru
    Jul 25 '18 at 0:13














8












8








8


4






I'm running sensors-detect on my system with lm-sensors because my system keep shutting down when I watch youtube videos



So I'm wondering how can I find the temperatures of the fan and cpu manually without a 3rd party software like lm-sensors? I'm just not sure where they're stored.



processor   : 0
vendor_id : AuthenticAMD
cpu family : 16
model : 6
model name : AMD Athlon(tm) II X2 240e Processor
power management: ts ttp tm stc 100mhzsteps hwpstate


x86_64










share|improve this question
















I'm running sensors-detect on my system with lm-sensors because my system keep shutting down when I watch youtube videos



So I'm wondering how can I find the temperatures of the fan and cpu manually without a 3rd party software like lm-sensors? I'm just not sure where they're stored.



processor   : 0
vendor_id : AuthenticAMD
cpu family : 16
model : 6
model name : AMD Athlon(tm) II X2 240e Processor
power management: ts ttp tm stc 100mhzsteps hwpstate


x86_64







software-recommendation temperature






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jul 24 '18 at 22:10









wjandrea

8,63442260




8,63442260










asked Jul 24 '18 at 21:47









hello motohello moto

4511617




4511617













  • What version of Ubuntu are you running?

    – wjandrea
    Jul 24 '18 at 21:50






  • 1





    It depends on your processor. For many recent Intel processors the turbostat program will read the MSRs (Machine Specific Registers) and display the package and core temperatures. Edit your question and add your processor make an model. If it is one that I know, I'll answer with how to do it manually.

    – Doug Smythies
    Jul 24 '18 at 21:50













  • would the additional RAM i added have a problem.., RAM is 1333 megatransfers per second, and cpu is max MHz: 2800.0000

    – hello moto
    Jul 24 '18 at 22:14











  • I do not know the specific MSRs for that processor. Suggest to try turbostat, just to know if it knows about it. If you want, I can write an answer with how I do it manually for Intel processors.

    – Doug Smythies
    Jul 24 '18 at 22:15






  • 11





    What do you mean by third-party? How much of Ubuntu do you think is first-party software?

    – muru
    Jul 25 '18 at 0:13



















  • What version of Ubuntu are you running?

    – wjandrea
    Jul 24 '18 at 21:50






  • 1





    It depends on your processor. For many recent Intel processors the turbostat program will read the MSRs (Machine Specific Registers) and display the package and core temperatures. Edit your question and add your processor make an model. If it is one that I know, I'll answer with how to do it manually.

    – Doug Smythies
    Jul 24 '18 at 21:50













  • would the additional RAM i added have a problem.., RAM is 1333 megatransfers per second, and cpu is max MHz: 2800.0000

    – hello moto
    Jul 24 '18 at 22:14











  • I do not know the specific MSRs for that processor. Suggest to try turbostat, just to know if it knows about it. If you want, I can write an answer with how I do it manually for Intel processors.

    – Doug Smythies
    Jul 24 '18 at 22:15






  • 11





    What do you mean by third-party? How much of Ubuntu do you think is first-party software?

    – muru
    Jul 25 '18 at 0:13

















What version of Ubuntu are you running?

– wjandrea
Jul 24 '18 at 21:50





What version of Ubuntu are you running?

– wjandrea
Jul 24 '18 at 21:50




1




1





It depends on your processor. For many recent Intel processors the turbostat program will read the MSRs (Machine Specific Registers) and display the package and core temperatures. Edit your question and add your processor make an model. If it is one that I know, I'll answer with how to do it manually.

– Doug Smythies
Jul 24 '18 at 21:50







It depends on your processor. For many recent Intel processors the turbostat program will read the MSRs (Machine Specific Registers) and display the package and core temperatures. Edit your question and add your processor make an model. If it is one that I know, I'll answer with how to do it manually.

– Doug Smythies
Jul 24 '18 at 21:50















would the additional RAM i added have a problem.., RAM is 1333 megatransfers per second, and cpu is max MHz: 2800.0000

– hello moto
Jul 24 '18 at 22:14





would the additional RAM i added have a problem.., RAM is 1333 megatransfers per second, and cpu is max MHz: 2800.0000

– hello moto
Jul 24 '18 at 22:14













I do not know the specific MSRs for that processor. Suggest to try turbostat, just to know if it knows about it. If you want, I can write an answer with how I do it manually for Intel processors.

– Doug Smythies
Jul 24 '18 at 22:15





I do not know the specific MSRs for that processor. Suggest to try turbostat, just to know if it knows about it. If you want, I can write an answer with how I do it manually for Intel processors.

– Doug Smythies
Jul 24 '18 at 22:15




11




11





What do you mean by third-party? How much of Ubuntu do you think is first-party software?

– muru
Jul 25 '18 at 0:13





What do you mean by third-party? How much of Ubuntu do you think is first-party software?

– muru
Jul 25 '18 at 0:13










4 Answers
4






active

oldest

votes


















10














It sounds like what you want is /sys/class/hwmon and /sys/class/thermal.



Both of these provide simple shell based access to the data you want (the hwmon directory will also include other sensor types). Each has one directory for each sensor interface in your system (which may have more than one sensor).



Three other things to note though:




  • Unless you have a really bad system, running the sensors command even once a second shouldn't have any percievable effect. In fact, regularly reading the files in the above mentioned directories may have more of an effect.

  • Graphs are your friend here. I would suggest getting something like netdata or collectd running so you have realtime (or near realtime) data to look at.

  • Check your voltages too. What your describing could also be due to having a power supply that can't keep up with your system's power requirements. This will be indicated by voltages dropping significantly when the system is under high load.






share|improve this answer


























  • This should be the accepted answer, because it deals with the actual question asked: "how can I find the temperatures [...] manually [...]? I'm just not sure where they're stored." Then some /proc/cpuinfo showing an AMD processor. Not sure why OP then accepted an Intel-specific answer which requires another tool to be installed.

    – Aaron F
    Jul 25 '18 at 12:04











  • @AaronF : I don't disagree. I wrote an Intel specific answer because the OP asked me to. No other tool needs to be installed? The reason I read package temperatures directly via MSRs rather than via /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input is that most of my work is with extremely idle systems, and the latter method has a lot more overhead, resulting in a consistent 4 to 5 degrees higher result. Of course, there is no difference for a heavily loaded system.

    – Doug Smythies
    Jul 25 '18 at 12:46








  • 1





    @DougSmythies I thought your answer was very good and complete, which is why I didn't downvote nor leave a negative comment beneath it :-) The rdmsr program is part of msr-tools, which isn't installed by default on my Intel machine (running Ubuntu, maybe other distros install by default if they detect Intel?)

    – Aaron F
    Jul 25 '18 at 15:50











  • @AaronF : I forgot that msr-tools is a needed additional package. So my method also needs and additional tool, which is not what the OP wanted.

    – Doug Smythies
    Jul 25 '18 at 15:52






  • 2





    Hello @ DougSmythies and Aaron F, I had originally chose DougSmythies as the primary answer because he was the first to provide assistance and his answer was very clear on how to search for the Temperature manually as well as using the manual solution into an easy to use program with mdmsr support, It was in fact a hard decesion as both answers were very informative, But since you both agreed that this answer was the best. I reverted the primary answer to Aaron, thank you for your support. Happy hunting

    – hello moto
    Jul 28 '18 at 10:46



















9














This answer is about one way to monitor processor temperature manually for some Intel processors via accessing the Machine Specific Registers (MSR) directly.



The first thing to note is, in this case, what is read out of the MSR is relative to the Tcc, the limit temperature, so an additional calculation is required to determine the actual temperature.



Refer to the Intel® 64 and IA-32 Architectures Software Developer’s Manual, or in your case the AMD equivalent.



In my case, I want bits 22-16 of the MSR at 0x1B1, aka IA32_PACKAGE_THERM_STATUS. The Tcc for my older i7-2600K is 98 degrees.



Here is a simple script to monitor the temperature (and CPU frequency) manually:



#! /bin/dash
#
# temp_mon3 Smythies 2016.10.05
# a simplified version of temp_mon2,
# for monitoring temp.
# Note: it is on purpose that -a is not used.
# Also CPU0 frequency (1 is good enough, when all
# are loaded).
#
# temp_mon2 Smythies 2016.09.29
# Monitor Package temperatures.
# Use clock modulation to control temps.
# i.e. simulate the second to last level
# of defense.
# Use simple primatives.
# run as sudo
# hardcoded for my tcc of 98 degrees.
#
echo ... begin package temperature monitoring ...

#
# In case I forgot (which I often do)

modprobe msr

#
# first let the drastic effect of the sudo command decay
# Done later in temp_mon3.

#
# some stuff

COMMAND="rdmsr --bitfield 22:16 -u 0x1B1"
COMMAND2="cat /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq"

#
# then get on with it

while [ 1 ];do
sleep 4
TEMP_RAW=$(eval $COMMAND)
CPU0_FREQ=$(eval $COMMAND2)
TEMP_ACT=$((98-TEMP_RAW))
echo "$TEMP_ACT $CPU0_FREQ"
done


And here is some sample output, where I add some CPU load after awhile (temp goes from 31 to 73 degrees):



$ sudo ./temp_mon3
[sudo] password for doug:
... begin package temperature monitoring ...
31 1605275
31 1605154
32 1605164
30 1605148
31 1605176
51 3511279
54 3511278
55 3511279
57 3511283
58 3511279
60 3511278
61 3511284
63 3511279
64 3511280
64 3511280
66 3511280
67 3511278
68 3511280
68 3511281
69 3511278
71 3511280
70 3511281
71 3511281
71 3511280
72 3511276
72 3511277
73 3511283
73 3511279
^C





share|improve this answer
























  • Why do you use eval?

    – wjandrea
    Jul 24 '18 at 22:48











  • @Doug: Great answer to use msr! However, isn't the right msr register 0x19c ? And the temperature is TEMP= TCC - [0x19c bits 22:16] . So it is necessary to read the TCC first.

    – abu_bua
    Jul 25 '18 at 0:38











  • @abu_bua : I don't know if 0x19c works or not, but what I am using does. And yes, I hardcoded TCC for my processor rather than the better solution which would be to read it from the processor.

    – Doug Smythies
    Jul 25 '18 at 1:44






  • 1





    did you installed sudo apt install msr-tools?

    – abu_bua
    Jul 25 '18 at 15:39






  • 1





    msr-tools is the package. It would be man rdmsr and man wrmsr for two of the individual commands within the package.

    – Doug Smythies
    Jul 25 '18 at 21:52



















5














I don't know what you really want. The lm-sensor program (and therefore the sensors command) make use of the libsensor library; in case you use Ubuntu 18.04 it is libsensors4, version 3.4.0-4. This is the same library which reads the temperature as can be seen in the sysdirectory.



To sum it up, sensors is a good choice. To watch the temperature continuously use



watch -n 1 sensors


If you want to write a program, you have to take a look at libsensors with man libsensorsor take a look in the /usr/share/doc/. You have to include #include <sensors/sensors.h>. It will use the sensors.conffiles /etc/sensors3.conf and/or /etc/sensors.conf. Further (users) configuration can be found in /etc/sensors.d/, if used.



If you think that you are missing some sensors take a look at the /sys/class/thermal or the linked /sys/devices/virtual/thermal directory.



To get the temperatures of the all thermal zones use



$ cat /sys/devices/virtual/thermal/thermal_zone?/temp

77000
66000
67000


The temperature is measured in miliCelcius (mC), in the case above 77.0, 66.0, 67,0 °C.



To watch continously use



watch -n 1 cat /sys/devices/virtual/thermal/thermal_zone?/temp


In this directory you can also find information about your cooling (fan) devices, and how the PID regulators are programmed.



I would also like to state that some overtemperature protection is coded very hardware based (this is a good idea), where the data is placed in your bios.






share|improve this answer


























  • i know there's programs, but i was looking for a way to manually find th etemps

    – hello moto
    Jul 24 '18 at 21:59






  • 1





    What do you mean by manually? All that things that prints the temperature are programs.

    – abu_bua
    Jul 25 '18 at 18:46











  • i don't have a thermal_zone, all i have are cooling_device0 1 and 2 but they dont hold a file temp, only cur_state device max_state power subsystem type uevent

    – hello moto
    Jul 25 '18 at 21:49











  • cur and max state are 0 and 10

    – hello moto
    Jul 25 '18 at 21:50



















5














Install Psensor (psensor) from the default Ubuntu repositories and configure Psensor to automatically play an alert sound whenever the temperature goes above a user determined maximum. The purpose of this is to let you hear a warning sound before your system shuts down without adding additional application overhead to your system.



Psensor displays itself on the desktop as a little thermometer icon in the notification area in the upper right corner of the desktop next to the clock. You can right-click the thermometer icon at any time to display the hardware temperatures.






share|improve this answer

























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1059170%2fhow-do-i-find-the-temperatures-without-3rd-party-software%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    4 Answers
    4






    active

    oldest

    votes








    4 Answers
    4






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    10














    It sounds like what you want is /sys/class/hwmon and /sys/class/thermal.



    Both of these provide simple shell based access to the data you want (the hwmon directory will also include other sensor types). Each has one directory for each sensor interface in your system (which may have more than one sensor).



    Three other things to note though:




    • Unless you have a really bad system, running the sensors command even once a second shouldn't have any percievable effect. In fact, regularly reading the files in the above mentioned directories may have more of an effect.

    • Graphs are your friend here. I would suggest getting something like netdata or collectd running so you have realtime (or near realtime) data to look at.

    • Check your voltages too. What your describing could also be due to having a power supply that can't keep up with your system's power requirements. This will be indicated by voltages dropping significantly when the system is under high load.






    share|improve this answer


























    • This should be the accepted answer, because it deals with the actual question asked: "how can I find the temperatures [...] manually [...]? I'm just not sure where they're stored." Then some /proc/cpuinfo showing an AMD processor. Not sure why OP then accepted an Intel-specific answer which requires another tool to be installed.

      – Aaron F
      Jul 25 '18 at 12:04











    • @AaronF : I don't disagree. I wrote an Intel specific answer because the OP asked me to. No other tool needs to be installed? The reason I read package temperatures directly via MSRs rather than via /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input is that most of my work is with extremely idle systems, and the latter method has a lot more overhead, resulting in a consistent 4 to 5 degrees higher result. Of course, there is no difference for a heavily loaded system.

      – Doug Smythies
      Jul 25 '18 at 12:46








    • 1





      @DougSmythies I thought your answer was very good and complete, which is why I didn't downvote nor leave a negative comment beneath it :-) The rdmsr program is part of msr-tools, which isn't installed by default on my Intel machine (running Ubuntu, maybe other distros install by default if they detect Intel?)

      – Aaron F
      Jul 25 '18 at 15:50











    • @AaronF : I forgot that msr-tools is a needed additional package. So my method also needs and additional tool, which is not what the OP wanted.

      – Doug Smythies
      Jul 25 '18 at 15:52






    • 2





      Hello @ DougSmythies and Aaron F, I had originally chose DougSmythies as the primary answer because he was the first to provide assistance and his answer was very clear on how to search for the Temperature manually as well as using the manual solution into an easy to use program with mdmsr support, It was in fact a hard decesion as both answers were very informative, But since you both agreed that this answer was the best. I reverted the primary answer to Aaron, thank you for your support. Happy hunting

      – hello moto
      Jul 28 '18 at 10:46
















    10














    It sounds like what you want is /sys/class/hwmon and /sys/class/thermal.



    Both of these provide simple shell based access to the data you want (the hwmon directory will also include other sensor types). Each has one directory for each sensor interface in your system (which may have more than one sensor).



    Three other things to note though:




    • Unless you have a really bad system, running the sensors command even once a second shouldn't have any percievable effect. In fact, regularly reading the files in the above mentioned directories may have more of an effect.

    • Graphs are your friend here. I would suggest getting something like netdata or collectd running so you have realtime (or near realtime) data to look at.

    • Check your voltages too. What your describing could also be due to having a power supply that can't keep up with your system's power requirements. This will be indicated by voltages dropping significantly when the system is under high load.






    share|improve this answer


























    • This should be the accepted answer, because it deals with the actual question asked: "how can I find the temperatures [...] manually [...]? I'm just not sure where they're stored." Then some /proc/cpuinfo showing an AMD processor. Not sure why OP then accepted an Intel-specific answer which requires another tool to be installed.

      – Aaron F
      Jul 25 '18 at 12:04











    • @AaronF : I don't disagree. I wrote an Intel specific answer because the OP asked me to. No other tool needs to be installed? The reason I read package temperatures directly via MSRs rather than via /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input is that most of my work is with extremely idle systems, and the latter method has a lot more overhead, resulting in a consistent 4 to 5 degrees higher result. Of course, there is no difference for a heavily loaded system.

      – Doug Smythies
      Jul 25 '18 at 12:46








    • 1





      @DougSmythies I thought your answer was very good and complete, which is why I didn't downvote nor leave a negative comment beneath it :-) The rdmsr program is part of msr-tools, which isn't installed by default on my Intel machine (running Ubuntu, maybe other distros install by default if they detect Intel?)

      – Aaron F
      Jul 25 '18 at 15:50











    • @AaronF : I forgot that msr-tools is a needed additional package. So my method also needs and additional tool, which is not what the OP wanted.

      – Doug Smythies
      Jul 25 '18 at 15:52






    • 2





      Hello @ DougSmythies and Aaron F, I had originally chose DougSmythies as the primary answer because he was the first to provide assistance and his answer was very clear on how to search for the Temperature manually as well as using the manual solution into an easy to use program with mdmsr support, It was in fact a hard decesion as both answers were very informative, But since you both agreed that this answer was the best. I reverted the primary answer to Aaron, thank you for your support. Happy hunting

      – hello moto
      Jul 28 '18 at 10:46














    10












    10








    10







    It sounds like what you want is /sys/class/hwmon and /sys/class/thermal.



    Both of these provide simple shell based access to the data you want (the hwmon directory will also include other sensor types). Each has one directory for each sensor interface in your system (which may have more than one sensor).



    Three other things to note though:




    • Unless you have a really bad system, running the sensors command even once a second shouldn't have any percievable effect. In fact, regularly reading the files in the above mentioned directories may have more of an effect.

    • Graphs are your friend here. I would suggest getting something like netdata or collectd running so you have realtime (or near realtime) data to look at.

    • Check your voltages too. What your describing could also be due to having a power supply that can't keep up with your system's power requirements. This will be indicated by voltages dropping significantly when the system is under high load.






    share|improve this answer















    It sounds like what you want is /sys/class/hwmon and /sys/class/thermal.



    Both of these provide simple shell based access to the data you want (the hwmon directory will also include other sensor types). Each has one directory for each sensor interface in your system (which may have more than one sensor).



    Three other things to note though:




    • Unless you have a really bad system, running the sensors command even once a second shouldn't have any percievable effect. In fact, regularly reading the files in the above mentioned directories may have more of an effect.

    • Graphs are your friend here. I would suggest getting something like netdata or collectd running so you have realtime (or near realtime) data to look at.

    • Check your voltages too. What your describing could also be due to having a power supply that can't keep up with your system's power requirements. This will be indicated by voltages dropping significantly when the system is under high load.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jul 25 '18 at 17:15

























    answered Jul 25 '18 at 1:42









    Austin HemmelgarnAustin Hemmelgarn

    21215




    21215













    • This should be the accepted answer, because it deals with the actual question asked: "how can I find the temperatures [...] manually [...]? I'm just not sure where they're stored." Then some /proc/cpuinfo showing an AMD processor. Not sure why OP then accepted an Intel-specific answer which requires another tool to be installed.

      – Aaron F
      Jul 25 '18 at 12:04











    • @AaronF : I don't disagree. I wrote an Intel specific answer because the OP asked me to. No other tool needs to be installed? The reason I read package temperatures directly via MSRs rather than via /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input is that most of my work is with extremely idle systems, and the latter method has a lot more overhead, resulting in a consistent 4 to 5 degrees higher result. Of course, there is no difference for a heavily loaded system.

      – Doug Smythies
      Jul 25 '18 at 12:46








    • 1





      @DougSmythies I thought your answer was very good and complete, which is why I didn't downvote nor leave a negative comment beneath it :-) The rdmsr program is part of msr-tools, which isn't installed by default on my Intel machine (running Ubuntu, maybe other distros install by default if they detect Intel?)

      – Aaron F
      Jul 25 '18 at 15:50











    • @AaronF : I forgot that msr-tools is a needed additional package. So my method also needs and additional tool, which is not what the OP wanted.

      – Doug Smythies
      Jul 25 '18 at 15:52






    • 2





      Hello @ DougSmythies and Aaron F, I had originally chose DougSmythies as the primary answer because he was the first to provide assistance and his answer was very clear on how to search for the Temperature manually as well as using the manual solution into an easy to use program with mdmsr support, It was in fact a hard decesion as both answers were very informative, But since you both agreed that this answer was the best. I reverted the primary answer to Aaron, thank you for your support. Happy hunting

      – hello moto
      Jul 28 '18 at 10:46



















    • This should be the accepted answer, because it deals with the actual question asked: "how can I find the temperatures [...] manually [...]? I'm just not sure where they're stored." Then some /proc/cpuinfo showing an AMD processor. Not sure why OP then accepted an Intel-specific answer which requires another tool to be installed.

      – Aaron F
      Jul 25 '18 at 12:04











    • @AaronF : I don't disagree. I wrote an Intel specific answer because the OP asked me to. No other tool needs to be installed? The reason I read package temperatures directly via MSRs rather than via /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input is that most of my work is with extremely idle systems, and the latter method has a lot more overhead, resulting in a consistent 4 to 5 degrees higher result. Of course, there is no difference for a heavily loaded system.

      – Doug Smythies
      Jul 25 '18 at 12:46








    • 1





      @DougSmythies I thought your answer was very good and complete, which is why I didn't downvote nor leave a negative comment beneath it :-) The rdmsr program is part of msr-tools, which isn't installed by default on my Intel machine (running Ubuntu, maybe other distros install by default if they detect Intel?)

      – Aaron F
      Jul 25 '18 at 15:50











    • @AaronF : I forgot that msr-tools is a needed additional package. So my method also needs and additional tool, which is not what the OP wanted.

      – Doug Smythies
      Jul 25 '18 at 15:52






    • 2





      Hello @ DougSmythies and Aaron F, I had originally chose DougSmythies as the primary answer because he was the first to provide assistance and his answer was very clear on how to search for the Temperature manually as well as using the manual solution into an easy to use program with mdmsr support, It was in fact a hard decesion as both answers were very informative, But since you both agreed that this answer was the best. I reverted the primary answer to Aaron, thank you for your support. Happy hunting

      – hello moto
      Jul 28 '18 at 10:46

















    This should be the accepted answer, because it deals with the actual question asked: "how can I find the temperatures [...] manually [...]? I'm just not sure where they're stored." Then some /proc/cpuinfo showing an AMD processor. Not sure why OP then accepted an Intel-specific answer which requires another tool to be installed.

    – Aaron F
    Jul 25 '18 at 12:04





    This should be the accepted answer, because it deals with the actual question asked: "how can I find the temperatures [...] manually [...]? I'm just not sure where they're stored." Then some /proc/cpuinfo showing an AMD processor. Not sure why OP then accepted an Intel-specific answer which requires another tool to be installed.

    – Aaron F
    Jul 25 '18 at 12:04













    @AaronF : I don't disagree. I wrote an Intel specific answer because the OP asked me to. No other tool needs to be installed? The reason I read package temperatures directly via MSRs rather than via /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input is that most of my work is with extremely idle systems, and the latter method has a lot more overhead, resulting in a consistent 4 to 5 degrees higher result. Of course, there is no difference for a heavily loaded system.

    – Doug Smythies
    Jul 25 '18 at 12:46







    @AaronF : I don't disagree. I wrote an Intel specific answer because the OP asked me to. No other tool needs to be installed? The reason I read package temperatures directly via MSRs rather than via /sys/devices/platform/coretemp.0/hwmon/hwmon2/temp1_input is that most of my work is with extremely idle systems, and the latter method has a lot more overhead, resulting in a consistent 4 to 5 degrees higher result. Of course, there is no difference for a heavily loaded system.

    – Doug Smythies
    Jul 25 '18 at 12:46






    1




    1





    @DougSmythies I thought your answer was very good and complete, which is why I didn't downvote nor leave a negative comment beneath it :-) The rdmsr program is part of msr-tools, which isn't installed by default on my Intel machine (running Ubuntu, maybe other distros install by default if they detect Intel?)

    – Aaron F
    Jul 25 '18 at 15:50





    @DougSmythies I thought your answer was very good and complete, which is why I didn't downvote nor leave a negative comment beneath it :-) The rdmsr program is part of msr-tools, which isn't installed by default on my Intel machine (running Ubuntu, maybe other distros install by default if they detect Intel?)

    – Aaron F
    Jul 25 '18 at 15:50













    @AaronF : I forgot that msr-tools is a needed additional package. So my method also needs and additional tool, which is not what the OP wanted.

    – Doug Smythies
    Jul 25 '18 at 15:52





    @AaronF : I forgot that msr-tools is a needed additional package. So my method also needs and additional tool, which is not what the OP wanted.

    – Doug Smythies
    Jul 25 '18 at 15:52




    2




    2





    Hello @ DougSmythies and Aaron F, I had originally chose DougSmythies as the primary answer because he was the first to provide assistance and his answer was very clear on how to search for the Temperature manually as well as using the manual solution into an easy to use program with mdmsr support, It was in fact a hard decesion as both answers were very informative, But since you both agreed that this answer was the best. I reverted the primary answer to Aaron, thank you for your support. Happy hunting

    – hello moto
    Jul 28 '18 at 10:46





    Hello @ DougSmythies and Aaron F, I had originally chose DougSmythies as the primary answer because he was the first to provide assistance and his answer was very clear on how to search for the Temperature manually as well as using the manual solution into an easy to use program with mdmsr support, It was in fact a hard decesion as both answers were very informative, But since you both agreed that this answer was the best. I reverted the primary answer to Aaron, thank you for your support. Happy hunting

    – hello moto
    Jul 28 '18 at 10:46













    9














    This answer is about one way to monitor processor temperature manually for some Intel processors via accessing the Machine Specific Registers (MSR) directly.



    The first thing to note is, in this case, what is read out of the MSR is relative to the Tcc, the limit temperature, so an additional calculation is required to determine the actual temperature.



    Refer to the Intel® 64 and IA-32 Architectures Software Developer’s Manual, or in your case the AMD equivalent.



    In my case, I want bits 22-16 of the MSR at 0x1B1, aka IA32_PACKAGE_THERM_STATUS. The Tcc for my older i7-2600K is 98 degrees.



    Here is a simple script to monitor the temperature (and CPU frequency) manually:



    #! /bin/dash
    #
    # temp_mon3 Smythies 2016.10.05
    # a simplified version of temp_mon2,
    # for monitoring temp.
    # Note: it is on purpose that -a is not used.
    # Also CPU0 frequency (1 is good enough, when all
    # are loaded).
    #
    # temp_mon2 Smythies 2016.09.29
    # Monitor Package temperatures.
    # Use clock modulation to control temps.
    # i.e. simulate the second to last level
    # of defense.
    # Use simple primatives.
    # run as sudo
    # hardcoded for my tcc of 98 degrees.
    #
    echo ... begin package temperature monitoring ...

    #
    # In case I forgot (which I often do)

    modprobe msr

    #
    # first let the drastic effect of the sudo command decay
    # Done later in temp_mon3.

    #
    # some stuff

    COMMAND="rdmsr --bitfield 22:16 -u 0x1B1"
    COMMAND2="cat /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq"

    #
    # then get on with it

    while [ 1 ];do
    sleep 4
    TEMP_RAW=$(eval $COMMAND)
    CPU0_FREQ=$(eval $COMMAND2)
    TEMP_ACT=$((98-TEMP_RAW))
    echo "$TEMP_ACT $CPU0_FREQ"
    done


    And here is some sample output, where I add some CPU load after awhile (temp goes from 31 to 73 degrees):



    $ sudo ./temp_mon3
    [sudo] password for doug:
    ... begin package temperature monitoring ...
    31 1605275
    31 1605154
    32 1605164
    30 1605148
    31 1605176
    51 3511279
    54 3511278
    55 3511279
    57 3511283
    58 3511279
    60 3511278
    61 3511284
    63 3511279
    64 3511280
    64 3511280
    66 3511280
    67 3511278
    68 3511280
    68 3511281
    69 3511278
    71 3511280
    70 3511281
    71 3511281
    71 3511280
    72 3511276
    72 3511277
    73 3511283
    73 3511279
    ^C





    share|improve this answer
























    • Why do you use eval?

      – wjandrea
      Jul 24 '18 at 22:48











    • @Doug: Great answer to use msr! However, isn't the right msr register 0x19c ? And the temperature is TEMP= TCC - [0x19c bits 22:16] . So it is necessary to read the TCC first.

      – abu_bua
      Jul 25 '18 at 0:38











    • @abu_bua : I don't know if 0x19c works or not, but what I am using does. And yes, I hardcoded TCC for my processor rather than the better solution which would be to read it from the processor.

      – Doug Smythies
      Jul 25 '18 at 1:44






    • 1





      did you installed sudo apt install msr-tools?

      – abu_bua
      Jul 25 '18 at 15:39






    • 1





      msr-tools is the package. It would be man rdmsr and man wrmsr for two of the individual commands within the package.

      – Doug Smythies
      Jul 25 '18 at 21:52
















    9














    This answer is about one way to monitor processor temperature manually for some Intel processors via accessing the Machine Specific Registers (MSR) directly.



    The first thing to note is, in this case, what is read out of the MSR is relative to the Tcc, the limit temperature, so an additional calculation is required to determine the actual temperature.



    Refer to the Intel® 64 and IA-32 Architectures Software Developer’s Manual, or in your case the AMD equivalent.



    In my case, I want bits 22-16 of the MSR at 0x1B1, aka IA32_PACKAGE_THERM_STATUS. The Tcc for my older i7-2600K is 98 degrees.



    Here is a simple script to monitor the temperature (and CPU frequency) manually:



    #! /bin/dash
    #
    # temp_mon3 Smythies 2016.10.05
    # a simplified version of temp_mon2,
    # for monitoring temp.
    # Note: it is on purpose that -a is not used.
    # Also CPU0 frequency (1 is good enough, when all
    # are loaded).
    #
    # temp_mon2 Smythies 2016.09.29
    # Monitor Package temperatures.
    # Use clock modulation to control temps.
    # i.e. simulate the second to last level
    # of defense.
    # Use simple primatives.
    # run as sudo
    # hardcoded for my tcc of 98 degrees.
    #
    echo ... begin package temperature monitoring ...

    #
    # In case I forgot (which I often do)

    modprobe msr

    #
    # first let the drastic effect of the sudo command decay
    # Done later in temp_mon3.

    #
    # some stuff

    COMMAND="rdmsr --bitfield 22:16 -u 0x1B1"
    COMMAND2="cat /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq"

    #
    # then get on with it

    while [ 1 ];do
    sleep 4
    TEMP_RAW=$(eval $COMMAND)
    CPU0_FREQ=$(eval $COMMAND2)
    TEMP_ACT=$((98-TEMP_RAW))
    echo "$TEMP_ACT $CPU0_FREQ"
    done


    And here is some sample output, where I add some CPU load after awhile (temp goes from 31 to 73 degrees):



    $ sudo ./temp_mon3
    [sudo] password for doug:
    ... begin package temperature monitoring ...
    31 1605275
    31 1605154
    32 1605164
    30 1605148
    31 1605176
    51 3511279
    54 3511278
    55 3511279
    57 3511283
    58 3511279
    60 3511278
    61 3511284
    63 3511279
    64 3511280
    64 3511280
    66 3511280
    67 3511278
    68 3511280
    68 3511281
    69 3511278
    71 3511280
    70 3511281
    71 3511281
    71 3511280
    72 3511276
    72 3511277
    73 3511283
    73 3511279
    ^C





    share|improve this answer
























    • Why do you use eval?

      – wjandrea
      Jul 24 '18 at 22:48











    • @Doug: Great answer to use msr! However, isn't the right msr register 0x19c ? And the temperature is TEMP= TCC - [0x19c bits 22:16] . So it is necessary to read the TCC first.

      – abu_bua
      Jul 25 '18 at 0:38











    • @abu_bua : I don't know if 0x19c works or not, but what I am using does. And yes, I hardcoded TCC for my processor rather than the better solution which would be to read it from the processor.

      – Doug Smythies
      Jul 25 '18 at 1:44






    • 1





      did you installed sudo apt install msr-tools?

      – abu_bua
      Jul 25 '18 at 15:39






    • 1





      msr-tools is the package. It would be man rdmsr and man wrmsr for two of the individual commands within the package.

      – Doug Smythies
      Jul 25 '18 at 21:52














    9












    9








    9







    This answer is about one way to monitor processor temperature manually for some Intel processors via accessing the Machine Specific Registers (MSR) directly.



    The first thing to note is, in this case, what is read out of the MSR is relative to the Tcc, the limit temperature, so an additional calculation is required to determine the actual temperature.



    Refer to the Intel® 64 and IA-32 Architectures Software Developer’s Manual, or in your case the AMD equivalent.



    In my case, I want bits 22-16 of the MSR at 0x1B1, aka IA32_PACKAGE_THERM_STATUS. The Tcc for my older i7-2600K is 98 degrees.



    Here is a simple script to monitor the temperature (and CPU frequency) manually:



    #! /bin/dash
    #
    # temp_mon3 Smythies 2016.10.05
    # a simplified version of temp_mon2,
    # for monitoring temp.
    # Note: it is on purpose that -a is not used.
    # Also CPU0 frequency (1 is good enough, when all
    # are loaded).
    #
    # temp_mon2 Smythies 2016.09.29
    # Monitor Package temperatures.
    # Use clock modulation to control temps.
    # i.e. simulate the second to last level
    # of defense.
    # Use simple primatives.
    # run as sudo
    # hardcoded for my tcc of 98 degrees.
    #
    echo ... begin package temperature monitoring ...

    #
    # In case I forgot (which I often do)

    modprobe msr

    #
    # first let the drastic effect of the sudo command decay
    # Done later in temp_mon3.

    #
    # some stuff

    COMMAND="rdmsr --bitfield 22:16 -u 0x1B1"
    COMMAND2="cat /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq"

    #
    # then get on with it

    while [ 1 ];do
    sleep 4
    TEMP_RAW=$(eval $COMMAND)
    CPU0_FREQ=$(eval $COMMAND2)
    TEMP_ACT=$((98-TEMP_RAW))
    echo "$TEMP_ACT $CPU0_FREQ"
    done


    And here is some sample output, where I add some CPU load after awhile (temp goes from 31 to 73 degrees):



    $ sudo ./temp_mon3
    [sudo] password for doug:
    ... begin package temperature monitoring ...
    31 1605275
    31 1605154
    32 1605164
    30 1605148
    31 1605176
    51 3511279
    54 3511278
    55 3511279
    57 3511283
    58 3511279
    60 3511278
    61 3511284
    63 3511279
    64 3511280
    64 3511280
    66 3511280
    67 3511278
    68 3511280
    68 3511281
    69 3511278
    71 3511280
    70 3511281
    71 3511281
    71 3511280
    72 3511276
    72 3511277
    73 3511283
    73 3511279
    ^C





    share|improve this answer













    This answer is about one way to monitor processor temperature manually for some Intel processors via accessing the Machine Specific Registers (MSR) directly.



    The first thing to note is, in this case, what is read out of the MSR is relative to the Tcc, the limit temperature, so an additional calculation is required to determine the actual temperature.



    Refer to the Intel® 64 and IA-32 Architectures Software Developer’s Manual, or in your case the AMD equivalent.



    In my case, I want bits 22-16 of the MSR at 0x1B1, aka IA32_PACKAGE_THERM_STATUS. The Tcc for my older i7-2600K is 98 degrees.



    Here is a simple script to monitor the temperature (and CPU frequency) manually:



    #! /bin/dash
    #
    # temp_mon3 Smythies 2016.10.05
    # a simplified version of temp_mon2,
    # for monitoring temp.
    # Note: it is on purpose that -a is not used.
    # Also CPU0 frequency (1 is good enough, when all
    # are loaded).
    #
    # temp_mon2 Smythies 2016.09.29
    # Monitor Package temperatures.
    # Use clock modulation to control temps.
    # i.e. simulate the second to last level
    # of defense.
    # Use simple primatives.
    # run as sudo
    # hardcoded for my tcc of 98 degrees.
    #
    echo ... begin package temperature monitoring ...

    #
    # In case I forgot (which I often do)

    modprobe msr

    #
    # first let the drastic effect of the sudo command decay
    # Done later in temp_mon3.

    #
    # some stuff

    COMMAND="rdmsr --bitfield 22:16 -u 0x1B1"
    COMMAND2="cat /sys/devices/system/cpu/cpufreq/policy0/scaling_cur_freq"

    #
    # then get on with it

    while [ 1 ];do
    sleep 4
    TEMP_RAW=$(eval $COMMAND)
    CPU0_FREQ=$(eval $COMMAND2)
    TEMP_ACT=$((98-TEMP_RAW))
    echo "$TEMP_ACT $CPU0_FREQ"
    done


    And here is some sample output, where I add some CPU load after awhile (temp goes from 31 to 73 degrees):



    $ sudo ./temp_mon3
    [sudo] password for doug:
    ... begin package temperature monitoring ...
    31 1605275
    31 1605154
    32 1605164
    30 1605148
    31 1605176
    51 3511279
    54 3511278
    55 3511279
    57 3511283
    58 3511279
    60 3511278
    61 3511284
    63 3511279
    64 3511280
    64 3511280
    66 3511280
    67 3511278
    68 3511280
    68 3511281
    69 3511278
    71 3511280
    70 3511281
    71 3511281
    71 3511280
    72 3511276
    72 3511277
    73 3511283
    73 3511279
    ^C






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jul 24 '18 at 22:34









    Doug SmythiesDoug Smythies

    7,19631529




    7,19631529













    • Why do you use eval?

      – wjandrea
      Jul 24 '18 at 22:48











    • @Doug: Great answer to use msr! However, isn't the right msr register 0x19c ? And the temperature is TEMP= TCC - [0x19c bits 22:16] . So it is necessary to read the TCC first.

      – abu_bua
      Jul 25 '18 at 0:38











    • @abu_bua : I don't know if 0x19c works or not, but what I am using does. And yes, I hardcoded TCC for my processor rather than the better solution which would be to read it from the processor.

      – Doug Smythies
      Jul 25 '18 at 1:44






    • 1





      did you installed sudo apt install msr-tools?

      – abu_bua
      Jul 25 '18 at 15:39






    • 1





      msr-tools is the package. It would be man rdmsr and man wrmsr for two of the individual commands within the package.

      – Doug Smythies
      Jul 25 '18 at 21:52



















    • Why do you use eval?

      – wjandrea
      Jul 24 '18 at 22:48











    • @Doug: Great answer to use msr! However, isn't the right msr register 0x19c ? And the temperature is TEMP= TCC - [0x19c bits 22:16] . So it is necessary to read the TCC first.

      – abu_bua
      Jul 25 '18 at 0:38











    • @abu_bua : I don't know if 0x19c works or not, but what I am using does. And yes, I hardcoded TCC for my processor rather than the better solution which would be to read it from the processor.

      – Doug Smythies
      Jul 25 '18 at 1:44






    • 1





      did you installed sudo apt install msr-tools?

      – abu_bua
      Jul 25 '18 at 15:39






    • 1





      msr-tools is the package. It would be man rdmsr and man wrmsr for two of the individual commands within the package.

      – Doug Smythies
      Jul 25 '18 at 21:52

















    Why do you use eval?

    – wjandrea
    Jul 24 '18 at 22:48





    Why do you use eval?

    – wjandrea
    Jul 24 '18 at 22:48













    @Doug: Great answer to use msr! However, isn't the right msr register 0x19c ? And the temperature is TEMP= TCC - [0x19c bits 22:16] . So it is necessary to read the TCC first.

    – abu_bua
    Jul 25 '18 at 0:38





    @Doug: Great answer to use msr! However, isn't the right msr register 0x19c ? And the temperature is TEMP= TCC - [0x19c bits 22:16] . So it is necessary to read the TCC first.

    – abu_bua
    Jul 25 '18 at 0:38













    @abu_bua : I don't know if 0x19c works or not, but what I am using does. And yes, I hardcoded TCC for my processor rather than the better solution which would be to read it from the processor.

    – Doug Smythies
    Jul 25 '18 at 1:44





    @abu_bua : I don't know if 0x19c works or not, but what I am using does. And yes, I hardcoded TCC for my processor rather than the better solution which would be to read it from the processor.

    – Doug Smythies
    Jul 25 '18 at 1:44




    1




    1





    did you installed sudo apt install msr-tools?

    – abu_bua
    Jul 25 '18 at 15:39





    did you installed sudo apt install msr-tools?

    – abu_bua
    Jul 25 '18 at 15:39




    1




    1





    msr-tools is the package. It would be man rdmsr and man wrmsr for two of the individual commands within the package.

    – Doug Smythies
    Jul 25 '18 at 21:52





    msr-tools is the package. It would be man rdmsr and man wrmsr for two of the individual commands within the package.

    – Doug Smythies
    Jul 25 '18 at 21:52











    5














    I don't know what you really want. The lm-sensor program (and therefore the sensors command) make use of the libsensor library; in case you use Ubuntu 18.04 it is libsensors4, version 3.4.0-4. This is the same library which reads the temperature as can be seen in the sysdirectory.



    To sum it up, sensors is a good choice. To watch the temperature continuously use



    watch -n 1 sensors


    If you want to write a program, you have to take a look at libsensors with man libsensorsor take a look in the /usr/share/doc/. You have to include #include <sensors/sensors.h>. It will use the sensors.conffiles /etc/sensors3.conf and/or /etc/sensors.conf. Further (users) configuration can be found in /etc/sensors.d/, if used.



    If you think that you are missing some sensors take a look at the /sys/class/thermal or the linked /sys/devices/virtual/thermal directory.



    To get the temperatures of the all thermal zones use



    $ cat /sys/devices/virtual/thermal/thermal_zone?/temp

    77000
    66000
    67000


    The temperature is measured in miliCelcius (mC), in the case above 77.0, 66.0, 67,0 °C.



    To watch continously use



    watch -n 1 cat /sys/devices/virtual/thermal/thermal_zone?/temp


    In this directory you can also find information about your cooling (fan) devices, and how the PID regulators are programmed.



    I would also like to state that some overtemperature protection is coded very hardware based (this is a good idea), where the data is placed in your bios.






    share|improve this answer


























    • i know there's programs, but i was looking for a way to manually find th etemps

      – hello moto
      Jul 24 '18 at 21:59






    • 1





      What do you mean by manually? All that things that prints the temperature are programs.

      – abu_bua
      Jul 25 '18 at 18:46











    • i don't have a thermal_zone, all i have are cooling_device0 1 and 2 but they dont hold a file temp, only cur_state device max_state power subsystem type uevent

      – hello moto
      Jul 25 '18 at 21:49











    • cur and max state are 0 and 10

      – hello moto
      Jul 25 '18 at 21:50
















    5














    I don't know what you really want. The lm-sensor program (and therefore the sensors command) make use of the libsensor library; in case you use Ubuntu 18.04 it is libsensors4, version 3.4.0-4. This is the same library which reads the temperature as can be seen in the sysdirectory.



    To sum it up, sensors is a good choice. To watch the temperature continuously use



    watch -n 1 sensors


    If you want to write a program, you have to take a look at libsensors with man libsensorsor take a look in the /usr/share/doc/. You have to include #include <sensors/sensors.h>. It will use the sensors.conffiles /etc/sensors3.conf and/or /etc/sensors.conf. Further (users) configuration can be found in /etc/sensors.d/, if used.



    If you think that you are missing some sensors take a look at the /sys/class/thermal or the linked /sys/devices/virtual/thermal directory.



    To get the temperatures of the all thermal zones use



    $ cat /sys/devices/virtual/thermal/thermal_zone?/temp

    77000
    66000
    67000


    The temperature is measured in miliCelcius (mC), in the case above 77.0, 66.0, 67,0 °C.



    To watch continously use



    watch -n 1 cat /sys/devices/virtual/thermal/thermal_zone?/temp


    In this directory you can also find information about your cooling (fan) devices, and how the PID regulators are programmed.



    I would also like to state that some overtemperature protection is coded very hardware based (this is a good idea), where the data is placed in your bios.






    share|improve this answer


























    • i know there's programs, but i was looking for a way to manually find th etemps

      – hello moto
      Jul 24 '18 at 21:59






    • 1





      What do you mean by manually? All that things that prints the temperature are programs.

      – abu_bua
      Jul 25 '18 at 18:46











    • i don't have a thermal_zone, all i have are cooling_device0 1 and 2 but they dont hold a file temp, only cur_state device max_state power subsystem type uevent

      – hello moto
      Jul 25 '18 at 21:49











    • cur and max state are 0 and 10

      – hello moto
      Jul 25 '18 at 21:50














    5












    5








    5







    I don't know what you really want. The lm-sensor program (and therefore the sensors command) make use of the libsensor library; in case you use Ubuntu 18.04 it is libsensors4, version 3.4.0-4. This is the same library which reads the temperature as can be seen in the sysdirectory.



    To sum it up, sensors is a good choice. To watch the temperature continuously use



    watch -n 1 sensors


    If you want to write a program, you have to take a look at libsensors with man libsensorsor take a look in the /usr/share/doc/. You have to include #include <sensors/sensors.h>. It will use the sensors.conffiles /etc/sensors3.conf and/or /etc/sensors.conf. Further (users) configuration can be found in /etc/sensors.d/, if used.



    If you think that you are missing some sensors take a look at the /sys/class/thermal or the linked /sys/devices/virtual/thermal directory.



    To get the temperatures of the all thermal zones use



    $ cat /sys/devices/virtual/thermal/thermal_zone?/temp

    77000
    66000
    67000


    The temperature is measured in miliCelcius (mC), in the case above 77.0, 66.0, 67,0 °C.



    To watch continously use



    watch -n 1 cat /sys/devices/virtual/thermal/thermal_zone?/temp


    In this directory you can also find information about your cooling (fan) devices, and how the PID regulators are programmed.



    I would also like to state that some overtemperature protection is coded very hardware based (this is a good idea), where the data is placed in your bios.






    share|improve this answer















    I don't know what you really want. The lm-sensor program (and therefore the sensors command) make use of the libsensor library; in case you use Ubuntu 18.04 it is libsensors4, version 3.4.0-4. This is the same library which reads the temperature as can be seen in the sysdirectory.



    To sum it up, sensors is a good choice. To watch the temperature continuously use



    watch -n 1 sensors


    If you want to write a program, you have to take a look at libsensors with man libsensorsor take a look in the /usr/share/doc/. You have to include #include <sensors/sensors.h>. It will use the sensors.conffiles /etc/sensors3.conf and/or /etc/sensors.conf. Further (users) configuration can be found in /etc/sensors.d/, if used.



    If you think that you are missing some sensors take a look at the /sys/class/thermal or the linked /sys/devices/virtual/thermal directory.



    To get the temperatures of the all thermal zones use



    $ cat /sys/devices/virtual/thermal/thermal_zone?/temp

    77000
    66000
    67000


    The temperature is measured in miliCelcius (mC), in the case above 77.0, 66.0, 67,0 °C.



    To watch continously use



    watch -n 1 cat /sys/devices/virtual/thermal/thermal_zone?/temp


    In this directory you can also find information about your cooling (fan) devices, and how the PID regulators are programmed.



    I would also like to state that some overtemperature protection is coded very hardware based (this is a good idea), where the data is placed in your bios.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Jul 24 '18 at 23:12

























    answered Jul 24 '18 at 21:58









    abu_buaabu_bua

    3,29681126




    3,29681126













    • i know there's programs, but i was looking for a way to manually find th etemps

      – hello moto
      Jul 24 '18 at 21:59






    • 1





      What do you mean by manually? All that things that prints the temperature are programs.

      – abu_bua
      Jul 25 '18 at 18:46











    • i don't have a thermal_zone, all i have are cooling_device0 1 and 2 but they dont hold a file temp, only cur_state device max_state power subsystem type uevent

      – hello moto
      Jul 25 '18 at 21:49











    • cur and max state are 0 and 10

      – hello moto
      Jul 25 '18 at 21:50



















    • i know there's programs, but i was looking for a way to manually find th etemps

      – hello moto
      Jul 24 '18 at 21:59






    • 1





      What do you mean by manually? All that things that prints the temperature are programs.

      – abu_bua
      Jul 25 '18 at 18:46











    • i don't have a thermal_zone, all i have are cooling_device0 1 and 2 but they dont hold a file temp, only cur_state device max_state power subsystem type uevent

      – hello moto
      Jul 25 '18 at 21:49











    • cur and max state are 0 and 10

      – hello moto
      Jul 25 '18 at 21:50

















    i know there's programs, but i was looking for a way to manually find th etemps

    – hello moto
    Jul 24 '18 at 21:59





    i know there's programs, but i was looking for a way to manually find th etemps

    – hello moto
    Jul 24 '18 at 21:59




    1




    1





    What do you mean by manually? All that things that prints the temperature are programs.

    – abu_bua
    Jul 25 '18 at 18:46





    What do you mean by manually? All that things that prints the temperature are programs.

    – abu_bua
    Jul 25 '18 at 18:46













    i don't have a thermal_zone, all i have are cooling_device0 1 and 2 but they dont hold a file temp, only cur_state device max_state power subsystem type uevent

    – hello moto
    Jul 25 '18 at 21:49





    i don't have a thermal_zone, all i have are cooling_device0 1 and 2 but they dont hold a file temp, only cur_state device max_state power subsystem type uevent

    – hello moto
    Jul 25 '18 at 21:49













    cur and max state are 0 and 10

    – hello moto
    Jul 25 '18 at 21:50





    cur and max state are 0 and 10

    – hello moto
    Jul 25 '18 at 21:50











    5














    Install Psensor (psensor) from the default Ubuntu repositories and configure Psensor to automatically play an alert sound whenever the temperature goes above a user determined maximum. The purpose of this is to let you hear a warning sound before your system shuts down without adding additional application overhead to your system.



    Psensor displays itself on the desktop as a little thermometer icon in the notification area in the upper right corner of the desktop next to the clock. You can right-click the thermometer icon at any time to display the hardware temperatures.






    share|improve this answer






























      5














      Install Psensor (psensor) from the default Ubuntu repositories and configure Psensor to automatically play an alert sound whenever the temperature goes above a user determined maximum. The purpose of this is to let you hear a warning sound before your system shuts down without adding additional application overhead to your system.



      Psensor displays itself on the desktop as a little thermometer icon in the notification area in the upper right corner of the desktop next to the clock. You can right-click the thermometer icon at any time to display the hardware temperatures.






      share|improve this answer




























        5












        5








        5







        Install Psensor (psensor) from the default Ubuntu repositories and configure Psensor to automatically play an alert sound whenever the temperature goes above a user determined maximum. The purpose of this is to let you hear a warning sound before your system shuts down without adding additional application overhead to your system.



        Psensor displays itself on the desktop as a little thermometer icon in the notification area in the upper right corner of the desktop next to the clock. You can right-click the thermometer icon at any time to display the hardware temperatures.






        share|improve this answer















        Install Psensor (psensor) from the default Ubuntu repositories and configure Psensor to automatically play an alert sound whenever the temperature goes above a user determined maximum. The purpose of this is to let you hear a warning sound before your system shuts down without adding additional application overhead to your system.



        Psensor displays itself on the desktop as a little thermometer icon in the notification area in the upper right corner of the desktop next to the clock. You can right-click the thermometer icon at any time to display the hardware temperatures.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 31 mins ago

























        answered Jul 24 '18 at 21:53









        karelkarel

        58.6k13128147




        58.6k13128147






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1059170%2fhow-do-i-find-the-temperatures-without-3rd-party-software%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            GameSpot

            connect to host localhost port 22: Connection refused

            Getting a Wifi WPA2 wifi connection