mirror of
https://github.com/unraid/webgui.git
synced 2026-01-13 21:20:01 -06:00
Seperate reading of attributes 190 or 194 temperatures (194=T, 190=100-T)
This commit is contained in:
@@ -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],"<span class='heat-img'><img src='$path/$heat.png'></span><span class='heat-text' style='display:none'>".my_temp($temp,$_POST['unit'])."</span>");
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user