Updated: NVME power state / temp threshold

This commit is contained in:
bergware
2023-12-01 13:06:18 +01:00
parent a8fbdfec74
commit 98b5fca350

View File

@@ -124,7 +124,7 @@ function get_nvme_info($device, $info) {
return exec("nvme id-ctrl /dev/$device | grep -Pom1 '^wctemp +: \K\d+'")-273;
case 'power':
$state = hexdec(exec("nvme get-feature /dev/$device -f2 | grep -Pom1 'value:\K0x\d+'"));
return exec("smartctl -c /dev/$device | grep -Pom1 '^ $state [+-] +\K[^W]+'");
return exec("smartctl -c /dev/$device | grep -Pom1 '^ *$state [+-] +\K[^W]+'");
}
}
// convert strftime to date format