Updated: NVME power state / temp threshold

This commit is contained in:
bergware
2023-11-30 23:05:17 +01:00
parent f6f0458dbb
commit f45fd2e456

View File

@@ -116,9 +116,9 @@ function isSubpool($name) {
function get_nvme_info($device, $info) {
switch ($info) {
case 'cctemp':
return explode(':',exec("nvme id-ctrl /dev/$device | grep '^cctemp '"))[1] - 273;
return my_explode(':',exec("nvme id-ctrl /dev/$device | grep '^cctemp '"))[1] - 273;
case 'wctemp':
return explode(':',exec("nvme id-ctrl /dev/$device | grep '^wctemp '"))[1] - 273;
return my_explode(':',exec("nvme id-ctrl /dev/$device | grep '^wctemp '"))[1] - 273;
case 'power':
$state = hexdec(my_explode(':',exec("nvme get-feature /dev/$device -f 2"),3)[2]);
return strtok(explode(':',exec("nvme id-ctrl /dev/$device | grep '^ps $state '"))[2],'W');