"; } } else { $operationInProgress = true; $status = new ReturnStatus(); $text = ''; $testdrv =""; $libInfo = $_POST['libraryGUID']; $driveGuids = split(":", $_REQUEST['driveGUID']); $driveList = split(":", $_REQUEST['driveLOC']); error_log( "drivelist = ". print_r($driveList,true) ); set_time_limit(0); // Turn off the timelimit or php will complain with large amounts of data $dateline = "Diagnostics performed on: ".date("D M j G:i:s Y")."\n\n"; $outBuf = "DIAGNOSTIC DRIVE RESET RESULTS\n"; $outBuf .= "------------------------------\n\n"; $outBuf .= $dateline; //$outBuf .= (trim($buffer,"\n") .",". $TapeAlertDesc[$iTmp] ."\n"); // Reset the drives and update the output Buffer $i=0; $failed = 0; $passed = 0; foreach ($driveGuids as $driveGUID) { if( !($i%3)) { $text .=''; } $test = @power_cycle_drive($user, $driveGUID); error_log( "power_cycle_drive() $test = ". print_r($test, true) ); // Leave this in because it took me forever to figure out how to output the result...! //$text .=''; $driveResult = $test->result; if( $driveResult == 'Succeeded' ) { $driveResult = 'Passed'; $passed++; } else { $failed++; } //$driveResult = ($test->result == Succeeded) ? 'Passed' : 'Failed'; $location = "Drive location ["."$driveList[$i]"."] "; $outBuf .= $location.$driveResult."\n"; $text .=''; $i++; if( !($i%3)) { $text .=''; } } if( ($i % 3)) // if not at the end of a row, end the row { $text .=''; } $text .='
Drive Reset Results
['."$driveList[$i]".']:'."$test->result".'Location ['."$driveList[$i]".'] '.(($driveResult == 'Passed') ? ''."$driveResult".'':''."$driveResult".'').'
'; $outBuf .= "\nNumber of drive resets passed: "."$passed\n"; $outBuf .= "Number of drive resets failed: "."$failed\n"; $outBuf .= "\nTotal drive resets attempted : ".$i++; //error_log( $text ); print $status->closeMsg(3, $text); if( $fh = fopen($fileName, 'wb')) { fwrite($fh, $outBuf, strlen($outBuf)); fclose($fh); } else { error_log("Could not open the output file for writing"); error_back(0x0b); } set_time_limit(30); // Set back to the default } return; } $counts = get_all_resource_counts($user); ?> Reset Drive
Drive Reset - LibraryName

Total Drives:  0
  Location     Status     State     Drive Type     Protocol     Control Path     Vendor     Serial #     FW Version    
  Page 
 of        
Drives: 1 - 6