1

I want to make a shell script that runs as a daemon process and every X minutes read the temperature of every cpu core to report it later with GNU plot. And here is my question, Is there any file in /sys or /proc or any other location which this info be uniformly placed across several UNIX systems (not only in Linux)?

If not, tell me at least, where can I find these files in Linux.

slm
  • 363,520
  • 117
  • 767
  • 871
David Martínez
  • 1,336
  • 2
  • 17
  • 25
  • 1
    See my answer to the duplicate. I cover all this there on this site! – slm Nov 22 '13 at 14:24
  • 1
    @slm The other thread doesn't cover non-Linux systems. – Gilles 'SO- stop being evil' Nov 22 '13 at 23:19
  • @Gilles - OK, I missed that one bit at the end. I'll retag this as not Linux then, that threw me off. I believe the answer is there isn't a unified method across all Linuxes any way. Correct me if I'm wrong. – slm Nov 23 '13 at 01:14
  • To answer your other question about "uniformly across several UNIX systems", there is no single place that exists. When I say Unixes I'm talking about Solaris, AIX, Linux, etc. – slm Nov 23 '13 at 01:16

1 Answers1

1

Looks at this SOa:

It mentions these three links:

They mention that on newer systems you should have all thermal information under:

/sys/class/thermal/thermal_zoneN/temp

where N is a number starting from 0.

On my Xubuntu 13.04, I have two:

thermal_zone0  thermal_zone1

Note that my CPU is quad-core, from cpuid:

Processor name string: AMD Phenom(tm) II N950 Quad-Core Processor

so it's not giving me temp per-core. It might be that it doesn't even have a temp sensor per-core, but I could not find more information about that. This is, however, the only location where this can be read from that I am aware of.

It is, as also mentioned by this answer on the same SOq above:

unlikely to be the same across different computers, Linux distributions, kernel versions, etc. - that is, it's unlikely going to be a one-fit-all solution here. You might need to do it in a few different ways or normalize the results if needed.

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
icyrock.com
  • 573
  • 3
  • 6