getLibraries()) {
foreach ($libraries->getLibraries() as $library) {
printf(_('Information on libraries %s.'),$library->getName());
echo '
';
# Does this library support show slots?
if (isset($library->slots)) {
printf(''.
classValue(_('This is a %s library, with %s slots and %s drives.'),'value').
' | |
',
$library->getAttr('ProductId'),
$library->getAttr('Slots'),
$library->getAttr('Drives'));
# Show the drives
foreach ($library->getDrives() as $drive) {
printf(' | '.
classValue(_('Drive %s (Status %s).'),'value').
' | |
',
$drive->getName(),
$drive->volume ? sprintf('%s-%s',$drive->status,$drive->volume) : $drive->status);
}
echo ' |
';
# Library Configuration
printf(' | '.
classValue(_('%s shared library.'),'value').
' | |
',
$library->shared);
printf(' | '.
classValue(_('%s auto label.'),'value').
' | |
',
($library->autolabel ? $library->autolabel : 'NO'));
# Volume Details
printf(' | '.
classValue(_('%s slots with NO volumes.'),'value').
' | |
',
$library->getAttr('Slots') - count($library->slots));
printf(' | '.
classValue(_('%s volumes physically in this library.'),'value').
' | |
',
count($library->slotVolumes(true))+count($library->slotVolumes(false)));
printf(' | '.
classValue(_('%s volumes NOT checked in.'),'value').
' | |
',
count($library->slotVolumes(false)));
printf(' | '.
classValue(_('%s volumes are checked into this library.'),'value').
' | |
',
count($library->slotVolumes(true)));
printf(' | | '.
classValue(_('%s EMPTY volumes.'),'value').
' | |
',
count($library->getLibraryEmpty()));
printf(' | | '.
classValue(_('%s PENDING volumes.'),'value').
' | |
',
count($library->getLibraryPending()));
printf(' | | '.
classValue(_('%s SCRATCH volumes.'),'value').
' | |
',
count($library->getLibraryScratch()));
echo ' |
';
# Volumes in Library.
printf('%s |
',
_('The following volumes are currently in this library:'));
echo '';
echo 'Slot | Barcode/Vol Name | Usage | Status/Access | Library Access | Utilisation | Reclaim | Last Read | Last Write | ';
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 '';
elseif ($slot['status'] == 'Full')
echo ' ';
else
echo ' ';
printf('%s | %s | %s | %s | %s | %s | %s | %s | %s | ',
$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 ' |
';
echo ' |
';
} else {
printf(''.
classValue(_('This is a %s library'),'value').
' | |
',
$library->type);
# Show the drives
foreach ($library->getDrives() as $drive) {
printf(' | '.
classValue(_('Drive %s (Status %s).'),'value').
' | |
',
$drive->getName(),
$drive->volume ? sprintf('%s-%s',$drive->status,$drive->volume) : $drive->status);
}
echo ' |
';
}
echo '
';
}
} else {
echo _('No Library');
printf('