aboutsummaryrefslogtreecommitdiff
path: root/admin/api/serverTemp.php
blob: 613c411375112be44a6929d7cb64fab17704afd8 (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(l("Server running at", "Serveur fonctionnant à") . " <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(l("completely overheating!", "en pleine surchauffe !"));
} else if ($outd["cpu_thermal-virtual-0"]["temp1"]["temp1_input"] > 60) {
    echo(l("starting to throttle!", "commence à être bridé !"));
} else {
    echo(l("under normal temperatures", "températures habituelles"));
}