aboutsummaryrefslogtreecommitdiff
path: root/admin/api/serverTemp.php
blob: 55cf34b39446eaa7f457ab78d8b06eca23f75719 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . "/admin/private/header.api.php";

echo("Server running at <b>");
exec("sensors -j", $out);
$outp = implode("\n", $out);
$outd = json_decode($outp, true);

echo(round($outd["cpu_thermal-virtual-0"]["temp1"]["temp1_input"], 1));

?>°C</b>, <?php

if ($outd["cpu_thermal-virtual-0"]["temp1"]["temp1_input"] > 90) {
    echo("completely overheating!");
} else if ($outd["cpu_thermal-virtual-0"]["temp1"]["temp1_input"] > 60) {
    echo("starting to throttle!");
} else {
    echo("under normal temperatures");
}