Menu="Device:2 New:2" Title="Self-Test" Cond="strpos($disks[$name]['status'],'_NP')===false" --- $date = date('Ymd-Hi'); $sheets = []; $n = 0; $type = isset($disks[$name]) ? 'Device' : 'New'; if ($type=='New') { $dev = $name; foreach ($devs as $sheet) { $sheets[] = $sheet['device']; if ($sheet['device']==$name) {$i = $n; $file = $sheet['id']."-$date.txt";} $n++; } } else { $disk = $disks[$name]; $dev = $disk['device']; $file = $disk['id']."-$date.txt"; foreach ($disks as $sheet) { if ($sheet['name']=='flash' || strpos($sheet['status'],'_NP')) continue; $sheets[] = $sheet['name']; if ($sheet['name']==$name) { $i = $n; $spindown = "diskSpindownDelay.{$sheet['idx']}"; $delay = $sheet['spindownDelay']; } $n++; } } $live = exec("hdparm -C /dev/$dev|grep -Pom1 'active|unknown'"); $end = count($sheets)-1; $prev = $i>0 ? $sheets[$i-1] : $sheets[$end]; $next = $i<$end ? $sheets[$i+1] : $sheets[0]; $zip = str_replace(' ','_',strtolower($var['NAME']))."-smart-$date.zip"; function spindownDelay() { global $spindown, $delay; $tmp = "/var/tmp/$spindown"; return file_exists($tmp) ? file_get_contents($tmp) : $delay; } ?> Download SMART report: : SMART self-test history: : > Press **Show** to view the self-test history as is kept on the disk itself. > This feature is only available when the disk is in active mode.
SMART error log: : > Press **Show** to view the error report as is kept on the disk itself. > This feature is only available when the disk is in active mode. SMART short self-test: : > Starts a *short* SMART self-test, the estimated duration can be viewed under the *Capabilities* section. This is usually a few minutes. > > When the disk is spun down, it will abort any running self-test. > This feature is only available when the disk is in active mode. SMART extended self-test: : > Starts an *extended* SMART self-test, the estimated duration can be viewed under the *Capabilities* section. This is usually several hours. > > When the disk is spun down, it will abort any running self-test. It is advised to disable the spin down timer of the disk > to avoid interruption of this self-test. > > This feature is only available when the disk is in active mode. Last SMART test result: : Please wait... retrieving S.M.A.R.T. information! > When no test is running it will show here the latest obtained self-test result (if available). > Otherwise a progress indicator (percentage value) is shown for a running test.