"; } } else if( $_POST['whatsSelected'] == "email" ) { $operationInProgress = true; $status = new ReturnStatus(); $theFile = $_POST['file']; if( $headerString != "") { // Add the Header to the top of the file. $fileNameT = "/tmp/logViewerT"; $theFile = $_POST['fileOnly']; error_log("Create tmp file with header"); $sRet = system("/usr/bin/cmdwrap -NO_END_OF_FILE echo '".$headerString."' > ".$fileNameT, $iRet); error_log("Call to system (echo headerString) returned a \"$iRet\" and the output was \"$sRet\""); $sRet = system("/usr/bin/cmdwrap -NO_END_OF_FILE cat ".$_POST['file']." >> ".$fileNameT, $iRet); error_log("Call to system (cat file) returned a \"$iRet\" and the output was \"$sRet\""); $sRet = system("/usr/bin/cmdwrap -NO_END_OF_FILE chmod 666 ".$fileNameT, $iRet); error_log("Call to system (chmod 666 DriveLog) returned a \"$iRet\" and the output was \"$sRet\""); // Rename the file back to the original. $sRet = system("/usr/bin/cmdwrap -NO_END_OF_FILE mv -f ".$fileNameT." ".$theFile, $iRet); error_log("Call to system (mv to orig) returned a \"$iRet\" and the output was \"$sRet\""); } email_file( $user, $theFile, $_POST['emailAddress'], $_POST['logFileLabel'] ); print $status->out(); return; } } else { $errorText = ""; $headerString = ""; $deleteFile = 0; $LibraryHostname = get_network_hostname($user); // These varibles are needed because on the library some file are named with the correct extention and opthers are not so at time we need to rename the file before sending it. $fileOnly = ""; // Used when emailing the file becasue we can not prepend the header on the emialed file like we can on the downloaded file. $format = "0"; error_log($_SERVER['PHP_SELF']." _GET = ". print_r($_GET, true) ); if( $_GET['logFile'] == "ivtSummaryLog" ) { $logFileLabel = "Library IVT Summary Log"; $logFileToShow = "/home/embedded/library/CoreService/dat/IVTStatus.txt"; $hiddenFileValue = "ivtSummaryLog"; $errorText = "Note: You first need to run the |Installation %26 Verification Tests| from the local Operator Panel."; } else if( $_GET['logFile'] == "ivtDetailedLog" ) { $logFileLabel = "Library IVT Detailed Log"; $logFileToShow = "/home/embedded/library/CoreService/dat/IVTLog.txt"; $hiddenFileValue = "ivtDetailedLog"; $errorText = "Note: You first need to run the |Installation %26 Verification Tests| from the local Operator Panel."; } else if( $_GET['logFile'] == "commandHistoryLog" ) { $logFileLabel = "Library Command History Log"; $logFileToShow = "/tmp/commandHistory.log"; $hiddenFileValue = "commandHistoryLog"; // Create the log file error_log("\n\nRunning: create_command_history_log(user, ".$_GET['bladeSel'].", ".$_GET['dev'].");\n\n" ); create_command_history_log($user, $_GET['bladeSel'], (int)$_GET['dev']); } else if( $_GET['logFile'] == "cleaninglog" ) { $logFileLabel = "Library Cleaning Log"; $logFileToShow = "/home/embedded/library/CoreService/dat/CleaningLog.csv"; $hiddenFileValue = "cleaninglog"; $errorText = "Note: No cleanings have been performed."; $headerString = "Date Time, Barcode, Tape, Drive, Status, Return Code, Cleaning Type, Expired, Usage Count, Reserved"; $headerStringHTM = "Date TimeBarcodeTapeDriveStatusReturn CodeCleaning TypeExpiredUsage Count". "
"; $fileOnly = "/tmp/CleaningLog.csv"; $format = "1"; } else if( $_GET['logFile'] == "shposlog" ) { $logFileLabel = "Library Slot Position Log"; $logFileToShow = "/home/embedded/library/CoreService/dat/SlotPositionLog.csv"; $hiddenFileValue = "shposlog"; $headerString = "Date Time, SlotType, Present, Location, X, Y, Angle, X offset, Y Offset"; $headerStringHTM = "Date TimeSlotTypePresentLocationXYAngleX offsetY Offset\n" . "
"; $fileOnly = "/tmp/SlotPositionLog.csv"; $format = "1"; } else if( $_GET['logFile'] == "rasTicketsLog" ) { @report_ras_tickets(); $logFileLabel = "Library RAS Tickets Log"; $logFileToShow = "/tmp/RASticketReports.log"; $hiddenFileValue = "rasTicketsLog"; $format = "2"; // Only put in the Table stuff so IE does not wrap } else if( $_GET['logFile'] == "mediaSecurityLog" ) { $logFileLabel = "Library Media Security Log"; $logFileToShow = "/home/embedded/library/CoreService/dat/MediaSecurityEventLog.csv"; $hiddenFileValue = "mediaSecurityLog"; $headerString = "Date Time, Barcode, Type, Slot Location, Slottype"; $headerStringHTM = "Date TimeBarcodeTypeSlot LocationSlot Type\n" . "
"; $fileOnly = "/tmp/MediaSecurityEventLog.csv"; $format = "1"; } else if( $_GET['logFile'] == "qkmIELog" ) { $logFileLabel = "QKM Encryption Key Import Warning Log"; $logFileToShow = "/home/embedded/library/CoreService/dat/QkmImportLog"; $hiddenFileValue = "qkmIELog"; //Date Severity Encryption Key Description $headerString = "Date Time, Severity, Encryption Key, Description"; $headerStringHTM = "Date TimeSeverityEncryption KeyDescription\n" . "
"; //$fileOnly = "/tmp/MediaSecurityEventLog.csv"; $format = "1"; } else { $logFileLabel = "NO FILE SELECTED"; } } // Check if file exists error_log("logFileToShow = ". $logFileToShow); @check_file_exists( $logFileToShow ); // Test for email configuration $emailConfig = get_email_configuration($user); if( isset($emailConfig) ) { if( trim($emailConfig->smtpServer) != '' ) $isEmailConfigured = "true"; } function check_file_exists( $filename ) { global $fileNotFound; $fileSize = filesize($filename); if( $fileSize == 0 ) $fileNotFound = "true"; else { $fh = fopen( $filename, 'rb' ); if( $fh == false ) { $fileNotFound = "true"; } else { fclose( $fh ); } } } ?> Log Viewer
>
Reports - Log Viewer
View library logs.
Note: You can e-mail or save the selected log.
File:   :