Set temperature thresholds for SSD devices automatically higher

- Add 15 degrees extra for SSD devices as standard 'hot' and 'max' thresholds
- User can overwrite defaults by setting thresholds for a specific device
This commit is contained in:
bergware
2023-12-02 02:08:47 +01:00
parent 4be462d122
commit b1f7b37ff0
5 changed files with 18 additions and 10 deletions
+2 -2
View File
@@ -48,8 +48,8 @@ function check_temp(&$disk,$text,$info) {
$named = no_tilde($name);
$temp = _var($disk,'temp','*');
[$hotNVME,$maxNVME] = _var($disk,'transport')=='nvme' ? get_nvme_info(_var($disk,'device'),'temp') : [-1,-1];
$hot = _var($disk,'hotTemp',-1)>=0 ? $disk['hotTemp'] : ($hotNVME>=0 ? $hotNVME : (_var($display,'hot',-1)>=0 ? $display['hot'] : 0));
$max = _var($disk,'maxTemp',-1)>=0 ? $disk['maxTemp'] : ($maxNVME>=0 ? $maxNVME : (_var($display,'max',-1)>=0 ? $display['max'] : 0));
$hot = _var($disk,'hotTemp',-1)>=0 ? $disk['hotTemp'] : ($hotNVME>=0 ? $hotNVME : (_var($disk,'rotational',1)==0 ? ($display['hot']>0 ? $display['hot']+15 : 0) : $display['hot']));
$max = _var($disk,'maxTemp',-1)>=0 ? $disk['maxTemp'] : ($maxNVME>=0 ? $maxNVME : (_var($disk,'rotational',1)==0 ? ($display['max']>0 ? $display['max']+15 : 0) : $display['max']));
$warn = exceed($temp,$max,$top) ? 'alert' : (exceed($temp,$hot,$top) ? 'warning' : false);
$item = 'temp';
$last = $saved[$item][$named] ?? 0;