registerFunction("SaveDTemplate"); $xajax->registerFunction("DeleteTemplate"); $xajax->registerFunction("ClearTheData"); $xajax->registerFunction("DeleteLogs"); // Can't use the common_inc includes here becasue of xAjax so set the user manualy. 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 include('main_inc.htm'); include('user_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; 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); } 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; 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("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() { error_log("in ClearTheData"); global $in_xAjax; global $xAjax_objResponse; $user = $_SESSION['user']; $xAjax_objResponse = new xajaxResponse(); $in_xAjax = true; 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; 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\""); 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(); include("ms_advanced_reporting_common.htm"); // Get the string and timestamp of the library's date so we use the library's clock even in JavaScript when needed. $sLibDate = date('m/d/Y',time()); $iLibDate = time(); error_log("Today is ".$sLibDate." (".$iLibDate.")" ); ?> printJavascript(); ?> Drive Utilization Report
0) { ?>
Error Message Image Error Message

Error code:
Informational Message Image

Operation Complete

Close Message


Drive Utilization
role != SERVICE_ROLE ) { ?>
Advanced Reporting must be licensed to use the drive utilization reports.
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  
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.