More work on library display

This commit is contained in:
Deon George
2011-06-27 14:37:11 +10:00
parent b2c250c319
commit c4ef5e2275
11 changed files with 136 additions and 666 deletions

View File

@@ -1,319 +0,0 @@
<?php
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/devclass.info.php,v 1.13 2009/04/19 03:53:40 wurley Exp $
# Required Libraries
require './common.php';
# @todo: Graph storage by storage pool
# Defaults
$devclasses = objectCache('devclasses');
$volumes = objectCache('volumes');
$drives = objectCache('drives');
$stgps = objectCache('stgps');
$occupancy = objectCache('occupancy');
$nodes = objectCache('nodes');
# Start
echo 'Show device class';
echo '<form action="cmd.php">';
printf('<input type="hidden" name="cmd" value="%s" />',get_request('cmd','REQUEST'));
printf('<input type="hidden" name="index" value="%s" />',$app['server']->getIndex());
echo '<select name="devclass" onchange="javascript:submit()">';
echo '<option value="">&nbsp;</option>';
foreach ($devclasses->getDevClasses() as $devc => $devclass) {
printf('<option value="%s" %s>%s</option>',
$devclass->getName(),
(isset($_REQUEST['devclass']) && ($_REQUEST['devclass'] == $devclass->getName())) ? 'selected' : '',
$devclass->getName());
}
echo '</select>';
echo '</form>';
if (isset($_REQUEST['devclass']) && trim($_REQUEST['devclass']))
foreach ($devclasses->getDevClasses() as $devc => $devclass) {
if ($_REQUEST['devclass'] != $devclass->getName())
continue;
echo '<table width="100%" class="page_detail" border=0>';
printf(_('<tr><td>Device Class</td><td><b>%s</b></td><td>&nbsp;</td></tr>'),$devc);
printf('<tr><td>Type</td><td>'.
classValue(_('%s %s media is used for this device class.'),'value').
'</td><td>&nbsp;</td></tr>',
$devclass->access,
$devclass->type);
if (trim($devclass->library)) {
printf('<tr><td>Library</td><td>'.
classValue(_('%s library is used to store this media.'),'value').
'</td><td>&nbsp;</td></tr>',
$devclass->library);
printf('<tr><td>&nbsp;</td><td>'.
classValue(_('%s drives defined in this library.'),'value').
'</td><td>&nbsp;</td></tr>',
count($drives->getDrives($devclass->library)));
}
if (trim($devclass->dir))
printf('<tr><td>Local Directory</td><td>'.
classValue(_('%s directory will contain %s volumes for this device class.'),'value').
'</td><td>&nbsp;</td></tr>',
$devclass->dir,$devclass->capacity);
echo '</table>';
echo '<br />';
printf(_('Storage Pools using device class %s.').'<br />',$devc);
$stgcount = 0;
foreach ($stgps->getStoragePools() as $stgp => $stgpool) {
# Ignore storage pools not of this device class.
if ($stgpool->devclass != $devc) continue;
echo '<table width="100%" class="result" border=0>';
# Title
echo "\n\n";
printf('<tr><td colspan=2 class="titlel">%s - %s (%s)</td><td class="titlec">&nbsp;</td></tr>',
$stgpool->getName(),$stgpool->type,$stgpool->access);
# Utlisation and Migration details
echo "\n\n";
switch ($stgpool->type) {
case 'PRIMARY' :
switch ($devclass->access) {
case 'Sequential' :
printf('<tr><td>&nbsp;</td><td>'.
classValue(_('%s%% storage capacity utilised with %s%% volumes used.'),
'value').
'</td><td>&nbsp;</td></tr>',
$stgpool->utilisation,$stgpool->migratable);
break;
case 'Random' :
printf('<tr><td>&nbsp;</td><td>'.
classValue(_('%s%% storage capacity utilised with %s%% migratable data.'),
'value').
'</td><td>&nbsp;</td></tr>',
$stgpool->utilisation,$stgpool->migratable);
break;
default :
printf('<tr><td colspan=2>Unknown access strategy %s.</td><td>',$devclass->access);
}
break;
case 'COPY' :
printf('<tr><td>&nbsp;</td><td>'.
classValue(_('%s%% storage capacity utilised.'),'value').
'</td><td>&nbsp;</td></tr>',
$stgpool->utilisation);
break;
default :
printf('<tr><td colspan=2><b>%s</b> %s.</td><td>',
_('Unknown pooltype'),$stgpool->type);
}
# Max object size
echo "\n\n";
if ($stgpool->maxsize)
printf('<tr><td>&nbsp;</td><td>'.
classValue(_('%3.2fMB Maximum Object Size.'),'value').
'</td><td>&nbsp;</td></tr>',
$stgpool->maxsize/1024/1024);
if ($stgpool->reclaim)
printf('<tr><td>&nbsp;</td><td>'.
classValue(_('%s%% wasted space is required before reclaimation. Reclamation will use %s'),
'value').
'</td><td>&nbsp;</td></tr>',
$stgpool->reclaim,($stgpool->reclaimstgp ? $stgpool->reclaimstgp : $stgp));
if ($stgpool->reclaimrunning)
printf('<tr><td>&nbsp;</td><td>'.
_('Reclamation IS currently running.').
'</td><td>&nbsp;</td></tr>');
if ($stgpool->reuse)
printf('<tr><td>&nbsp;</td><td>'.
classValue(_('%s days must pass before volumes will be reused.'),'value').
'</td><td>&nbsp;</td></tr>',
$stgpool->reuse);
# Migration details
if ($stgpool->nextstgp)
printf('<tr><td>&nbsp;</td><td>'.
classValue(_('Migration to %s will occur at %s%% (stopping at %s%%)'),'value').
'</td><td>&nbsp;</td></tr>',
$stgpool->nextstgp,$stgpool->migr['hi'],$stgpool->migr['low']);
if ($stgpool->migr['running'])
printf('<tr><td>&nbsp;</td><td>'.
classValue(_('Migration IS currently running. %sMB Migrated %ss'),'value').
'</td><td>&nbsp;</td></tr>',
$stgpool->migr['mb'],$stgpool->migr['sec']);
# Collocation Information
if ($stgpool->collocate)
printf('<tr><td>&nbsp;</td><td>'.
classValue(_('%s Collocation.'),'value').
'</td><td>&nbsp;</td></tr>',
$stgpool->collocate);
# Disk Caching.
if ($stgpool->cache)
printf('<tr><td>&nbsp;</td><td>'.
classValue(_('%s Migration caching.'),'value').
'</td><td>&nbsp;</td></tr>',
$stgpool->cache);
$stgcount++;
echo '<tr><td>&nbsp;</td></tr>';
# Volume information.
echo "\n\n";
switch ($devclass->type) {
case 'DISK' :
if ($volumes->getStoragePoolVolumes($stgpool->getName()))
foreach ($volumes->getStoragePoolVolumes($stgpool->getName()) as $volume) {
printf('<tr><td>&nbsp;</td><td>'.
classValue(_('Vol %s (%s%% %s) - %s.'),'value').
'</td><td>&nbsp;</td></tr>',
$volume->getName(),$volume->utilisation,
$volume->status['volume'],
$volume->access);
}
break;
default :
# Scratch Media
$temp = '';
if (count($volumes->getStoragePoolScratchVolumes($stgpool->getName())))
$temp .= sprintf('<tr><td>&nbsp;</td><td>'.
classValue(_('%s scratch media in use (of %s).'),'value').
'</td><td>&nbsp;</td></tr>',
count($volumes->getStoragePoolScratchVolumes($stgpool->getName())),$stgpool->maxscratch);
if (count($volumes->getStoragePoolDefinedVolumes($stgpool->getName())))
$temp .= sprintf('<tr><td>&nbsp;</td><td>'.
classValue(_('%s defined media in use.'),'value').
'</td><td>&nbsp;</td></tr>',
count($volumes->getStoragePoolDefinedVolumes($stgpool->getName())));
if ($temp) {
printf('<tr><td colspan=3>%s</td></tr>',
_('Media SCRATCH Status'));
echo $temp;
echo '<tr><td>&nbsp;</td></tr>';
$temp = '';
}
# Media Access
foreach (array('FULL','FILLING','PENDING','EMPTY') as $status) {
if (count($volumes->getStoragePoolVolumesStatus($stgpool->getName(),$status)))
$temp .= sprintf('<tr><td>&nbsp;</td><td>'.
classValue(_('%s media %s.'),'value').
'</td><td>&nbsp;</td></tr>',
count($volumes->getStoragePoolVolumesStatus($stgpool->getName(),$status)),$status);
}
if ($temp) {
printf('<tr><td colspan=3>%s</td></tr>',
_('Media FILLING Status'));
echo $temp;
echo '<tr><td>&nbsp;</td></tr>';
$temp = '';
}
foreach (array('READWRITE','READONLY','UNAVAILABLE','OFFSITE','DESTROYED') as $status) {
if (count($volumes->getStoragePoolVolumesAccess($stgpool->getName(),$status)))
$temp .= sprintf('<tr><td>&nbsp;</td><td>'.
classValue(_('%s media %s.'),'value').
'</td><td>&nbsp;</td></tr>',
count($volumes->getStoragePoolVolumesAccess($stgpool->getName(),$status)),$status);
}
if ($temp) {
printf('<tr><td colspan=3>%s</td></tr>',
_('Media ACCESS Status'));
echo $temp;
echo '<tr><td>&nbsp;</td></tr>';
$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('<tr><td colspan=3>%s</td></tr>',
_('Media Stats'));
printf('<tr><td>&nbsp;</td><td>'.
classValue(_('%3.2f%% average utilisation.'),'value').
'</td><td>&nbsp;</td></tr>',
$stat['util']/$stat['count']);
printf('<tr><td>&nbsp;</td><td>'.
classValue(_('%3.2f%% average wasted space.'),'value').
'</td><td>&nbsp;</td></tr>',
$stat['reclaim']/$stat['count']);
printf('<tr><td>&nbsp;</td><td>'.
classValue(_('%3.0f MB average capacity.'),'value').
'</td><td>&nbsp;</td></tr>',
$stat['cap']/$stat['count']);
}
break;
}
echo '<tr><td>&nbsp;</td></tr>';
# 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('<tr class="%s"><td>%s</td><td>%s</td><td align="right">%s %s</td><td align="right">%s MB</td></tr>',
($counter++%2==0?'even':'odd'),
$node->getName(),$type,
(isset($detail['files']) ? number_format($detail['files']) : '&nbsp;'),
(count($node->getTapeVolumes($stgpool->getName(),$type)) ? count($node->getTapeVolumes($stgpool->getName(),$type)) : '&nbsp;'),
isset($details['physical']) ? number_format($details['physical']) : '&nbsp;');
$total += $details['physical'];
}
}
if ($nodedata) {
echo '<tr><td colspan=2>'."\n\n";
echo '<table class="result_table" border=0>';
printf('<tr><td colspan=4 class="heading">%s</td></tr>',
_('Nodes with data in this storage pool.'));
printf('<tr class="title"><td class="titlel">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td></tr>',
_('Node'),_('Type'),_('Volumes'),_('MB'));
echo $nodedata;
printf('<tr class="highlight"><td colspan=3 class="titlel">%s</td><td class="titler">%s MB</td></tr>',
_('Total'),number_format($total));
echo '</table>'."\n\n";
echo '</td><td>&nbsp;</td></tr>';
echo '<tr><td>&nbsp;</td></tr>';
}
echo '</table><br />'."\n\n";
}
if (! $stgcount)
printf('<b>%s</b><br />',_('There are no storage pools using this DEVCLASS.'));
}
?>

View File

@@ -1,126 +0,0 @@
<?php
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/node.summary.php,v 1.5 2009/04/19 04:00:59 wurley Exp $
# This page should return all a summary of Client activitie, for the last 24 hours.
# @TODO: Need to allow for multiple schedules in 1 day.
# Required Libraries
require './common.php';
# Defaults
$todayDate = date('Y-m-d H:i');
$yesterDate = date('Y-m-d H:i',time()-86400);
$summaryInfo = objectCache('summaryinfo');
$nodes = objectCache('nodes');
# Data collection.
$tsmBackupSummary = $app['server']->GetActlogBackupSummary($yesterDate,$todayDate);
# Database Summary Information
$blockTitle['sched'] = sprintf(_('Client Schedule Activity on %s'),$app['server']->getValue('server','name'));
$blockBody['sched'] = '<table border=0>';
$blockBody['sched'] .= '<tr><td width=100%><table class="result" width=100%>';
$blockBody['sched'] .= sprintf('<tr><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td></tr>',
'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('<tr class="%s"><td><acronym title="%s (%s.%s.%s.%s)">%s</acronym></td><td>%s</td><td><acronym title="Result Code %s">%s</acronym></td><td>%s</td></tr>',
$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'] .= '</table></td>';
if ($graph) {
$_SESSION['graph']['backupevent'] = $graph;
$blockBody['sched'] .= sprintf('<td align="right"><img src="image.backupevents.php?index=%s" /></td>',
$app['server']->getIndex());
}
$blockBody['sched'] .= '</tr></table>';
$blockTitle['backup'] = sprintf(_('Client Backup Session Summary on %s'),$app['server']->getValue('server','name'));
$blockBody['backup'] = '<table class="result">';
$blockBody['backup'] .= sprintf('<tr><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td></tr>',
'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('<tr><td colspan=0>%s</td></tr>','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('<tr class="%s"><td>%s</td><td>%s</td><td>%s</td><td><acronym title="%s">%s</acronym></td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td></tr>',
($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'] .= '</table>';
$counter = 0;
$blockTitle['restore'] = sprintf(_('Client Restore Session Summary on %s'),$app['server']->getValue('server','name'));
$blockBody['restore'] = '<table class="result">';
$blockBody['restore'] .= sprintf('<tr><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td></tr>',
'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('<tr class="%s"><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td></tr>',
($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'] .= '</table>';
# End
render_page($blockTitle,$blockBody);
?>

View File

@@ -1,160 +0,0 @@
<?php
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/volume.info.php,v 1.21 2009/04/19 04:57:32 wurley Exp $
# Required Libraries
require './common.php';
# Defaults
$volumes = objectCache('volumes');
$blockTitle['volinfo'] = 'Volume(s) that may need attention';
$blockBody['volinfo'] = '<br /><table class="result_table" border=0>';
$blockBody['volinfo'] .= '<tr><td class="heading">Library</td><td class="heading">Slot</td><td class="heading">Barcode/Vol Name</td><td class="heading">Usage</td><td class="heading">Status/Access</td><td class="heading">Library Access</td><td class="heading">Utilisation</td><td class="heading">Reclaim</td><td class="heading">Last Read</td><td class="heading">Last Write</td></tr>';
# The following COPY VOLUMES in the library can be checked out.
if (count($volumes->libCopyVolumes(true))) {
$blockBody['volinfo'] .= sprintf('<tr><td colspan=0><b>%s</b></td></tr>',_('The following COPY pool volumes can be checked out of the library(s).'));
$counter = 0;
foreach ($volumes->libCopyVolumes(true) as $volume) {
$blockBody['volinfo'] .= sprintf('<tr class="%s"><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s/%s</td><td>%s</td><td>%s%%</td><td>%s%%</td><td>%s</td><td>%s</td></tr>',
$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'] .= '<tr><td colspan=0>&nbsp;</td></tr>';
}
# Non-Read/Write Volumes that need to be fixed.
if (count($volumes->nonReadWriteVolumes())) {
$blockBody['volinfo'] .= sprintf('<tr><td colspan=0><b>%s</b></td></tr>',_('NON READ/WRITE volumes that need to be addressed.'));
$counter = 0;
foreach ($volumes->nonReadWriteVolumes() as $volume) {
$blockBody['volinfo'] .= sprintf('<tr class="%s"><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s/%s</td><td>%s</td><td>%s%%</td><td>%s%%</td><td>%s</td><td>%s</td></tr>',
$counter++%2 ? 'even' : 'odd',
isset($volume->lib['name']) ? $volume->lib['name'] : '&nbsp;',
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'] .= '<tr><td colspan=0>&nbsp;</td></tr>';
}
# Non-Read/Write Volumes that need to be fixed.
if (count($volumes->reclaimVolumes())) {
$blockBody['volinfo'] .= sprintf('<tr><td colspan=0><b>%s</b></td></tr>',_('The following volumes should be RECLAIMed (automatically).'));
$counter = 0;
foreach ($volumes->reclaimVolumes() as $volume) {
$blockBody['volinfo'] .= sprintf('<tr class="%s"><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s/%s</td><td>%s</td><td>%s%%</td><td>%s%%</td><td>%s</td><td>%s</td></tr>',
$counter++%2 ? 'even' : 'odd',
isset($volume->lib['name']) ? $volume->lib['name'] : '&nbsp;',
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'] .= '<tr><td colspan=0>&nbsp;</td></tr>';
}
# Following volumes have had errors.
if (count($volumes->errorVolumes())) {
$blockBody['volinfo'] .= sprintf('<tr><td colspan=0><b>%s</b></td></tr>',_('The following volumes have had ERRORS.'));
$counter = 0;
foreach ($volumes->errorVolumes() as $volume) {
$blockBody['volinfo'] .= sprintf('<tr class="%s"><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s/%s</td><td>%s</td><td>%s%%</td><td>%s%%</td><td>%s (%s)</td><td>%s (%s)</td></tr>',
$counter++%2 ? 'even' : 'odd',
isset($volume->lib['name']) ? $volume->lib['name'] : '&nbsp;',
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'] .= '<tr><td colspan=0>&nbsp;</td></tr>';
}
# Following volumes have not been read/written to for a long time.
if (count($volumes->staleVolumes($app['server']->getValue('system','tapeage')))) {
$blockBody['volinfo'] .= sprintf('<tr><td colspan=0><b>%s</b></td></tr>',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('<tr class="%s"><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s/%s</td><td>%s</td><td>%s%%</td><td>%s%%</td><td>%s</td><td>%s</td></tr>',
$counter++%2 ? 'even' : 'odd',
isset($volume->lib['name']) ? $volume->lib['name'] : '&nbsp;',
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'] .= '<tr><td colspan=0>&nbsp;</td></tr>';
}
# Following volumes are empty or pending.
if (count($volumes->pendingVolumes()) || count($volumes->emptyVolumes())) {
$blockBody['volinfo'] .= sprintf('<tr><td colspan=0><b>%s</b></td></tr>',_('The following volumes are either EMPTY or PENDING.'));
$counter = 0;
foreach ($volumes->pendingVolumes() as $volume) {
$blockBody['volinfo'] .= sprintf('<tr class="%s"><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td><acronym title="Pending: %s Avail: %s">%s</acronym>/%s</td><td>%s</td><td>%s%%</td><td>%s%%</td><td>%s</td><td>%s</td></tr>',
$counter++%2 ? 'even' : 'odd',
isset($volume->lib['name']) ? $volume->lib['name'] : '&nbsp;',
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('<tr class="%s"><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s/%s</td><td>%s</td><td>%s%%</td><td>%s%%</td><td>%s</td><td>%s</td></tr>',
$counter++%2 ? 'even' : 'odd',
isset($volume->lib['name']) ? $volume->lib['name'] : '&nbsp;',
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'] .= '</table>';
# End
render_page($blockTitle,$blockBody);
?>