167 lines
7.0 KiB
PHP
167 lines
7.0 KiB
PHP
<?php
|
|
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/library.info.php,v 1.21 2008/08/14 06:44:39 wurley Exp $
|
|
|
|
# @todo: It would be nice, if show slots hasnt been run, that we display a message to run audit libr. Then we will know that slots are empty, and be able to show that correctly.
|
|
|
|
# Required Libraries
|
|
require './common.php';
|
|
|
|
# Data collection.
|
|
$libraries = objectCache('libraries');
|
|
$volumes = objectCache('volumes');
|
|
$stgpools = objectCache('stgps');
|
|
|
|
# Library
|
|
if ($libraries->getLibraries()) {
|
|
foreach ($libraries->getLibraries() as $library) {
|
|
|
|
printf(_('Information on libraries %s.'),$library->getName());
|
|
echo '<table width="100%" class="result" border=0>';
|
|
|
|
# Does this library support show slots?
|
|
if (isset($library->slots)) {
|
|
|
|
printf('<tr><td colspan=3>'.
|
|
classValue(_('This is a %s library, with %s slots and %s drives.'),'value').
|
|
'</td><td> </td></tr>',
|
|
$library->getAttr('ProductId'),
|
|
$library->getAttr('Slots'),
|
|
$library->getAttr('Drives'));
|
|
|
|
# Show the drives
|
|
foreach ($library->getDrives() as $drive) {
|
|
printf('<tr><td> </td><td colspan=2>'.
|
|
classValue(_('Drive %s (Status %s).'),'value').
|
|
'</td><td> </td></tr>',
|
|
$drive->getName(),
|
|
$drive->volume ? sprintf('%s-%s',$drive->status,$drive->volume) : $drive->status);
|
|
}
|
|
echo '<tr><td colspan=3> </td></tr>';
|
|
|
|
# Library Configuration
|
|
printf('<tr><td> </td><td colspan=2>'.
|
|
classValue(_('%s shared library.'),'value').
|
|
'</td><td> </td></tr>',
|
|
$library->shared);
|
|
|
|
printf('<tr><td> </td><td colspan=2>'.
|
|
classValue(_('%s auto label.'),'value').
|
|
'</td><td> </td></tr>',
|
|
($library->autolabel ? $library->autolabel : 'NO'));
|
|
|
|
# Volume Details
|
|
printf('<tr><td> </td><td colspan=2>'.
|
|
classValue(_('%s slots with NO volumes.'),'value').
|
|
'</td><td> </td></tr>',
|
|
$library->getAttr('Slots') - count($library->slots));
|
|
|
|
printf('<tr><td> </td><td colspan=2>'.
|
|
classValue(_('%s volumes physically in this library.'),'value').
|
|
'</td><td> </td></tr>',
|
|
count($library->slotVolumes(true))+count($library->slotVolumes(false)));
|
|
|
|
printf('<tr><td> </td><td colspan=2>'.
|
|
classValue(_('%s volumes NOT checked in.'),'value').
|
|
'</td><td> </td></tr>',
|
|
count($library->slotVolumes(false)));
|
|
|
|
printf('<tr><td> </td><td colspan=2>'.
|
|
classValue(_('%s volumes are checked into this library.'),'value').
|
|
'</td><td> </td></tr>',
|
|
count($library->slotVolumes(true)));
|
|
|
|
printf('<tr><td> </td><td> </td><td>'.
|
|
classValue(_('%s EMPTY volumes.'),'value').
|
|
'</td><td> </td></tr>',
|
|
count($library->getLibraryEmpty()));
|
|
|
|
printf('<tr><td> </td><td> </td><td>'.
|
|
classValue(_('%s PENDING volumes.'),'value').
|
|
'</td><td> </td></tr>',
|
|
count($library->getLibraryPending()));
|
|
|
|
printf('<tr><td> </td><td> </td><td>'.
|
|
classValue(_('%s SCRATCH volumes.'),'value').
|
|
'</td><td> </td></tr>',
|
|
count($library->getLibraryScratch()));
|
|
|
|
echo '<tr><td colspan=4> </td></tr>';
|
|
|
|
# Volumes in Library.
|
|
printf('<tr><td colspan=3>%s</td></tr>',
|
|
_('The following volumes are currently in this library:'));
|
|
echo '<tr><td colspan=3><table width="100%" class="result_table" border=0>';
|
|
echo '<tr><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>';
|
|
|
|
foreach ($library->slots as $slotnum => $slot) {
|
|
if (isset($slot['barcodelabel']) && strlen($slot['barcodelabel']))
|
|
$volname = $slot['barcodelabel'];
|
|
elseif ($volumes->inElement($library->getName(),$slotnum))
|
|
$volname = $volumes->inElement($library->getName(),$slotnum);
|
|
else
|
|
$volname = 'No Barcode Label';
|
|
|
|
if ($volname && isset($volumes->volumes[$volname]->status['library']) && $volumes->volumes[$volname]->status['library'] == 'Scratch')
|
|
echo '<tr class="highlight">';
|
|
elseif ($slot['status'] == 'Full')
|
|
echo '<tr class="shadow">';
|
|
else
|
|
echo '<tr class="'.(@$counter++%2==0?'even':'odd').'">';
|
|
|
|
printf('<td><acronym title="Element: %s">%s</acronym></td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td><acronym title="Storage Pool Reclaim: %s">%s</acronym></td><td>%s</td><td>%s</td></tr>',
|
|
$slotnum,
|
|
$slot['slot'],
|
|
$volname,
|
|
isset($volumes->volumes[$volname]->stgpool) ? $volumes->volumes[$volname]->stgpool :
|
|
(isset($volumes->volumes[$volname]->dbv['type']) ? $volumes->volumes[$volname]->dbv['type'] : ' '),
|
|
|
|
isset($volumes->volumes[$volname]->status['volume']) ? sprintf('%s/%s',$volumes->volumes[$volname]->status['volume'],$volumes->volumes[$volname]->access) :
|
|
(isset($volumes->volumes[$volname]->dbv) ?
|
|
sprintf('%s.%s.%s',$volumes->volumes[$volname]->dbv['series'],
|
|
$volumes->volumes[$volname]->dbv['operation'],$volumes->volumes[$volname]->dbv['sequence']) : ' '),
|
|
|
|
(isset($library->slots[$slotnum]['status']) && $library->slots[$slotnum]['status'] == 'Allocated') ?
|
|
isset($volumes->volumes[$volname]->status['library']) ? $volumes->volumes[$volname]->status['library'].'/'.$volumes->volumes[$volname]->lib['owner'] : ' ' :
|
|
_('*NOT CHECKED IN*'),
|
|
|
|
(isset($volumes->volumes[$volname]->status['volume']) && $volumes->volumes[$volname]->status['volume'] == 'PENDING') ?
|
|
tsmDate($volumes->volumes[$volname]->pending['start'],'notime') :
|
|
isset($volumes->volumes[$volname]->utilisation) ? $volumes->volumes[$volname]->utilisation.'%' : ' ',
|
|
|
|
isset($volumes->volumes[$volname]->stgpool) ? $stgpools->getReclaim($volumes->volumes[$volname]->stgpool).'%' : 'N/A',
|
|
|
|
isset($volumes->volumes[$volname]->reclaim) ? $volumes->volumes[$volname]->reclaim.'%' : ' ',
|
|
|
|
isset($volumes->volumes[$volname]->last['read']) ? tsmDate($volumes->volumes[$volname]->last['read'],'notime') : ' ',
|
|
isset($volumes->volumes[$volname]->last['write']) ? tsmDate($volumes->volumes[$volname]->last['write'],'notime') :
|
|
(isset($volumes->volumes[$volname]->dbv) ? tsmDate($volumes->volumes[$volname]->dbv['date'],'notime') : ' '));
|
|
}
|
|
|
|
echo '</table></td></tr>';
|
|
echo '<tr><td colspan=3> </td></tr>';
|
|
|
|
} else {
|
|
printf('<tr><td colspan=2>'.
|
|
classValue(_('This is a %s library'),'value').
|
|
'</td><td> </td></tr>',
|
|
$library->type);
|
|
|
|
# Show the drives
|
|
foreach ($library->getDrives() as $drive) {
|
|
printf('<tr><td> </td><td>'.
|
|
classValue(_('Drive %s (Status %s).'),'value').
|
|
'</td><td> </td></tr>',
|
|
$drive->getName(),
|
|
$drive->volume ? sprintf('%s-%s',$drive->status,$drive->volume) : $drive->status);
|
|
}
|
|
echo '<tr><td colspan=3> </td></tr>';
|
|
}
|
|
echo '</table>';
|
|
}
|
|
} else {
|
|
echo _('No Library');
|
|
printf('<table><tr><td colspan=3>%s</td></tr></table>',
|
|
_('There are no automated libraries defined to this TSM server.'));
|
|
}
|
|
?>
|