Dashboard: add NVME power indicator

This commit is contained in:
bergware
2023-12-02 14:01:49 +01:00
parent 28c58465da
commit 8d2e93f9e8
2 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -134,7 +134,7 @@ function get_nvme_info($device, $info) {
return exec("nvme id-ctrl /dev/$device | grep -Pom1 '^wctemp +: \K\d+'")-273;
case 'state':
$state = hexdec(exec("nvme get-feature /dev/$device -f2 | grep -Pom1 'value:\K0x\d+'"));
return exec("nvme id-ctrl /dev/$device | grep -Pom1 '^ps +$state : \S+ \K\S+'");
return exec("nvme id-ctrl /dev/$device | grep -Pom1 '^ps +$state : mp:\K\S+ \S+'");
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]+'");