Add Storage Pool Info

This commit is contained in:
Deon George 2011-06-23 17:03:41 +10:00
parent 35426141e5
commit 529d70d2bb
12 changed files with 314 additions and 33 deletions

View File

@ -33,14 +33,6 @@ class Controller_DOMAIN extends Controller_TemplateDefault {
$output .= Form::submit('form_submit',_('Go'));
$output .= Form::close();
Script::add(array(
'type'=>'stdin',
'data'=>'
$(document).ready(function () {$("#domain_name").change(function () {
$("#domain_name").trigger("submit");
});});'
));
Block::add(array(
'title'=>_('TSM Domains'),
'body'=>$output,

View File

@ -33,14 +33,6 @@ class Controller_NODE extends Controller_TemplateDefault {
$output .= Form::submit('form_submit',_('Go'));
$output .= Form::close();
Script::add(array(
'type'=>'stdin',
'data'=>'
$(document).ready(function () {$("#node_name").change(function () {
$("#node_detail").trigger("submit");
});});'
));
Block::add(array(
'title'=>_('TSM Nodes'),
'body'=>$output,
@ -71,22 +63,22 @@ $(document).ready(function () {$("#node_name").change(function () {
Block::add(array(
'title'=>sprintf('%s %s',_('Detailed Node Information for'),$no->NODE_NAME),
'body'=>View::factory('nodes/detail')->set('node',$no),
'body'=>View::factory('node/detail')->set('node',$no),
));
Block::add(array(
'title'=>_('Protected File System Information'),
'body'=>View::factory('nodes/detail_filesystem')->set('node',$no),
'body'=>View::factory('node/detail_filesystem')->set('node',$no),
));
Block::add(array(
'title'=>_('Sequential Volume Usage Information'),
'body'=>View::factory('nodes/detail_volumes')->set('node',$no),
'body'=>View::factory('node/detail_volumes')->set('node',$no),
));
Block::add(array(
'title'=>_('Schedule Information'),
'body'=>View::factory('nodes/detail_schedule')->set('node',$no),
'body'=>View::factory('node/detail_schedule')->set('node',$no),
));
}
}

View File

@ -0,0 +1,70 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides information on TSM Storage Pools.
*
* @package PTA
* @subpackage Storage Pools
* @category Controllers
* @author Deon George
* @copyright (c) 2010 phpTSMadmin Development Team
* @license http://phptsmadmin.sf.net/license.html
*/
class Controller_STGPOOL extends Controller_TemplateDefault {
/**
* Default Index for Controller
*/
public function action_index() {
$so = ORM::factory('stgpool');
$output = '';
$output .= sprintf(_('This server has <b>%s</b> stgpool pools.'),$so->count_all());
$output .= '<br/>';
$output .= '<br/>';
$select = array();
$select[NULL] = '';
foreach ($so->find_all() as $stgpool)
$select[$stgpool->STGPOOL_NAME] = $stgpool->STGPOOL_NAME;
$output .= Form::open('/stgpool/detail',array('id'=>'stgpool_detail'));
$output .= sprintf('%s: %s',_('Choose a storage pool to view'),Form::select('stgpool_name',$select,NULL,array('id'=>'stgpool_name')));
$output .= Form::submit('form_submit',_('Go'));
$output .= Form::close();
Block::add(array(
'title'=>_('TSM Storage Pools'),
'body'=>$output,
));
}
public function action_detail($stgpool=NULL) {
if (is_null($stgpool) AND (empty($_POST['stgpool_name']) OR ! $stgpool = $_POST['stgpool_name'])) {
SystemMessage::add(array(
'title'=>_('STGPOOL_NAME is required'),
'type'=>'error',
'body'=>_('The stgpool pool name is required.'),
));
Request::current()->redirect('stgpool');
}
$so = ORM::factory('stgpool',$stgpool);
if (! $so->loaded()) {
SystemMessage::add(array(
'title'=>_('Unknown STGPOOL_NAME'),
'type'=>'error',
'body'=>sprintf(_('The stgpool pool [%s] does not exist?.'),$stgpool),
));
Request::current()->redirect('stgpool');
}
Block::add(array(
'title'=>sprintf(_('Storage Pool Information for %s'),$so->STGPOOL_NAME),
'body'=>View::factory('stgpool/detail')->set('so',$so)
));
}
}
?>

View File

@ -47,6 +47,14 @@ class Controller_Tree extends Controller_lnApp_Tree {
'attr_href'=>URL::Site('server/gantt'),
));
array_push($data,array(
'id'=>'stgpool',
'name'=>'Storage Pool Info',
'state'=>'none',
'attr_id'=>'1',
'attr_href'=>URL::Site('stgpool'),
));
return parent::action_json($id,$data);
}
}

View File

@ -19,5 +19,8 @@ class Model_STGPOOL extends ORMTSM {
protected $_has_one = array(
'DEVCLASSES'=>array('foreign_key'=>'DEVCLASS_NAME','far_key'=>'DEVCLASS'),
);
protected $_has_many = array(
'VOLUME'=>array('foreign_key'=>'STGPOOL_NAME','far_key'=>'STGPOOL_NAME'),
);
}
?>

View File

@ -166,7 +166,7 @@
</tr>
<tr>
<td>
<?php echo View::factory('nodes/policy')->set('domain',$do); ?>
<?php echo View::factory('node/policy')->set('domain',$do); ?>
</td>
</tr>
<tr>

View File

@ -148,7 +148,7 @@
</tr>
<tr>
<td style="width: 50%; vertical-align: top;">
<?php echo View::factory('nodes/policy')->set('domain',$node->DOMAIN); ?>
<?php echo View::factory('node/policy')->set('domain',$node->DOMAIN); ?>
</td>
<td style="width: 50%; vertical-align: top;">
<table class="box-full">

View File

@ -25,18 +25,18 @@
<?php $i=0; foreach ($node->volumes($ctype) as $stgpool => $vols) {
$spo = ORM::factory('STGPOOL',$stgpool); ?>
<tr class="subhead"><td colspan="10"><?php printf('%s: Reclaim: %s%%, Scratch Usage: %s/%s, Device Type: %s',$spo->STGPOOL_NAME,$spo->RECLAIM,$spo->NUMSCRATCHUSED,$spo->MAXSCRATCH,$spo->DEVCLASSES->DEVTYPE); ?></td></tr>
<?php foreach ($vols as $vol) { ?>
<?php foreach ($vols as $vo) { ?>
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
<td class="data"><?php echo $vol->VOLUME_NAME; ?></td>
<td class="data"><?php echo $vol->display('LAST_READ_DATE'); ?></td>
<td class="data"><?php echo $vol->display('LAST_WRITE_DATE'); ?></td>
<td class="data"><?php echo $vol->display('ACCESS'); ?></td>
<td class="data"><?php echo $vol->display('STATUS'); ?></td>
<td class="data-right"><?php printf('%s/%s',$vol->READ_ERRORS,$vol->WRITE_ERRORS); ?></td>
<td class="data-right"><?php echo $vol->display('EST_CAPACITY_MB'); ?></td>
<td class="data-right"><?php echo $vol->display('PCT_RECLAIM'); ?></td>
<td class="data-right"><?php echo $vol->getFSOnVol($ctype); ?></td>
<td class="data-right"><?php echo $vol->getNodesOnVol($ctype); ?></td>
<td class="data"><?php echo $vo->VOLUME_NAME; ?></td>
<td class="data"><?php echo $vo->display('LAST_READ_DATE'); ?></td>
<td class="data"><?php echo $vo->display('LAST_WRITE_DATE'); ?></td>
<td class="data"><?php echo $vo->display('ACCESS'); ?></td>
<td class="data"><?php echo $vo->display('STATUS'); ?></td>
<td class="data-right"><?php printf('%s/%s',$vo->READ_ERRORS,$vo->WRITE_ERRORS); ?></td>
<td class="data-right"><?php echo $vo->display('EST_CAPACITY_MB'); ?></td>
<td class="data-right"><?php echo $vo->display('PCT_RECLAIM'); ?></td>
<td class="data-right"><?php echo $vo->getFSOnVol($ctype); ?></td>
<td class="data-right"><?php echo $vo->getNodesOnVol($ctype); ?></td>
</tr>
<?php } ?>
<?php } ?>

View File

@ -0,0 +1,216 @@
<table width="100%">
<tr>
<td style="width: 50%; vertical-align: top;">
<table class="box-full">
<tr>
<td class="head" colspan="5">Information for this Storage Pool</td>
</tr>
<tr>
<td class="spacer">&nbsp;</td>
</tr>
<tr>
<td style="width: 40%;">Description</td>
<td style="width: 60%;" class="data"><?php echo $so->display('DESCRIPTION'); ?></td>
</tr>
<tr>
<td>Type</td>
<td class="data"><?php echo $so->display('POOLTYPE'); ?></td>
</tr>
<tr>
<td>Est Capacity</td>
<td class="data"><?php echo $so->display('EST_CAPACITY_MB'); ?></td>
</tr>
<tr>
<td>Util %</td>
<td class="data"><?php echo $so->display('PCT_UTILIZED'); ?></td>
</tr>
<?php if ($so->DEVCLASS != 'DISK') { ?>
<tr>
<td>Scratch Vols</td>
<td class="data"><?php printf('%s/%s',$so->NUMSCRATCHUSED,$so->MAXSCRATCH); ?></td>
</tr>
<tr>
<td>Volume Reuse Delay</td>
<td class="data"><?php echo $so->display('REUSEDELAY'); ?></td>
</tr>
<?php } ?>
<tr>
<td>Access</td>
<td class="data"><?php echo $so->display('ACCESS'); ?></td>
</tr>
<tr>
<td>Max Object Size</td>
<td class="data"><?php echo $so->display('MAXSIZE'); ?></td>
</tr>
<tr>
<td>Collate</td>
<td class="data"><?php echo $so->display('COLLOCATE'); ?></td>
</tr>
<?php if ($so->DEVCLASS === 'DISK') { ?>
<tr>
<td>Cache Migrated Files</td>
<td class="data"><?php echo $so->display('CACHE'); ?></td>
</tr>
<?php } else { ?>
<tr>
<td>Reclaim %</td>
<td class="data"><?php echo $so->display('RECLAIM'); ?></td>
</tr>
<tr>
<td>Reclaim Processes</td>
<td class="data"><?php echo $so->display('RECLAIMPROCESS'); ?></td>
</tr>
<tr>
<td>Reclaim Storage Pool</td>
<td class="data"><?php echo $so->display('RECLAIMSTGPOOL'); ?></td>
</tr>
<?php } ?>
<tr>
<td class="spacer">&nbsp;</td>
</tr>
<tr>
<td>Next Pool</td>
<?php if ($so->NEXTSTGPOOL AND $so->POOLTYPE === 'PRIMARY') { ?>
<td class="data"><?php echo $so->display('NEXTSTGPOOL'); ?></td>
</tr>
<tr>
<td>Migratable %</td>
<td class="data"><?php echo $so->display('PCT_MIGR'); ?></td>
</tr>
<tr>
<td>Hi/Low Migration</td>
<td class="data"><?php printf('%s/%s',$so->HIGHMIG,$so->LOWMIG); ?></td>
</tr>
<tr>
<td>Migration Delay</td>
<td class="data"><?php echo $so->display('MIGDELAY'); ?></td>
</tr>
<tr>
<td>Migration Continue</td>
<td class="data"><?php echo $so->display('MIGCONTINUE'); ?></td>
</tr>
<tr>
<td>Last Migration Time</td>
<td class="data"><?php echo $so->display('MIGR_SECONDS'); ?></td>
</tr>
<tr>
<td>Last Migration Data</td>
<td class="data"><?php echo $so->display('MIGR_MB'); ?></td>
<?php } elseif (! $so->NEXTSTGPOOL AND $so->POOLTYPE === 'PRIMARY') { ?>
<td class="data"><?php echo _('No migration enabled'); ?></td>
<?php } ?>
</tr>
<tr>
<td class="spacer">&nbsp;</td>
</tr>
<tr>
<td>Active Data Pools</td>
<td class="data"><?php echo $so->display('ACTIVEDATASTGPOOLS'); ?></td>
</tr>
<tr>
<td>Copy Pools</td>
<td class="data"><?php echo $so->display('COPYSTGPOOLS'); ?></td>
</tr>
<tr>
<td>Copy Continue</td>
<td class="data"><?php echo $so->display('COPYCONTINUE'); ?></td>
</tr>
</table>
</td>
<td style="width: 50%; vertical-align: top;">
<table class="box-full">
<tr>
<td class="head" colspan="5">Device Class information</td>
</tr>
<tr>
<td class="spacer">&nbsp;</td>
</tr>
<tr>
<td style="width: 40%;">Access</td>
<td style="width: 60%;" class="data"><?php echo $so->DEVCLASSES->display('ACCESS_STRATEGY'); ?></td>
</tr>
<tr>
<td>Total Storage Pools</td>
<td class="data"><?php echo $so->DEVCLASSES->display('STGPOOL_COUNT'); ?></td>
</tr>
<tr>
<td>Device Type</td>
<td class="data"><?php echo $so->DEVCLASSES->display('DEVTYPE'); ?></td>
</tr>
<tr>
<td>Format</td>
<td class="data"><?php echo $so->DEVCLASSES->display('FORMAT'); ?></td>
</tr>
<tr>
<td>Capacity</td>
<td class="data"><?php echo $so->DEVCLASSES->display('CAPACITY'); ?></td>
</tr>
<tr>
<td>Mount Limit</td>
<td class="data"><?php echo $so->DEVCLASSES->display('MOUNTLIMIT'); ?></td>
</tr>
<?php if ($so->DEVCLASSES->DEVTYPE == 'FILE') { ?>
<tr>
<td>Directory</td>
<td class="data"><?php echo $so->DEVCLASSES->display('DIRECTORY'); ?></td>
</tr>
<?php } else { ?>
<tr>
<td>Library</td>
<td class="data"><?php echo $so->DEVCLASSES->display('LIBRARY_NAME'); ?></td>
</tr>
<tr>
<td>Mount Wait</td>
<td class="data"><?php echo $so->DEVCLASSES->display('MOUNTWAIT'); ?></td>
</tr>
<tr>
<td>Mount Retention</td>
<td class="data"><?php echo $so->DEVCLASSES->display('MOUNTRETENTION'); ?></td>
</tr>
<?php } ?>
</table>
</td>
</tr>
<tr>
<td style="width: 100%; vertical-align: top;" colspan="2">
<table class="box-full">
<tr>
<td class="head" colspan="5">Volumes in this Storage Pool</td>
</tr>
<tr>
<td class="spacer">&nbsp;</td>
</tr>
<tr>
<td>Volume</td>
<td>Last Read Date</td>
<td>Last Write Date</td>
<td>Access</td>
<td>Status</td>
<td class="right">Errors R/W</td>
<td class="right">Util %</td>
<td class="right">Reclaim</td>
<?php foreach (Kohana::config('config.tsmdatatypes') as $btype => $ctype) { ?>
<td class="right"><?php echo 'FS '.$btype; ?></td>
<td class="right"><?php echo 'Node '.$btype; ?></td>
<?php } ?>
</tr>
<?php $i=0; foreach ($so->VOLUME->find_all() as $vo) { ?>
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
<td class="data"><?php echo $vo->display('VOLUME_NAME'); ?></td>
<td class="data"><?php echo $vo->display('LAST_READ_DATE'); ?></td>
<td class="data"><?php echo $vo->display('LAST_WRITE_DATE'); ?></td>
<td class="data"><?php echo $vo->display('ACCESS'); ?></td>
<td class="data"><?php echo $vo->display('STATUS'); ?></td>
<td class="data-right"><?php printf('%s/%s',$vo->READ_ERRORS,$vo->WRITE_ERRORS); ?></td>
<td class="data-right"><?php echo $vo->display('EST_CAPACITY_MB'); ?></td>
<td class="data-right"><?php echo $vo->display('PCT_RECLAIM'); ?></td>
<?php foreach (Kohana::config('config.tsmdatatypes') as $btype => $ctype) { ?>
<td class="data-right"><?php echo $vo->getFSOnVol($ctype); ?></td>
<td class="data-right"><?php echo $vo->getNodesOnVol($ctype); ?></td>
<?php } ?>
</tr>
<?php } ?>
</table>
</td>
</tr>
</table>