Что представляют собой Tcase Max и Tjunction Max

  • Tcase - температура в центре теплораспределительной крышки замеренная внешним датчиком при достижении процессором tjmax по датчикам DTS, указывается в описаниях процессоров на сайте intel. Следует понимать, что эта температура не имеет никакого отношения к показаниям датчиков DTS
  • Tcase Max - является максимальной температурой, измеренной для Tcase. Вы можете найти информацию Tcase и температурную спецификацию на веб-сайте Intel.
  • Tjunction Max - является максимальной температурой, которой могут достичь ядра перед активацией функций тепловой регуляции. Тепловая регуляция происходит, когда температура процессора начинает превышать максимальную. Процессор отключает себя (пропускает такты) для предотвращения повреждений.

Получаяем температуру процессора

Вариант 1. Средствами WMI

Работает только если БИОС и ЦПУ поддерживает такую возможность.

$CPUt = Get-WmiObject MSAcpi_ThermalZoneTemperature -Namespace "root/wmi"
$currentTempKelvin = $CPUt.CurrentTemperature[0] / 10
$currentTempCelsius = $currentTempKelvin - 273.15

$currentTempCelsius



Вариант 2. С помощью библиотеки OpenHardwareMonitorLib.dll

Сайт проекта: openhardwaremonitor.org.

[System.Reflection.Assembly]::LoadFile("c:\\ProgramData\\icinga2\\scripts\\icinga2\\bin\\OpenHardwareMonitorLib.dll") | Out-Null

$PC = New-Object OpenHardwareMonitor.Hardware.Computer
$PC.CPUEnabled = $true
$PC.Open()

ForEach ($hw in $PC.Hardware) {

    If ($hw.HardwareType -eq "CPU") {
        $cpu = $hw
    }
}
Вывод:
```
PS C:\> $cpu


HardwareType              : CPU
HasModelSpecificRegisters : True
HasTimeStampCounter       : True
TimeStampCounterFrequency : 2294,79750401971
SubHardware               : {}
Parent                    :
Sensors                   : {CPU Core #1, CPU Core #2, CPU Total, CPU Core #1...}
Name                      : Intel Celeron G1610T
Identifier                : /intelcpu/0



PS C:\> $cpu.Sensors


Hardware        : OpenHardwareMonitor.Hardware.CPU.IntelCPU
SensorType      : Load
Identifier      : /intelcpu/0/load/1
Name            : CPU Core #1
Index           : 1
IsDefaultHidden : False
Parameters      : {}
Value           : 66,66666
Min             : 66,66666
Max             : 66,66666
Values          : {}
Control         :

Hardware        : OpenHardwareMonitor.Hardware.CPU.IntelCPU
SensorType      : Load
Identifier      : /intelcpu/0/load/2
Name            : CPU Core #2
Index           : 2
IsDefaultHidden : False
Parameters      : {}
Value           : 33,33333
Min             : 33,33333
Max             : 33,33333
Values          : {}
Control         :

Hardware        : OpenHardwareMonitor.Hardware.CPU.IntelCPU
SensorType      : Load
Identifier      : /intelcpu/0/load/0
Name            : CPU Total
Index           : 0
IsDefaultHidden : False
Parameters      : {}
Value           : 50
Min             : 50
Max             : 50
Values          : {}
Control         :

Hardware        : OpenHardwareMonitor.Hardware.CPU.IntelCPU
SensorType      : Temperature
Identifier      : /intelcpu/0/temperature/0
Name            : CPU Core #1
Index           : 0
IsDefaultHidden : False
Parameters      : {TjMax [°C], TSlope [°C]}
Value           : 40
Min             : 40
Max             : 40
Values          : {}
Control         :

Hardware        : OpenHardwareMonitor.Hardware.CPU.IntelCPU
SensorType      : Temperature
Identifier      : /intelcpu/0/temperature/1
Name            : CPU Core #2
Index           : 1
IsDefaultHidden : False
Parameters      : {TjMax [°C], TSlope [°C]}
Value           : 40
Min             : 40
Max             : 40
Values          : {}
Control         :

Hardware        : OpenHardwareMonitor.Hardware.CPU.IntelCPU
SensorType      : Temperature
Identifier      : /intelcpu/0/temperature/2
Name            : CPU Package
Index           : 2
IsDefaultHidden : False
Parameters      : {TjMax [°C], TSlope [°C]}
Value           : 40
Min             : 40
Max             : 40
Values          : {}
Control         :

Hardware        : OpenHardwareMonitor.Hardware.CPU.IntelCPU
SensorType      : Clock
Identifier      : /intelcpu/0/clock/1
Name            : CPU Core #1
Index           : 1
IsDefaultHidden : False
Parameters      : {}
Value           : 2294,798
Min             : 2294,798
Max             : 2294,798
Values          : {}
Control         :

Hardware        : OpenHardwareMonitor.Hardware.CPU.IntelCPU
SensorType      : Clock
Identifier      : /intelcpu/0/clock/2
Name            : CPU Core #2
Index           : 2
IsDefaultHidden : False
Parameters      : {}
Value           : 2294,798
Min             : 2294,798
Max             : 2294,798
Values          : {}
Control         :

Hardware        : OpenHardwareMonitor.Hardware.CPU.IntelCPU
SensorType      : Power
Identifier      : /intelcpu/0/power/0
Name            : CPU Package
Index           : 0
IsDefaultHidden : False
Parameters      : {}
Value           : 6,690379
Min             : 6,690379
Max             : 6,690379
Values          : {}
Control         :

Hardware        : OpenHardwareMonitor.Hardware.CPU.IntelCPU
SensorType      : Power
Identifier      : /intelcpu/0/power/1
Name            : CPU Cores
Index           : 1
IsDefaultHidden : False
Parameters      : {}
Value           : 4,494979
Min             : 4,494979
Max             : 4,494979
Values          : {}
Control         :

Hardware        : OpenHardwareMonitor.Hardware.CPU.IntelCPU
SensorType      : Power
Identifier      : /intelcpu/0/power/2
Name            : CPU Graphics
Index           : 2
IsDefaultHidden : False
Parameters      : {}
Value           : 0
Min             : 0
Max             : 0
Values          : {}
Control         :

Hardware        : OpenHardwareMonitor.Hardware.CPU.IntelCPU
SensorType      : Clock
Identifier      : /intelcpu/0/clock/0
Name            : Bus Speed
Index           : 0
IsDefaultHidden : False
Parameters      : {}
Value           : 99,7738
Min             : 99,7738
Max             : 99,7738
Values          : {}
Control         :

```

Для получения актуальных значений необходимо применять метод Update()

PS C:\> [System.Reflection.Assembly]::LoadFile("C:\\ProgramData\\icinga2\\Scripts\\icinga2\\bi
n\\OpenHardwareMonitorLib.dll") | Out-Null
PS C:\> $PC = New-Object OpenHardwareMonitor.Hardware.Computer
PS C:\> $PC.CPUEnabled = $true
PS C:\> $PC.MainboardEnabled = $true
PS C:\> $PC.Open()
PS C:\> $PC.Hardware[0].SubHardware


HardwareType : SuperIO
Parent       : OpenHardwareMonitor.Hardware.Mainboard.Mainboard
SubHardware  : {}
Sensors      : {Fan Control #1, Fan Control #2, Fan Control #3}
Name         : ITE IT8728F
Identifier   : /lpc/it8728f


# Обновление значений с датчиков
PS C:\> $PC.Hardware[0].SubHardware.Update()
PS C:\> $PC.Hardware[0].SubHardware


HardwareType : SuperIO
Parent       : OpenHardwareMonitor.Hardware.Mainboard.Mainboard
SubHardware  : {}
Sensors      : {Fan Control #1, Fan Control #2, Fan Control #3, Voltage #1...}
Name         : ITE IT8728F
Identifier   : /lpc/it8728f
Полный текст скрипта для Icinga2 (по варианту 2)
```powershell
<#
 .SYNOPSIS
  Скрипт для Icinga 2 - Снятие показаний температурных сенсоров

 .DESCRIPTION


 .PARAMETER TjMax
  Температура TjMax

 .OUTPUTS


 .EXAMPLE
check_cpu_temp.ps1
Intel Celeron G1610T - OK (TjMax = 91)
CPU Core #1 : 36 C
CPU Core #2 : 38 C
CPU Package : 38 C

 | 'CPU Core #1'=36;;91;; 'CPU Core #2'=38;;91;; 'CPU Package'=38;;91;;

 .LINK
  https://webnote.satin-pl.com

 .NOTES
  Version:        0.2
  Author:         Pavel Satin
  Email:          plsatin@yandex.ru
  Creation Date:  18.02.2018
  Purpose/Change: Initial script development

#>
Param(
    [Parameter(Mandatory = $false)]
        [int]$TjMax = 65
    )


#$ErrorActionPreference = "SilentlyContinue"

$returnStateOK = 0
$returnStateWarning = 1
$returnStateCritical = 2
$returnStateUnknown = 3

$returnState = $returnStateWarning

$OverMax = $false
$CoreCount = 0
$output = ""
$returnStateString = "OK"
$outperfdata = " | "


[System.Reflection.Assembly]::LoadFile("c:\\ProgramData\\icinga2\\scripts\\icinga2\\bin\\OpenHardwareMonitorLib.dll") | Out-Null

$PC = New-Object OpenHardwareMonitor.Hardware.Computer
$PC.CPUEnabled = $true
$PC.Open()

ForEach ($hw in $PC.Hardware) {

    If ($hw.HardwareType -eq "CPU") {
        $cpuname = $hw.Name
        ForEach ($sensor in $hw.Sensors) {
            Write-Verbose $sensor

            if ($sensor.SensorType -like "*Temp*") {

                $sensorName = $sensor.Name
                if ($TjMax -eq 65) {
                    $TjMax = $sensor.Parameters[0].Value
                }

                $returnState = $returnStateOK

                if ($sensor.Value) {
                    if ($sensor.Value -gt $TjMax) {
                        $OverMax = $true
                        $returnStateString = "Critical"
                        $returnState = $returnStateCritical
                    }


                    $output += "$sensorName$cpuCountText : " + $sensor.Value + " C`n"
                    $outperfdata += "'$sensorName$cpuCountText'=" + $sensor.Value + ";;$TjMax;; "

                    $CoreCount++

                }
            }

        }

        $cpuCount += 1
        $cpuCountText = "($cpuCount)"

    }

}


Write-Host "$cpuname - $returnStateString (TjMax = $TjMax)"
Write-Host $output
Write-Host $outperfdata
[System.Environment]::Exit($returnState)


```
CPU Critical Temperature
AMD CPU’s
ПроцессорTCase Max
Athlon 64 (Clawhammer)70°C
Athlon 64 (Newcastle)70°C
Athlon 64 (Venice)65°C
Athlon 64 (Sledgehammer)70°C
Athlon 64 (Winchester)65°C
Athlon 64 (San Diego)63°C
Athlon 64 (Orleans)69°C
Athlon 64 (Lima 3500/3800)65°C
Athlon 64 X2 (Manchester)65°C
Athlon 64 X2 (Toledo)65°C
Athlon 64 X2 (Windsor)63°C – 78°C (model dependant)
Athlon 64 X2 (Brisbane)62°C – 78°C (model dependant)
Athlon 64 X2 (Kuma)70°C
Athlon II X2 (Regor)72°C – 81°C (model dependant)
Athlon II X3 (Rana)71°C – 75°C (model dependant)
Athlon II X4 (Propus)70°C – 72°C (model dependant)
Phenom (Agena)70°C
Phenom X3 (Toliman)70°C
Phenom X4 (Agena)(61°C – 9100e, 9750, 9850) 70°C
Phenom II X2 (Castillo)70°C
Phenom II X3 (Heka)72°C
Phenom II X4 (Daneb) (920/940)62°C
Phenom II X4 (Daneb)62°C – 71°C (model dependant)
Phenom II X6 (Thuban)62°C / 71°C (model dependant)
Intel CPU’s
ПроцессорTCase Max
Intel Core 2 Duo (Conroe E4300, E4400, E6300, E6400)61.4°C
Intel Core 2 Duo (Conroe E4500, E4600, E4700)73.3°C
Intel Core 2 Duo (Conroe E6320, E6420, E6540, E6550, E6600, E6700, E6750, E6850)60.1°C
Intel Core 2 Duo (Wolfdale)72.4°C
Mobile Core 2 Duo100°C
Intel Core 2 Extreme (Conroe)60.4°C
Intel Core 2 Extreme (Kentsfield Q6700)71°C
Intel Core 2 Extreme (Kentsfield Q6600)62.2°C
Intel Core 2 Extreme (Kentsfield QX6700, QX6850)64.5°C
Intel Core 2 Extreme (Kentsfield QX6800)54.8°C
Intel Core 2 Extreme (Yorkfiled Q9300, Q9450, Q9550)71.4°C
Intel Core 2 Extreme (Yorkfield QX9650)64.5°C
Intel Core 2 Extreme (Yorkfield QX9770)55.5°C
Intel Core 2 Extreme (Hypertown QX9775)63°C
Intel Itanium 2 below 1Ghz66°C
Intel Itanium 2 1Ghz – 1.6Ghz83°C
Intel Core i3 (Clarkdale)72.6°C
Intel Core i3 (Sandy-Bridge)65°C – 69°C (model dependant)
Intel Core i3 (IvyBridge)65°C
Intel Core i3 (Haswell)66°C – 72°C (model dependant)
Intel Core i5 (Clarkdale)72.6°C
Intel Core i5 (Clarkdale) (Model 661)69.8°C
Intel Core i5 (Lynfield)72.7°C
Intel Core i5 (Lynfield) (Model 750s)68.9°C
Intel Core i5 (Sandy-Bridge)69°C – 73°C
Intel Core i5 (IvyBridge)67.4°C – 69.1°C (model dependant)
Intel Core i5 (Haswell)72°C
Intel Core i7 (Lynfield)69°C – 73°C (model dependant)
Intel Core i7 (Bloomfield)67.9°C
Intel Core i7 (Gulftown)67.9°C
Intel Core i7 (Sandy-Bridge)72.6°C
Intel Core i7 (IvyBridge)67.4°C – 69.8°C (model dependant)
Intel Core i7 (Haswell)72°C
Intel Core i7 (IvyBridge E)66.8°C
Intel Core i7 (Haswell E)66.8°C
Intel Core i7 Extreme (Bloomfield)67.9°C
Celeron (Sandybridge)|65.5°C – 69.1°C (model dependant)
Celeron (Ivy Bridge)65.3°C
Celeron (Haswell, BGA 1364)100°C
Celeron (Haswell, Socket 1150)64.4°C – 72°C (model dependant)
Pentium (Clarkdale)72.6°C
Pentium (SandyBridge)65°C – 69.1°C
Pentium (Ivy Bridge)64.3°C
Pentium (Haswell)64.4°C – 72°C (model dependant)

Ссылки