getValue('server','name')); $blockBody['graph'] = ''; $blockTitle['occ'] = sprintf(_('Client Occupancy Summary on %s'),$app['server']->getValue('server','name')); $blockBody['occ'] = '
'; $counter = 0; $grandtotal = 0; # Work out our stgpools with data in them. $stgpooltotal = array(); $blockBody['occ'] .= sprintf('', 'Node','Last Acc','Type'); foreach ($nodes->getNodes() as $node) { foreach ($node->getStoragePools() as $stgp) { if (! isset($stgpooltotal[$stgp])) { $blockBody['occ'] .= sprintf('',$stgp); $stgpooltotal[$stgp] = 0; } } } $blockBody['occ'] .= sprintf('','Total'); # Now show the nodes having data in the stgpools. $history = array(); foreach ($nodes->getNodes() as $node) { foreach ($node->getOccupancy() as $type => $stgpools) { $nodetotal = 0; $blockBody['occ'] .= sprintf('', ($counter++%2==0?'even':'odd'), $node->getName(), tsmDate($node->time['lastacc'],'notime'), $type); foreach ($stgpooltotal as $stgpool => $details) { if (isset($stgpools[$stgpool])) { $blockBody['occ'] .= sprintf('',number_format($stgpools[$stgpool]['physical'])); $nodetotal += $stgpools[$stgpool]['physical']; $stgpooltotal[$stgpool] += $stgpools[$stgpool]['physical']; } else $blockBody['occ'] .= sprintf('',' '); } $blockBody['occ'] .= sprintf('',number_format($nodetotal)); $grandtotal += $nodetotal; $oldtime = strtotime(tsmDate($node->time['lastacc'],'sec')); $diff = round((time() - $oldtime)/86400); @$history[$diff] += $nodetotal; } } # Store our history information for when we call the graphing php. $_SESSION['graph']['occupancy'] = $history; ksort($_SESSION['graph']['occupancy']); # Show our dbbackup graph $blockBody['graph'] .= ''; $blockBody['graph'] .= ''; $blockBody['graph'] .= sprintf('', $app['server']->getIndex()); $blockBody['graph'] .= '
%s%s%s%s%s
%s%s%s%s%s %s
'; $blockBody['graph'] .= sprintf('','Days Since Access','Storage Used'); $counter = 0; foreach ($_SESSION['graph']['occupancy'] as $age => $size) { $blockBody['graph'] .= sprintf('', ($counter++%2==0?'even':'odd'),$age,number_format($size),sprintf('%2.1f%%',$size/$grandtotal*100)); } $blockBody['graph'] .= '
%s%s%%
%s%s%s
 
'; $blockBody['occ'] .= sprintf('%s','TOTAL'); foreach ($stgpooltotal as $stgpool => $total) $blockBody['occ'] .= sprintf('%s',number_format($total)); $blockBody['occ'] .= sprintf(' %s',number_format($grandtotal)); $blockBody['occ'] .= ''; # End render_page($blockTitle,$blockBody); ?>