StatusCheck: fixed: temperature thresholds

This commit is contained in:
bergware
2023-06-11 17:54:33 +02:00
parent a8cf94d7b3
commit 9b9674b666

View File

@@ -93,10 +93,10 @@ function my_clock($time) {
function my_array(&$disk) {
global $data,$display,$error0,$error1,$error2,$error3;
$name = _var($disk,'name');
$max = $disk['maxTemp'] ?? $display['max'] ?? 0;
$hot = $disk['hotTemp'] ?? $display['hot'] ?? 0;
$max = _var($disk,'maxTemp')>=0 ? $disk['maxTemp'] : (_var($display,'max')>=0 ? $display['max'] : 0);
$hot = _var($disk,'hotTemp')>=0 ? $disk['hotTemp'] : (_var($display,'hot')>=0 ? $display['hot'] : 0);
if (strpos(_var($disk,'status'),'_NP')!==false) return false;
$temp = _var($disk,'temp','*');
$temp = _var($disk,'temp');
if ($max>0 && $temp>=$max) {
$fail = ' (disk is overheated';
$error0++;