diff --git a/app/lib/system.php b/app/lib/system.php index e7007d0a..4e4c8879 100644 --- a/app/lib/system.php +++ b/app/lib/system.php @@ -45,5 +45,10 @@ class System { public function systemLoadPercentage() { return intval(($this->loadAvg1Min() * 100) / $this->processorCount()); } + + public function systemTemperature() { + $cpuTemp = file_get_contents("/sys/class/thermal/thermal_zone0/temp"); + return number_format($cpuTemp/1000, 1); + } } diff --git a/templates/system.php b/templates/system.php index c48befce..37ff7370 100755 --- a/templates/system.php +++ b/templates/system.php @@ -25,6 +25,16 @@ if ($cpuload > 90) { $cpuload_status = "success"; } +// cpu temp +$cputemp = $system->systemTemperature(); +if ($cputemp > 70) { + $cputemp_status = "danger"; +} elseif ($cputemp > 50) { + $cputemp_status = "warning"; +} else { + $cputemp_status = "success"; +} + ?>