diff --git a/plugins/dynamix/include/DashUpdate.php b/plugins/dynamix/include/DashUpdate.php index fe96be918..8483a7fe2 100644 --- a/plugins/dynamix/include/DashUpdate.php +++ b/plugins/dynamix/include/DashUpdate.php @@ -126,9 +126,9 @@ function device_name(&$disk, $array) { return " {$disk['device']}"; } } -function device_status(&$disk, &$error, &$warning) { +function device_status(&$disk, $array, &$error, &$warning) { global $var; - if ($var['fsState']=='Stopped') { + if ($array && $var['fsState']=='Stopped') { $color = 'green'; $text = 'off-line'; } else switch ($disk['color']) { case 'green-on' : $color = 'green'; $text = 'active'; break; @@ -214,7 +214,7 @@ function array_group($type) { foreach ($disks as $disk) if ($disk['type']==$type && strpos($disk['status'],'DISK_NP')===false) { echo ""; echo "".device_name($disk,true).""; - echo "".device_status($disk,$error,$warning).""; + echo "".device_status($disk,true,$error,$warning).""; echo "".device_temp($disk,$red,$orange).""; echo "".device_smart($disk,false,$fail,$smart).""; echo "".device_usage($disk,true,$full,$high).""; @@ -226,12 +226,11 @@ function extra_group() { foreach ($devs as $disk) { $name = $disk['device']; $port = port_name($name); - $smart = "state/smart/$name"; $disk['color'] = exec("hdparm -C /dev/$port|grep -Po 'active|unknown'") ? 'blue-on' : 'blue-blink'; - $disk['temp'] = file_exists($smart) ? exec("awk 'BEGIN{s=t=\"*\"}\$1==190{s=\$10};\$1==194{t=\$10;exit};\$1==\"Temperature:\"{t=\$2;exit};/^Current Drive Temperature:/{t=\$4;exit} END{if(t!=\"*\")print t; else print s}' $smart") : '*'; + $disk['temp'] = exec("awk 'BEGIN{s=t=\"*\"}\$1==190{s=\$10};\$1==194{t=\$10;exit};\$1==\"Temperature:\"{t=\$2;exit};/^Current Drive Temperature:/{t=\$4;exit} END{if(t!=\"*\")print t; else print s}' state/smart/$name 2>/dev/null"); echo ""; echo "".device_name($disk,false).""; - echo "".device_status($disk,$error,$warning).""; + echo "".device_status($disk,false,$error,$warning).""; echo "".device_temp($disk,$red,$orange).""; echo "".device_smart($disk,$name,$fail,$smart).""; echo "".device_usage($disk,false,$full,$high)."";