diff --git a/application/classes/model/library.php b/application/classes/model/library.php index fb25b21..0c78289 100644 --- a/application/classes/model/library.php +++ b/application/classes/model/library.php @@ -33,7 +33,7 @@ class Model_LIBRARY extends ORMTSM { } // Return a list of scratch volumes - public function scratch() { + public function scratchvol() { $return = array(); foreach ($this->slots() as $slot) @@ -44,7 +44,7 @@ class Model_LIBRARY extends ORMTSM { } // Return a list of volumes that are readonly - public function readonly() { + public function readonlyvol() { $return = array(); foreach ($this->slots() as $slot) @@ -60,7 +60,7 @@ class Model_LIBRARY extends ORMTSM { } // Return the slots that are used, but not checked in. - public function notcheckedin() { + public function notcheckedinvol() { $return = array(); foreach ($this->slots() as $slot) @@ -95,20 +95,22 @@ class Model_LIBRARY extends ORMTSM { return $result; } - // Return a list of volumes - // $ptype is pool type (PRIMARY,ACTIVE,COPY) - // @param $inout IN|OUT of the library - // @param $status volume status FULL|FILLING|PENDING|EMPTY - // @note This is an intensive method that needs caching. - public function volstype($type,$inout,$status) { + /** + * Return a list of volumes + * + * @param $ptype is pool type (PRIMARY,ACTIVE,COPY) + * @param $inout IN|OUT of the library + * @param $status volume status FULL|FILLING|PENDING|EMPTY + * @note This is an intensive method that needs caching. + */ + public function volstype($ptype,$inout,$status) { static $CACHE = array(); - $ainout = array('in','out'); - $astatus = array('FULL','FILLING','PENDING','EMPTY'); + $ainout = array('IN','OUT'); - if (! isset($CACHE[__METHOD__][$type])) - foreach ($this->storagepoolstype($type) as $spo) + if (! isset($CACHE[__METHOD__][$ptype])) + foreach ($this->storagepoolstype($ptype) as $spo) foreach ($ainout as $cinout) - foreach ($astatus as $cstatus) { + foreach (Kohana::config('config.tsmvolstatus') as $cstatus) { if (! isset($CACHE[__METHOD__][$spo->POOLTYPE][$cinout][$cstatus])) $CACHE[__METHOD__][$spo->POOLTYPE][$cinout][$cstatus] = array(); @@ -116,7 +118,36 @@ class Model_LIBRARY extends ORMTSM { array_merge($CACHE[__METHOD__][$spo->POOLTYPE][$cinout][$cstatus],$spo->libvolstype($cinout,$cstatus)); } - return isset($CACHE[__METHOD__][$type][$inout][$status]) ? $CACHE[__METHOD__][$type][$inout][$status] : array(); + return isset($CACHE[__METHOD__][$ptype][$inout][$status]) ? $CACHE[__METHOD__][$ptype][$inout][$status] : array(); + } + + /** + * Return a list of DB volumes + * + * @param $inout IN|OUT of the library + * @note This is an intensive method that needs caching. + */ + public function dbvolsloc($inout) { + static $CACHE = array(); + + if (! isset($CACHE[__METHOD__])) + foreach (ORM::factory('volhistory')->where('TYPE','IN',Kohana::config('config.tsmdbtypes'))->find_all() as $vho) + $CACHE[__METHOD__][$vho->LIBVOLUME ? 'IN' : 'OUT'][] = $vho; + + return isset($CACHE[__METHOD__][$inout]) ? $CACHE[__METHOD__][$inout] : array(); + } + + // Return a list of DB volumes by type + // @param $inout IN|OUT of the library + // @param $dtype is DB vole type (BACKUPFULL,BACKUPINCR,DBSNAPSHOT) + public function dbvolstype($inout,$dtype) { + $result = array(); + + foreach ($this->dbvolsloc($inout) as $vho) + if ($vho->TYPE ==$dtype) + array_push($result,$vho); + + return $result; } public function volsnotinlib() { @@ -130,5 +161,28 @@ class Model_LIBRARY extends ORMTSM { Sort::masort($result,'VOLUME_NAME'); return $result; } + + // Volumes that are stale + public function stalevol() { + $result = array(); + + foreach ($this->storagepools() as $spo) + foreach ($spo->VOLUME->find_all() as $vo) + if ($vo->recycle()) + array_push($result,$vo); + + Sort::masort($result,'VOLUME_NAME'); + return $result; + } + + public function removablelibvol() { + $result = array(); + + foreach ($this->slots() as $slot) + if ($slot->LIBVOLUME->removable()) + array_push($result,$slot->LIBVOLUME); + + return $result; + } } ?> diff --git a/application/classes/model/libvolume.php b/application/classes/model/libvolume.php index 624948e..4ed4749 100644 --- a/application/classes/model/libvolume.php +++ b/application/classes/model/libvolume.php @@ -79,5 +79,8 @@ class Model_LIBVOLUME extends ORMTSM { } } + public function removable() { + return ($this->usage() == 'dbbackup' OR ($this->usage() != 'scratch' AND $this->VOLUME->STGPOOL->POOLTYPE != 'PRIMARY')) ? TRUE : FALSE; + } } ?> diff --git a/application/classes/model/volhistory.php b/application/classes/model/volhistory.php index 72d1925..994a628 100644 --- a/application/classes/model/volhistory.php +++ b/application/classes/model/volhistory.php @@ -17,6 +17,7 @@ class Model_VOLHISTORY extends ORMTSM { ); protected $_has_one = array( + 'LIBVOLUME'=>array('foreign_key'=>'VOLUME_NAME','far_key'=>'VOLUME_NAME'), 'VOLUME'=>array('foreign_key'=>'VOLUME_NAME','far_key'=>'VOLUME_NAME'), ); protected $_has_many = array( diff --git a/application/classes/model/volume.php b/application/classes/model/volume.php index b988cbb..19780f7 100644 --- a/application/classes/model/volume.php +++ b/application/classes/model/volume.php @@ -19,6 +19,7 @@ class Model_VOLUME extends ORMTSM { protected $_has_one = array( 'MEDIA'=>array('foreign_key'=>'VOLUME_NAME','far_key'=>'VOLUME_NAME'), + 'STGPOOL'=>array('foreign_key'=>'STGPOOL_NAME','far_key'=>'STGPOOL_NAME'), ); protected $_has_many = array( 'VOLUMEUSAGE'=>array('foreign_key'=>'VOLUME_NAME','far_key'=>'VOLUME_NAME'), @@ -52,5 +53,17 @@ class Model_VOLUME extends ORMTSM { public function location() { return $this->display('LOCATION'); } + + // Age of a volume, based on last read/write access. + public function age() { + if (! $this->LAST_READ_DATE AND ! $this->LAST_WRITE_DATE) + return 0; + else + return (int)((time()-(strtotime(strtotime($this->LAST_READ_DATE) > strtotime($this->LAST_WRITE_DATE) ? $this->LAST_WRITE_DATE : $this->LAST_READ_DATE)))/86400); + } + + public function recycle() { + return Kohana::config('config.tsmtapeage') < $this->age() ? TRUE : FALSE; + } } ?> diff --git a/application/config/config.php b/application/config/config.php index 1d76aa6..635d7d2 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -15,8 +15,11 @@ return array( 'client' => '/opt/tivoli/tsm/client/ba/bin/dsmadmc', 'client_errorlogname' => '/tmp/pta-tsm-errorlog.log', 'date_format' => 'd-m-Y', - 'tsmpooltypes' => array('PRIMARY','ACTIVEDATA','COPY'), 'tsmdatatypes' => array('Bkup'=>'BACKUP','Arch'=>'ARCHIVE'), + 'tsmdbtypes' => array('BACKUPFULL','BACKUPINCR','DBSNAPSHOT'), + 'tsmpooltypes' => array('PRIMARY','ACTIVEDATA','COPY'), + 'tsmvolstatus' => array('FULL','FILLING','PENDING','EMPTY'), + 'tsmtapeage' => 180, // Age of tapes before prompting to rotate 'email_admin_only'=> array( 'method'=>array('wurley@users.sf.net'=>'Deon George'), ), diff --git a/application/media/css/default.css b/application/media/css/default.css index e5fb37a..2a4dc0b 100644 --- a/application/media/css/default.css +++ b/application/media/css/default.css @@ -9,6 +9,7 @@ td.head { font-weight: bold; } td.bold { font-weight: bold; } td.bold-right { font-weight: bold; text-align: right; } td.data { font-weight: bold; } +span.data { font-weight: bold; } td.data-right { font-weight: bold; text-align: right; } td.right { text-align: right; } tr.odd { background-color: #FCFCFE; } diff --git a/application/views/library/detail.php b/application/views/library/detail.php index 60da2ec..25a770f 100644 --- a/application/views/library/detail.php +++ b/application/views/library/detail.php @@ -71,15 +71,23 @@ Not Checked In - notcheckedin()); ?> + notcheckedinvol()); ?> Scratch - scratch()); ?> + scratchvol()); ?> Read Only - readonly()); ?> + readonlyvol()); ?> + + + ¹ Stale Storage Pool Volumes ( days) + stalevol()); ?> + + + ² Removable Volumes + removablelibvol()); ?>   @@ -92,39 +100,47 @@ Storage Type - IN: FULL - IN: FILLING - IN: PENDING - IN: EMPTY - OUT: FULL - OUT: FILLING - OUT: PENDING - OUT: EMPTY + + + + + - + + DB VOLS + + dbvolsloc($inout)); ?> +   + + + + +   + + + dbvolstype($inout,$type)); ?> +   + + + + - volstype($type,'in','FULL')); ?> - volstype($type,'in','FILLING')); ?> - volstype($type,'in','PENDING')); ?> - volstype($type,'in','EMPTY')); ?> - volstype($type,'out','FULL')); ?> - volstype($type,'out','FILLING')); ?> - volstype($type,'out','PENDING')); ?> - volstype($type,'out','EMPTY')); ?> + + + volstype($type,$inout,$status)); ?> + + storagepoolstype($type) as $spo) { ?>   - libvolstype('in','FULL')); ?> - libvolstype('in','FILLING')); ?> - libvolstype('in','PENDING')); ?> - libvolstype('in','EMPTY')); ?> - libvolstype('out','FULL')); ?> - libvolstype('out','FILLING')); ?> - libvolstype('out','PENDING')); ?> - libvolstype('out','EMPTY')); ?> + + + libvolstype($inout,$status)); ?> + + @@ -190,7 +206,7 @@ - barcodelabel()); ?> + barcodelabel().($slot->LIBVOLUME->VOLUME->recycle() ? ' ¹' : '').($slot->LIBVOLUME->removable() ? ' ²' : '')); ?> LIBVOLUME->volusage(); ?> LIBVOLUME->status()); ?> LIBVOLUME->VOLUME->display('PCT_UTILIZED'); ?> diff --git a/htdocs/devclass.info.php b/htdocs/devclass.info.php deleted file mode 100644 index 603a8ee..0000000 --- a/htdocs/devclass.info.php +++ /dev/null @@ -1,319 +0,0 @@ -'; -printf('',get_request('cmd','REQUEST')); -printf('',$app['server']->getIndex()); - -echo ''; -echo ''; - -if (isset($_REQUEST['devclass']) && trim($_REQUEST['devclass'])) - foreach ($devclasses->getDevClasses() as $devc => $devclass) { - if ($_REQUEST['devclass'] != $devclass->getName()) - continue; - - echo ''; - printf(_(''),$devc); - - printf('', - $devclass->access, - $devclass->type); - - if (trim($devclass->library)) { - printf('', - $devclass->library); - - printf('', - count($drives->getDrives($devclass->library))); - } - - if (trim($devclass->dir)) - printf('', - $devclass->dir,$devclass->capacity); - - echo '
Device Class%s 
Type'. - classValue(_('%s %s media is used for this device class.'),'value'). - ' 
Library'. - classValue(_('%s library is used to store this media.'),'value'). - ' 
 '. - classValue(_('%s drives defined in this library.'),'value'). - ' 
Local Directory'. - classValue(_('%s directory will contain %s volumes for this device class.'),'value'). - ' 
'; - echo '
'; - printf(_('Storage Pools using device class %s.').'
',$devc); - - $stgcount = 0; - foreach ($stgps->getStoragePools() as $stgp => $stgpool) { - # Ignore storage pools not of this device class. - if ($stgpool->devclass != $devc) continue; - - echo ''; - # Title - echo "\n\n"; - printf('', - $stgpool->getName(),$stgpool->type,$stgpool->access); - - # Utlisation and Migration details - echo "\n\n"; - switch ($stgpool->type) { - case 'PRIMARY' : - switch ($devclass->access) { - case 'Sequential' : - printf('', - $stgpool->utilisation,$stgpool->migratable); - break; - - case 'Random' : - printf('', - $stgpool->utilisation,$stgpool->migratable); - break; - - default : - printf('', - $stgpool->utilisation); - break; - - default : - printf('', - $stgpool->maxsize/1024/1024); - - if ($stgpool->reclaim) - printf('', - $stgpool->reclaim,($stgpool->reclaimstgp ? $stgpool->reclaimstgp : $stgp)); - - if ($stgpool->reclaimrunning) - printf(''); - - if ($stgpool->reuse) - printf('', - $stgpool->reuse); - - # Migration details - if ($stgpool->nextstgp) - printf('', - $stgpool->nextstgp,$stgpool->migr['hi'],$stgpool->migr['low']); - - if ($stgpool->migr['running']) - printf('', - $stgpool->migr['mb'],$stgpool->migr['sec']); - - # Collocation Information - if ($stgpool->collocate) - printf('', - $stgpool->collocate); - - # Disk Caching. - if ($stgpool->cache) - printf('', - $stgpool->cache); - - $stgcount++; - echo ''; - - # Volume information. - echo "\n\n"; - switch ($devclass->type) { - case 'DISK' : - if ($volumes->getStoragePoolVolumes($stgpool->getName())) - foreach ($volumes->getStoragePoolVolumes($stgpool->getName()) as $volume) { - - printf('', - $volume->getName(),$volume->utilisation, - $volume->status['volume'], - $volume->access); - } - break; - - default : - - # Scratch Media - $temp = ''; - if (count($volumes->getStoragePoolScratchVolumes($stgpool->getName()))) - $temp .= sprintf('', - count($volumes->getStoragePoolScratchVolumes($stgpool->getName())),$stgpool->maxscratch); - - if (count($volumes->getStoragePoolDefinedVolumes($stgpool->getName()))) - $temp .= sprintf('', - count($volumes->getStoragePoolDefinedVolumes($stgpool->getName()))); - - if ($temp) { - printf('', - _('Media SCRATCH Status')); - echo $temp; - echo ''; - $temp = ''; - } - - # Media Access - foreach (array('FULL','FILLING','PENDING','EMPTY') as $status) { - if (count($volumes->getStoragePoolVolumesStatus($stgpool->getName(),$status))) - $temp .= sprintf('', - count($volumes->getStoragePoolVolumesStatus($stgpool->getName(),$status)),$status); - } - if ($temp) { - printf('', - _('Media FILLING Status')); - echo $temp; - echo ''; - $temp = ''; - } - - foreach (array('READWRITE','READONLY','UNAVAILABLE','OFFSITE','DESTROYED') as $status) { - if (count($volumes->getStoragePoolVolumesAccess($stgpool->getName(),$status))) - $temp .= sprintf('', - count($volumes->getStoragePoolVolumesAccess($stgpool->getName(),$status)),$status); - } - if ($temp) { - printf('', - _('Media ACCESS Status')); - echo $temp; - echo ''; - $temp = ''; - } - - # Utilisation - $stat['count'] = 0; - $stat['util'] = 0; - $stat['reclaim'] = 0; - $stat['cap'] = 0; - foreach ($volumes->getStoragePoolVolumes($stgpool->getName()) as $volume) { - $stat['util'] += $volume->utilisation; - $stat['reclaim'] += $volume->reclaim; - $stat['cap'] += $volume->estcap; - $stat['count']++; - } - if ($stat['count'] > 0) { - printf('', - _('Media Stats')); - printf('', - $stat['util']/$stat['count']); - printf('', - $stat['reclaim']/$stat['count']); - printf('', - $stat['cap']/$stat['count']); - } - break; - - } - echo ''; - - # Nodes with data in this pool - echo "\n\n"; - $total = 0; - $nodedata = ''; - $counter = 0; - foreach ($occupancy->getStoragePoolTotals($stgpool->getName()) as $node => $typedetails) { - $node = $nodes->getNode($node); - - foreach ($typedetails as $type => $details) { - $nodedata .= sprintf('', - ($counter++%2==0?'even':'odd'), - $node->getName(),$type, - (isset($detail['files']) ? number_format($detail['files']) : ' '), - (count($node->getTapeVolumes($stgpool->getName(),$type)) ? count($node->getTapeVolumes($stgpool->getName(),$type)) : ' '), - isset($details['physical']) ? number_format($details['physical']) : ' '); - - $total += $details['physical']; - } - } - - if ($nodedata) { - echo ''; - echo ''; - } - echo '
%s - %s (%s) 
 '. - classValue(_('%s%% storage capacity utilised with %s%% volumes used.'), - 'value'). - ' 
 '. - classValue(_('%s%% storage capacity utilised with %s%% migratable data.'), - 'value'). - ' 
Unknown access strategy %s.',$devclass->access); - } - break; - - case 'COPY' : - printf('
 '. - classValue(_('%s%% storage capacity utilised.'),'value'). - ' 
%s %s.', - _('Unknown pooltype'),$stgpool->type); - } - - # Max object size - echo "\n\n"; - if ($stgpool->maxsize) - printf('
 '. - classValue(_('%3.2fMB Maximum Object Size.'),'value'). - ' 
 '. - classValue(_('%s%% wasted space is required before reclaimation. Reclamation will use %s'), - 'value'). - ' 
 '. - _('Reclamation IS currently running.'). - ' 
 '. - classValue(_('%s days must pass before volumes will be reused.'),'value'). - ' 
 '. - classValue(_('Migration to %s will occur at %s%% (stopping at %s%%)'),'value'). - ' 
 '. - classValue(_('Migration IS currently running. %sMB Migrated %ss'),'value'). - ' 
 '. - classValue(_('%s Collocation.'),'value'). - ' 
 '. - classValue(_('%s Migration caching.'),'value'). - ' 
 
 '. - classValue(_('Vol %s (%s%% %s) - %s.'),'value'). - ' 
 '. - classValue(_('%s scratch media in use (of %s).'),'value'). - ' 
 '. - classValue(_('%s defined media in use.'),'value'). - ' 
%s
 
 '. - classValue(_('%s media %s.'),'value'). - ' 
%s
 
 '. - classValue(_('%s media %s.'),'value'). - ' 
%s
 
%s
 '. - classValue(_('%3.2f%% average utilisation.'),'value'). - ' 
 '. - classValue(_('%3.2f%% average wasted space.'),'value'). - ' 
 '. - classValue(_('%3.0f MB average capacity.'),'value'). - ' 
 
%s%s%s %s%s MB
'."\n\n"; - echo ''; - printf('', - _('Nodes with data in this storage pool.')); - printf('', - _('Node'),_('Type'),_('Volumes'),_('MB')); - echo $nodedata; - printf('', - _('Total'),number_format($total)); - echo '
%s
%s%s%s%s
%s%s MB
'."\n\n"; - echo '
 
 

'."\n\n"; - } - - if (! $stgcount) - printf('%s
',_('There are no storage pools using this DEVCLASS.')); - - } -?> diff --git a/htdocs/node.summary.php b/htdocs/node.summary.php deleted file mode 100644 index 24d1f42..0000000 --- a/htdocs/node.summary.php +++ /dev/null @@ -1,126 +0,0 @@ -GetActlogBackupSummary($yesterDate,$todayDate); - -# Database Summary Information -$blockTitle['sched'] = sprintf(_('Client Schedule Activity on %s'),$app['server']->getValue('server','name')); -$blockBody['sched'] = ''; - -$blockBody['sched'] .= ''; - -if ($graph) { - $_SESSION['graph']['backupevent'] = $graph; - $blockBody['sched'] .= sprintf('', - $app['server']->getIndex()); -} -$blockBody['sched'] .= '
'; -$blockBody['sched'] .= sprintf('', - 'Client','Schedule','Sched Status','Sched Start'); - -$counter = 0; -$events = $app['server']->GetEvents($yesterDate,$todayDate,'ACTUAL_START'); - -if (count($events['detail'])) { - foreach ($events['detail'] as $index => $tsmEvent) { - $node = $nodes->getNode($tsmEvent['NODE_NAME']); - - $blockBody['sched'] .= sprintf('', - $tsmEvent['STATUS'] == 'Failed' ? 'highlight' : ($counter++%2==0?'even':'odd'), - $node->os, - $node->level['tsm_ver'],$node->level['tsm_rel'],$node->level['tsm_lvl'],$node->level['tsm_slv'], - $tsmEvent['NODE_NAME'], - $tsmEvent['SCHEDULE_NAME'], - $tsmEvent['RESULT'],$tsmEvent['STATUS'], - tsmDate($tsmEvent['ACTUAL_START'])); - - $key = $tsmEvent['STATUS'].' '.$tsmEvent['RESULT']; - @$graph['data'][$tsmEvent['SCHEDULE_NAME']][$key]++; - @$graph['legend'][$key]++; - } - -} else { - $graph = false; - -} -$blockBody['sched'] .= '
%s%s%s%s
%s%s%s%s
'; - -$blockTitle['backup'] = sprintf(_('Client Backup Session Summary on %s'),$app['server']->getValue('server','name')); -$blockBody['backup'] = ''; -$blockBody['backup'] .= sprintf('', - 'Client','Sched','Date','Type','Session','Inspected','Backed Up','Failed','Time','MB','Agg Rate Kb/s','Compressed'); - -$counter = 0; -$summary = $summaryInfo->getSummary($yesterDate,$todayDate); -if (! count($summary)) - $blockBody['backup'] .= sprintf('','No summary'); -else -foreach ($summary as $tsmSession) { - if (! in_array($tsmSession['ACTIVITY'],array('BACKUP','ARCHIVE'))) continue; - - # Summary Information - $client_summary = sprintf('Update: %s, Rebound: %s, Delete: %s, Expire: %s.', - (isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Update']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Update'] : '-'), - (isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Rebound']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Rebound'] : '-'), - (isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Delete']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Delete'] : '-'), - (isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Expire']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Expire'] : '-')); - - $blockBody['backup'] .= sprintf('', - ($counter++%2==0?'even':'odd'), - $tsmSession['ENTITY'], - $tsmSession['SCHEDULE_NAME'], - tsmDate($tsmSession['START_TIME'],'daytime'), - $client_summary, - $tsmSession['ACTIVITY'], - $tsmSession['NUMBER'], - number_format($tsmSession['EXAMINED']), - $tsmSession['AFFECTED'], - (isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Failed']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Failed'] : '-'), - (isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['ProcTime']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['ProcTime'] : '-'), - sprintf('%3.2f',$tsmSession['BYTES']/1024/1024), - (isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['AggRate']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['AggRate'] : '-'), - (isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Compress']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Compress'] : '-')); -} -$blockBody['backup'] .= '
%s%s%s%s%s%s%s%s%s%s%s%s
%s
%s%s%s%s%s%s%s%s%s%s%s%s
'; - -$counter = 0; -$blockTitle['restore'] = sprintf(_('Client Restore Session Summary on %s'),$app['server']->getValue('server','name')); -$blockBody['restore'] = ''; -$blockBody['restore'] .= sprintf('', - 'Client','Time','Session','Type','Restored','Failed','Media W','Time','MB','Agg Rate Kb/s'); - -foreach ($summary as $tsmSession) { - if (! in_array($tsmSession['ACTIVITY'],array('RESTORE','RETRIEVE'))) continue; - - $blockBody['restore'] .= sprintf('', - ($counter++%2==0?'even':'odd'), - $tsmSession['ENTITY'], - tsmDate($tsmSession['START_TIME'],'nosec'), - $tsmSession['NUMBER'], - $tsmSession['ACTIVITY'], - $tsmSession['AFFECTED'], - $tsmSession['FAILED'], - $tsmSession['MEDIAW'], - (isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['ProcTime']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['ProcTime'] : '-'), - sprintf('%3.1fMB',$tsmSession['BYTES']/1024/1024), - (isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['AggRate']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['AggRate'] : '-'), - $tsmSession['SCHEDULE_NAME']); -} -$blockBody['restore'] .= '
%s%s%s%s%s%s%s%s%s%s
%s%s%s%s%s%s%s%s%s%s
'; -# End -render_page($blockTitle,$blockBody); -?> diff --git a/htdocs/volume.info.php b/htdocs/volume.info.php deleted file mode 100644 index 456178c..0000000 --- a/htdocs/volume.info.php +++ /dev/null @@ -1,160 +0,0 @@ -'; - -$blockBody['volinfo'] .= ''; - -# The following COPY VOLUMES in the library can be checked out. -if (count($volumes->libCopyVolumes(true))) { - $blockBody['volinfo'] .= sprintf('',_('The following COPY pool volumes can be checked out of the library(s).')); - $counter = 0; - foreach ($volumes->libCopyVolumes(true) as $volume) { - $blockBody['volinfo'] .= sprintf('', - $counter++%2 ? 'even' : 'odd', - $volume->lib['name'], - isset($volume->location) ? $volume->location : 'InLIB', - $volume->getName(), - $volume->stgpool, - $volume->status['volume'], - $volume->access, - 'N/A', - $volume->utilisation, - $volume->reclaim, - tsmDate($volume->last['read'],'notime'),tsmDate($volume->last['write'],'notime')); - } - $blockBody['volinfo'] .= ''; -} - -# Non-Read/Write Volumes that need to be fixed. -if (count($volumes->nonReadWriteVolumes())) { - $blockBody['volinfo'] .= sprintf('',_('NON READ/WRITE volumes that need to be addressed.')); - $counter = 0; - foreach ($volumes->nonReadWriteVolumes() as $volume) { - $blockBody['volinfo'] .= sprintf('', - $counter++%2 ? 'even' : 'odd', - isset($volume->lib['name']) ? $volume->lib['name'] : ' ', - isset($volume->location) ? $volume->location : 'InLIB', - $volume->name, - $volume->stgpool, - $volume->status['volume'], - $volume->access, - 'N/A', - $volume->utilisation, - $volume->reclaim, - tsmDate($volume->last['read'],'notime'),tsmDate($volume->last['write'],'notime')); - } - $blockBody['volinfo'] .= ''; -} - -# Non-Read/Write Volumes that need to be fixed. -if (count($volumes->reclaimVolumes())) { - $blockBody['volinfo'] .= sprintf('',_('The following volumes should be RECLAIMed (automatically).')); - $counter = 0; - foreach ($volumes->reclaimVolumes() as $volume) { - $blockBody['volinfo'] .= sprintf('', - $counter++%2 ? 'even' : 'odd', - isset($volume->lib['name']) ? $volume->lib['name'] : ' ', - isset($volume->location) ? $volume->location : 'InLIB', - $volume->getName(), - $volume->stgpool, - $volume->status['volume'], - $volume->access, - 'N/A', - $volume->utilisation, - $volume->reclaim, - tsmDate($volume->last['read'],'notime'),tsmDate($volume->last['write'],'notime')); - } - $blockBody['volinfo'] .= ''; -} - -# Following volumes have had errors. -if (count($volumes->errorVolumes())) { - $blockBody['volinfo'] .= sprintf('',_('The following volumes have had ERRORS.')); - $counter = 0; - foreach ($volumes->errorVolumes() as $volume) { - $blockBody['volinfo'] .= sprintf('', - $counter++%2 ? 'even' : 'odd', - isset($volume->lib['name']) ? $volume->lib['name'] : ' ', - isset($volume->location) ? $volume->location : 'InLIB', - $volume->name, - $volume->stgpool, - $volume->status['volume'], - $volume->access, - 'N/A', - $volume->utilisation, - $volume->reclaim, - tsmDate($volume->last['read'],'notime'),$volume->error['read'], - tsmDate($volume->last['write'],'notime'),$volume->error['write']); - } - $blockBody['volinfo'] .= ''; -} - -# Following volumes have not been read/written to for a long time. -if (count($volumes->staleVolumes($app['server']->getValue('system','tapeage')))) { - $blockBody['volinfo'] .= sprintf('',sprintf(_('The following volumes have NOT been read/written to for %s days.'),$app['server']->getValue('system','tapeage'))); - $counter = 0; - foreach ($volumes->staleVolumes($app['server']->getValue('system','tapeage')) as $volume) { - $blockBody['volinfo'] .= sprintf('', - $counter++%2 ? 'even' : 'odd', - isset($volume->lib['name']) ? $volume->lib['name'] : ' ', - isset($volume->location) ? $volume->location : 'InLIB', - $volume->getName(), - $volume->stgpool, - $volume->status['volume'], - $volume->access, - 'N/A', - $volume->utilisation, - $volume->reclaim, - tsmDate($volume->last['read'],'notime'),tsmDate($volume->last['write'],'notime')); - } - $blockBody['volinfo'] .= ''; -} - -# Following volumes are empty or pending. -if (count($volumes->pendingVolumes()) || count($volumes->emptyVolumes())) { - $blockBody['volinfo'] .= sprintf('',_('The following volumes are either EMPTY or PENDING.')); - $counter = 0; - foreach ($volumes->pendingVolumes() as $volume) { - $blockBody['volinfo'] .= sprintf('', - $counter++%2 ? 'even' : 'odd', - isset($volume->lib['name']) ? $volume->lib['name'] : ' ', - isset($volume->location) ? $volume->location : 'InLIB', - $volume->name, - $volume->stgpool, - tsmDate($volume->pending['start'],'notime'),tsmDate($volume->pending['end'],'notime'), - $volume->status['volume'], - $volume->access, - 'N/A', - $volume->utilisation, - $volume->reclaim, - tsmDate($volume->last['read'],'notime'),tsmDate($volume->last['write'],'notime')); - } - $counter = 0; - foreach ($volumes->emptyVolumes() as $volume) { - $blockBody['volinfo'] .= sprintf('', - $counter++%2 ? 'even' : 'odd', - isset($volume->lib['name']) ? $volume->lib['name'] : ' ', - isset($volume->location) ? $volume->location : 'InLIB', - $volume->getName(), - $volume->stgpool, - $volume->status['volume'], - $volume->access, - 'N/A', - $volume->utilisation, - $volume->reclaim, - tsmDate($volume->last['read'],'notime'),tsmDate($volume->last['write'],'notime')); - } -} -$blockBody['volinfo'] .= '
LibrarySlotBarcode/Vol NameUsageStatus/AccessLibrary AccessUtilisationReclaimLast ReadLast Write
%s
%s%s%s%s%s/%s%s%s%%%s%%%s%s
 
%s
%s%s%s%s%s/%s%s%s%%%s%%%s%s
 
%s
%s%s%s%s%s/%s%s%s%%%s%%%s%s
 
%s
%s%s%s%s%s/%s%s%s%%%s%%%s (%s)%s (%s)
 
%s
%s%s%s%s%s/%s%s%s%%%s%%%s%s
 
%s
%s%s%s%s%s/%s%s%s%%%s%%%s%s
%s%s%s%s%s/%s%s%s%%%s%%%s%s
'; - -# End -render_page($blockTitle,$blockBody); -?> diff --git a/lib/config_custom.php b/lib/config_custom.php index 185e439..6a705a0 100644 --- a/lib/config_custom.php +++ b/lib/config_custom.php @@ -10,14 +10,6 @@ /** Available Commands */ -$config->configDefinition('command','devclassinfo',array( - 'summary'=>'Device Class Info', - 'desc'=>'This will show detailed information on your devclasses.', - 'default'=>'devclass.info')); -$config->configDefinition('command','help',array( - 'summary'=>'Help', - 'desc'=>'Help Pages', - 'default'=>'help')); $config->configDefinition('command','libraryinfo',array( 'summary'=>'Library Info', 'desc'=>'Information on Automated Tape Libraries.', @@ -30,10 +22,6 @@ $config->configDefinition('command','nodeoccupancy',array( 'summary'=>'Node Occupancy', 'desc'=>'Summary of Node Occupancy.', 'default'=>'node.occupancy')); -$config->configDefinition('command','nodesummary',array( - 'summary'=>'Node Summary', - 'desc'=>'Summary of Node activities.', - 'default'=>'node.summary')); $config->configDefinition('command','schedulegantt',array( 'summary'=>'Schedule Gantt', 'desc'=>'Gantt view of todays schedules.', @@ -50,10 +38,6 @@ $config->configDefinition('command','serverstats',array( 'summary'=>'Server Stats', 'desc'=>'TSM Server Performance Stats.', 'default'=>'server.stats')); -$config->configDefinition('command','volumeinfo',array( - 'summary'=>'Volume Status', - 'desc'=>'Status Information on Sequential Volumes.', - 'default'=>'volume.info')); $config->configDefinition('command','volumeinventory',array( 'summary'=>'Volume Inventory', 'desc'=>'Information on Volumes.',