registerFunction("SaveDTemplate"); $xajax->registerFunction("DeleteTemplate"); $xajax->registerFunction("ClearTheData"); $xajax->registerFunction("DeleteLogs"); session_start(); $user = $_SESSION['user']; $in_xAjax = false; // This is the flag to let things know we are in an xAjax function $xAjax_objResponse; // The object that is returned from the xAjax function - MUST BE DEFINED GLOBALLY $NoInactivityTimer = true; // Set so the xajax calls don't look at the inactivity timer. include('common_admin_inc.htm'); include('IOB_inc.htm'); define('TEMPLATE_FILE', '/home/embedded/library/CoreService/dat/ARDTemplates'); define('TEMPLATE_FILE_T', '/home/embedded/library/CoreService/dat/ARDTemplatesT'); // Class used by php for the templates. class CARDTemplate { var $name; var $range; var $attrib; var $group; var $chart; var $type; var $selBy; function CARDTemplate( $name, $range, $attrib, $group, $chart, $type, $selBy ) { $this->name = $name; $this->range = $range; $this->attrib = $attrib; $this->group = $group; $this->chart = $chart; $this->type = $type; $this->selBy = $selBy;// Only used if Group is a Select By one } }; /////////////////////////////////////////////////////////////////// // Save the configration passed in to the tamplate name passed in /////////////////////////////////////////////////////////////////// function SaveDTemplate( $name, $SelTemplate ) { global $in_xAjax; global $xAjax_objResponse; $user = $_SESSION['user']; $xAjax_objResponse = new xajaxResponse(); $in_xAjax = true; // This must be called because we set NoInactivityTimer to true because of xajax loading the page behind the sheets. // Which causes an xajax XML error if the user is redirected to the login page durring the xajax call setup. // If we are logged out this function will reload the page which will take the user back to the login page. CheckLoggedOut(); error_log("\n\n\nSaving a new Template"); error_log("SelTemplate = ". print_r($SelTemplate, true) ); $fh = @fopen( TEMPLATE_FILE, 'a' ); if( $fh == false ) { error_log( "Could not open file for writing."); // error_back(); } else { $myArray = array(); $myArray[] = $name; error_log("name = ". $name ); error_log("$myArray[0] = ". $myArray[0] ); $myArray = array_merge($myArray, $SelTemplate); error_log("myArray = ". print_r($myArray,true) ); $myData = implode(",", $myArray); error_log("myData = ". $myData); $myData .= "\n"; error_log("Writting to file: ". $myData); $bytesWritten = fputs( $fh, $myData ); fclose($fh); // $xAjax_objResponse->assign("IOBStat_".$iob->id, "innerHTML", $IOB_bladeStatus[$iob->status]); // $xAjax_objResponse->script('setTimeout("xajax_checkIOBStatus()",20000);'); } return $xAjax_objResponse; } /////////////////////////////////////////////////////////////////// // Delete the template passed in /////////////////////////////////////////////////////////////////// function DeleteTemplate( $name ) { global $in_xAjax; global $xAjax_objResponse; $user = $_SESSION['user']; $xAjax_objResponse = new xajaxResponse(); $in_xAjax = true; // This must be called because we set NoInactivityTimer to true because of xajax loading the page behind the sheets. // Which causes an xajax XML error if the user is redirected to the login page durring the xajax call setup. // If we are logged out this function will reload the page which will take the user back to the login page. CheckLoggedOut(); error_log("\n\n\Delete the Template". $name); $buffersize = 1*(256); // 256 char chunks $buffer = ''; // We need to have the system create the temp file so we can chmod it beofre using it. $sRet = system("/usr/bin/cmdwrap -NO_END_OF_FILE touch ".TEMPLATE_FILE_T, $iRet); error_log("Call to system (touch) returned a \"$iRet\" and the output was \"$sRet\""); $sRet = system("/usr/bin/cmdwrap -NO_END_OF_FILE chmod 666 ".TEMPLATE_FILE_T, $iRet); error_log("Call to system (chmod) returned a \"$iRet\" and the output was \"$sRet\""); error_log("\n\n\n\n\n\n\n\n\n\n\n\n\n We are using the following file names: ". TEMPLATE_FILE ." and ".TEMPLATE_FILE_T); $fh = @fopen( TEMPLATE_FILE, 'r' ); if( $fh == false ) { error_log( "Could not open file for reading."); error_back(0x0b); } else { $fhT = @fopen( TEMPLATE_FILE_T, 'w' ); if( $fhT == false ) { error_log( "Could not open file for writing."); error_back(0x0b); } $i = 0; $j = 0; while ( !feof( $fh ) ) { $buffer = fgets( $fh, $buffersize ); $tData = split(",", $buffer ); if( $tData[0] == "" ) continue; // The last one seems to be blank - pass it up bit let the loop end normally if( $tData[0] == $name ) { // This is the one we want to delete continue; } fwrite( $fhT, $buffer ); } fclose($fh); fclose($fhT); // Now delete the OLD and rename the new $sRet = system("/usr/bin/cmdwrap -NO_END_OF_FILE rm -f ".TEMPLATE_FILE, $iRet); error_log("Call to system (rm TEMPLATE_FILE) returned a \"$iRet\" and the output was \"$sRet\""); $sRet = system("/usr/bin/cmdwrap -NO_END_OF_FILE mv -f ".TEMPLATE_FILE_T." ".TEMPLATE_FILE, $iRet); error_log("Call to system (mv TEMPLATE_FILE_T) returned a \"$iRet\" and the output was \"$sRet\""); } return $xAjax_objResponse; } /////////////////////////////////////////////////////////////////////// // Clear the php data so the data will be read from scratch next load. /////////////////////////////////////////////////////////////////////// function ClearTheData() { global $in_xAjax; global $xAjax_objResponse; $user = $_SESSION['user']; $xAjax_objResponse = new xajaxResponse(); $in_xAjax = true; // This must be called because we set NoInactivityTimer to true because of xajax loading the page behind the sheets. // Which causes an xajax XML error if the user is redirected to the login page durring the xajax call setup. // If we are logged out this function will reload the page which will take the user back to the login page. CheckLoggedOut(); unset($_SESSION['ARD_psn']); return $xAjax_objResponse; } ///////////////////////////////////////////////////////////////////// // Delete all the Advanced reporting Data. // This will Delete all TApeAlertLog and DriveLog files and archives. // New blank files wil be create to accept new logs from this point. ///////////////////////////////////////////////////////////////////// function DeleteLogs() { global $in_xAjax; global $xAjax_objResponse; $user = $_SESSION['user']; $xAjax_objResponse = new xajaxResponse(); $in_xAjax = true; // This must be called because we set NoInactivityTimer to true because of xajax loading the page behind the sheets. // Which causes an xajax XML error if the user is redirected to the login page durring the xajax call setup. // If we are logged out this function will reload the page which will take the user back to the login page. CheckLoggedOut(); error_log("===================================================== Rolling the logs..."); // First roll the AR logs so the main one is empty roll_logs($user, false, true); // Now delete all the archive files. $sRet = system("/usr/bin/cmdwrap -NO_END_OF_FILE rm -f /home/embedded/library/CoreService/dat/DriveLog.*", $iRet); error_log("Call to system (rm DriveLog.*) returned a \"$iRet\" and the output was \"$sRet\""); $sRet = system("/usr/bin/cmdwrap -NO_END_OF_FILE rm -f /home/embedded/library/CoreService/dat/TapeAlertLog.*", $iRet); error_log("Call to system (rm DriveLog.*) returned a \"$iRet\" and the output was \"$sRet\""); // There seems to be an issue where once in a blue moon one of the DriveLog files are not deleted. // The only thing I can come up with is that the OS is still in the process of deleting the files // When the page is reloading and trying to use the files so the file being accessed does not get deleted. // So I'm adding a 5 second wait here. sleep(5); return $xAjax_objResponse; } // This call must come AFTER ALL xajax functions have been defined. // This is what connects the php functions with the JavaScript functions. $xajax->processRequest(); //////////////////////////////////////////////////////////////////////// // This class defines the data that will read from the DriveLog files // A line of the file looks like: // 12/22/2007 12:56:59,12/22/2007 12:56:17,0,2,1210143187,rdt2,0,0,2,000158L3 //////////////////////////////////////////////////////////////////////////////// class CDriveData { var $umntTime; var $mntTime; var $x; var $y; var $serial; var $partition; var $read; var $written; var $moTime; var $barcode; var $loc; var $use; function CDriveData($umntTime, $mntTime, $x, $y, $serial, $partition, $read, $written, $moTime, $barcode) { $this->umntTime = $umntTime; $this->mntTime = $mntTime; $this->x = $x; $this->y = $y; $this->serial = $serial; $this->partition = $partition; $this->read = $read; $this->written = $written; $this->moTime = $moTime; $this->barcode = $barcode; $this->loc = $x.",".$y; $this->use = true; } }; /*##################################################################### # To do this parsing in a shell script use something like the # following with the unique command. # awk '{print $3}' DriveLog | awk -F, '{print $2","$3" "$4" "$9}' # --------------------- ----------------------------------- # | | # Get Rid of the dates | # Display the 3 items we want #####################################################################*/ ?> printJavascript(); ?> Drive Utilization Report
Reports - Drive Resource Utilization
Configure the Drive Utilization reports.


role != SERVICE_ROLE ) { ?>
Advanced Reporting must be licensed to use the drive utilization reports.
Please click here to add a license key.

There is no data on the library for the drive utilization reports.

Date Range:
Last 7 Days Last 4 Weeks Last 3 Months All History
Attribute:
Data Written / Read Total Read and Write  
Media Mount Count Media Mount Time Media Motion Time
Chart:
Area Bar Line Pie
Type:
Rollup Trend

Grouping:
All Drives By Coordinate All Drives By Physical SN All Partitions
Selected Drive By Coordinate Selected Drive By Physical SN Selected Partition
"; while( list($key, $val) = each($coordsAry) ) { echo "\n"; } echo "\n"; ?> "; while( list($key, $val) = each($psnAry) ) { echo "\n"; } echo "\n"; ?> "; while( list($key, $val) = each($partAry) ) { echo "\n"; } echo "\n"; ?>

Report Templates
   "; foreach( $Templates as $temp ) { echo "\n"; } echo "\n"; ?>   
   
Report Data
   
records read.