From 78437e5ac01b3bc7f486aa2bd0fcdd549378206d Mon Sep 17 00:00:00 2001 From: bergware Date: Fri, 17 Nov 2017 17:59:25 +0100 Subject: [PATCH] Seperate reading of attributes 190 or 194 temperatures (194=T, 190=100-T) --- plugins/dynamix/include/DashUpdate.php | 2 +- plugins/dynamix/include/DeviceList.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/dynamix/include/DashUpdate.php b/plugins/dynamix/include/DashUpdate.php index 774a0cbc2..7c60a54f9 100644 --- a/plugins/dynamix/include/DashUpdate.php +++ b/plugins/dynamix/include/DashUpdate.php @@ -139,7 +139,7 @@ case 'disk': $smart = "state/smart/$name"; $state = exec("hdparm -C ".escapeshellarg("/dev/$port")."|grep -Po 'active|unknown'") ? 'blue-on' : 'blue-blink'; if ($state=='blue-on') my_smart($row7[$n],$name,'New'); - $temp = file_exists($smart) ? exec("awk 'BEGIN{t=\"*\"} \$1==194||\$1==190{t=\$10;exit};\$1==\"Temperature:\"{t=\$2;exit} END{print t}' ".escapeshellarg($smart)) : '*'; + $temp = file_exists($smart) ? exec("awk 'BEGIN{t=\"*\"}\$1==194{t=\$10;exit};\$1==190{t=100-\$10;exit};\$1==\"Temperature:\"{t=\$2;exit} END{print t}' ".escapeshellarg($smart)) : '*'; $heat = exceed($temp,$max,$top) ? 'max' : (exceed($temp,$hot,$top) ? 'hot' : ''); if ($heat) my_insert($row6[$n],""); diff --git a/plugins/dynamix/include/DeviceList.php b/plugins/dynamix/include/DeviceList.php index 4cba0b873..cb3323af4 100644 --- a/plugins/dynamix/include/DeviceList.php +++ b/plugins/dynamix/include/DeviceList.php @@ -271,7 +271,7 @@ function read_disk($name, $part) { $smart = "/var/local/emhttp/smart/$name"; $type = $var['smType'] ?? ''; if (!file_exists($smart) || (time()-filemtime($smart)>=$var['poll_attributes'])) exec("smartctl -n standby -A $type ".escapeshellarg("/dev/$port")." >".escapeshellarg($smart)." &"); - return exec("awk 'BEGIN{t=\"*\"} \$1==194||\$1==190{t=\$10;exit};\$1==\"Temperature:\"{t=\$2;exit} END{print t}' ".escapeshellarg($smart)." 2>/dev/null"); + return exec("awk 'BEGIN{t=\"*\"}\$1==194{t=\$10;exit};\$1==190{t=100-\$10;exit};\$1==\"Temperature:\"{t=\$2;exit} END{print t}' ".escapeshellarg($smart)." 2>/dev/null"); } } function show_totals($text) {