From 967bb771c4da2d6372de0f374e94d3e6f0318004 Mon Sep 17 00:00:00 2001 From: bergware Date: Sat, 2 Dec 2023 19:59:32 +0100 Subject: [PATCH] get-nvme-info: fix state value --- emhttp/plugins/dynamix/include/Wrappers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emhttp/plugins/dynamix/include/Wrappers.php b/emhttp/plugins/dynamix/include/Wrappers.php index ba8d17c31..40acb886a 100644 --- a/emhttp/plugins/dynamix/include/Wrappers.php +++ b/emhttp/plugins/dynamix/include/Wrappers.php @@ -133,10 +133,10 @@ function get_nvme_info($device, $info) { case 'wctemp': return exec("nvme id-ctrl /dev/$device 2>/dev/null | grep -Pom1 '^wctemp +: \K\d+'")-273; case 'state': - $state = hexdec(exec("nvme get-feature /dev/$device -f2 2>/dev/null | grep -Pom1 'value:\K0x\d+'")); + $state = hexdec(exec("nvme get-feature /dev/$device -f2 2>/dev/null | grep -Pom1 'value:\K\S+'")); return exec("nvme id-ctrl /dev/$device 2>/dev/null | grep -Pom1 '^ps +$state : mp:\K\S+ \S+'"); case 'power': - $state = hexdec(exec("nvme get-feature /dev/$device -f2 2>/dev/null | grep -Pom1 'value:\K0x\d+'")); + $state = hexdec(exec("nvme get-feature /dev/$device -f2 2>/dev/null | grep -Pom1 'value:\K\S+'")); return exec("smartctl -c /dev/$device 2>/dev/null | grep -Pom1 '^ *$state [+-] +\K[^W]+'"); } }