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
@@ -59,8 +59,8 @@ case "attributes":
$events = explode('|',get_value($disk,'smEvents',$numbers));
extract(parse_plugin_cfg('dynamix',true));
[$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']));
$top = $_POST['top'] ?? 120;
$empty = true;
exec("smartctl -n standby -A $type ".escapeshellarg("/dev/$port"),$output);