Added DB and removed some old interface scripts

This commit is contained in:
Deon George 2012-11-30 15:29:08 +11:00
parent 1bf8a520e2
commit 74b3bfb408
19 changed files with 226 additions and 585 deletions

70
INSTALL
View File

@ -1,70 +0,0 @@
$Header: /cvsroot/phptsmadmin/phpTSMadmin/INSTALL,v 1.5 2008/01/15 10:50:41 wurley Exp $
* Requirements
phpTSMadmin is a PHP5 application. It wont work on PHP4. If you are using CentOS 4 or RedHat
Enterprise Linux v4, then you can get PHP5 from the centosplus repository.
The requirements below are those used by RedHat Enterprise Linux v5.0 system. It is quite
possible that other versions of these components, or other distributions of Linux will also
work as well.
If you encounter any problems with other versions, then drop us an email with
the error messages, what you did and what you expected, and if we need to make some code changes
to get it to work, then we'll take a look.
* Apache 2.0.x
* PHP 5.1.x
* TSM Client 5.x (our tests were done on a 5.4.1 TSM server).
* Additional Requirements that are optional.
We also use a fantastic tool called JpGraph, that takes care of the Gantt charts. It is recommended that
you download and install that tool. You can get JpGraph at:
http://www.aditus.nu/jpgraph
You'll need at least v2.x our testing was with 2.3.
Once downloaded, untar jpgraph in the libs directory, then update your config.php to reflect the path.
* Installation
These steps assume that you have installed, configured and running:
* Linux server,
* Apache installed, configured and running,
* PHP installed, configured if necessary and running with apache,
* TSM client installed, configured and working.
* JpGraph (if you choose to use it - which you should).
1. Download the latest version.
You can download phpTSMadmin from sourceforge. http://phpTSMadmin.sf.net
2. Unpack the tar files in an appropriate directory.
cd /var/www/phpTSMadmin (or any other directory that you choose)
tar xzf phpTSMadmin-XXXX.tgz
3. Configure your webserver.
Find the sample apache config file in the contrib directory. Place that in
your /etc/httpd/conf.d directory.
Edit the sample apache config file as appropriate and restart your web server.
Also make sure that in your php.ini configuration file, you have set "memory_limit" to
at leat 16M. If this is set too low, then your grantt charts will fail to be created
and your apache error log will have "Allowed memory size of X bytes exhausted" error
messages.
4. Copy config.php.example in the config directory to config/config.php and edit to
suite your environment.
Edit the phpTSMadmin's config.php file, making sure you define:
* TSM client configuration
* Jpgraph path
5. Make the following directories.
mkdir htdocs/tmp; chmod 777 htdocs/tmp
6. Then, point your browser to your phpTSMadmin URL.
* For help
Drop me an email phptsmadmin-devel@lists.sourceforge.net.

View File

@ -0,0 +1,22 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class provides information on TSM Nodes.
*
* @package PTA
* @subpackage Domains
* @category Controllers
* @author Deon George
* @copyright (c) 2010 phpTSMadmin Development Team
* @license http://phptsmadmin.sf.net/license.html
*/
class Controller_Db extends Controller_TemplateDefault{
public function action_index() {
// @todo Does the DB name have different names?
Block::add(array(
'title'=>_('Database Information'),
'body'=>View::factory(sprintf('%s/detail',strtolower($this->request->controller())))->set('o',ORM::factory('DB','TSMDB1')),
));
}
}
?>

View File

@ -31,6 +31,14 @@ class Controller_Tree extends lnApp_Controller_Tree {
'attr_href'=>URL::Site('domain'), 'attr_href'=>URL::Site('domain'),
)); ));
array_push($data,array(
'id'=>'db',
'name'=>'DB Info',
'state'=>'none',
'attr_id'=>'1',
'attr_href'=>URL::Site('db'),
));
array_push($data,array( array_push($data,array(
'id'=>'library', 'id'=>'library',
'name'=>'Library Info', 'name'=>'Library Info',

View File

@ -0,0 +1,60 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
*
* @package PTA
* @subpackage Database
* @category Models
* @author Deon George
* @copyright (c) 2010 phpTSMadmin Development Team
* @license http://phptsmadmin.sf.net/license.html
*/
class Model_DB extends TSM_ORM {
protected $_table_name = 'DB';
protected $_primary_key = 'DATABASE_NAME';
protected $_sorting = array(
'DATABASE_NAME'=>'ASC',
);
protected $_display_filters = array(
'FREE_PAGES'=>array(
array('number_format',array(':value',0)),
),
'FREE_SPACE_MB'=>array(
array('number_format',array(':value',0)),
),
'LAST_REORG'=>array(
array('TSM_ORM::date',array(':value','d-M H:i')),
),
'LAST_BACKUP_DATE'=>array(
array('TSM_ORM::date',array(':value','d-M H:i')),
),
'TOTAL_BUFF_REQ'=>array(
array('number_format',array(':value',0)),
),
'TOT_FILE_SYSTEM_MB'=>array(
array('number_format',array(':value',0)),
),
'TOTAL_PAGES'=>array(
array('number_format',array(':value',0)),
),
'USED_DB_SPACE_MB'=>array(
array('number_format',array(':value',0)),
),
'USABLE_PAGES'=>array(
array('number_format',array(':value',0)),
),
'USED_PAGES'=>array(
array('number_format',array(':value',0)),
),
);
public function backups() {
return ORM::factory('VOLHISTORY')->where('TYPE','IN',Kohana::$config->load('config')->tsmdbtypes)->find_all();
}
public function vols() {
return ORM::factory('DBSPACE')->find_all();
}
}
?>

View File

@ -0,0 +1,31 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
*
* @package PTA
* @subpackage Database
* @category Models
* @author Deon George
* @copyright (c) 2010 phpTSMadmin Development Team
* @license http://phptsmadmin.sf.net/license.html
*/
class Model_DBSPACE extends TSM_ORM {
protected $_table_name = 'DBSPACE';
protected $_primary_key = 'LOCATION';
protected $_sorting = array(
'LOCATION'=>'ASC',
);
protected $_display_filters = array(
'FREE_SPACE_MB'=>array(
array('number_format',array(':value',0)),
),
'TOTAL_FS_SIZE_MB'=>array(
array('number_format',array(':value',0)),
),
'USED_FS_SIZE_MB'=>array(
array('number_format',array(':value',0)),
),
);
}
?>

View File

@ -0,0 +1,27 @@
<!-- $o = ORM::factory('DB') -->
<table class="box-full">
<tr>
<td class="head" colspan="5">Database Backup Volumes</td>
</tr>
<tr>
<td class="spacer">&nbsp;</td>
</tr>
<tr>
<td>Date</td>
<td>Seq</td>
<td>Type</td>
<td>Device</td>
<td>Volume</td>
<td>Location</td>
</tr>
<?php $i=0; foreach ($o->backups() as $vo) { ?>
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
<td class="data"><?php echo $vo->display('DATE_TIME'); ?></td>
<td class="data"><?php echo $vo->backupid(); ?></td>
<td class="data"><?php echo $vo->display('TYPE'); ?></td>
<td class="data"><?php echo $vo->display('DEVCLASS'); ?></td>
<td class="data"><?php echo $vo->display('VOLUME_NAME'); ?></td>
<td class="data"><?php echo $vo->display('LOCATION'); ?></td>
</tr>
<?php } ?>
</table>

View File

@ -0,0 +1,9 @@
<table width="100%">
<tr>
<td style="width: 50%; vertical-align: top;"><?php echo View::factory('db/info')->set('o',$o); ?></td>
<td style="width: 50%; vertical-align: top;"><?php echo View::factory('db/volumes')->set('o',$o); ?></td>
</tr>
<tr>
<td style="width: 100%; vertical-align: top;" colspan="2"><?php echo View::factory('db/backups')->set('o',$o); ?></td>
</tr>
</table>

View File

@ -0,0 +1,41 @@
<!-- $o = ORM::factory('DB') -->
<table class="box-full">
<tr>
<td class="head" colspan="2">Database Information</td>
</tr>
<tr>
<td class="spacer">&nbsp;</td>
</tr>
<tr>
<td style="width: 40%;">Database Name</td>
<td style="width: 60%;" class="data"><?php echo $o->display('DATABASE_NAME'); ?></td>
</tr>
<tr>
<td>Space</td>
<td class="data"><?php printf('%sMB Free/ %sMB Used/ %sMB Total',$o->display('FREE_SPACE_MB'),$o->display('USED_DB_SPACE_MB'),$o->display('TOT_FILE_SYSTEM_MB')); ?></td>
</tr>
<tr>
<td>Database Pages</td>
<td class="data"><?php printf('%s Free/ %s Used/ %s Total (%s Usable)',$o->display('FREE_PAGES'),$o->display('USED_PAGES'),$o->display('TOTAL_PAGES'),$o->display('USABLE_PAGES')); ?></td>
</tr>
<tr>
<td>Buffer</td>
<td class="data"><?php printf('%s%% Hit Ratio (%s Requests)',$o->display('BUFF_HIT_RATIO'),$o->display('TOTAL_BUFF_REQ')); ?></td>
</tr>
<tr>
<td>Last Reorg</td>
<td class="data"><?php echo $o->display('LAST_REORG'); ?></td>
</tr>
<tr>
<td>Last Backup</td>
<td class="data"><?php echo $o->display('LAST_BACKUP_DATE'); ?></td>
</tr>
<tr>
<td>Backup Streams</td>
<td class="data"><?php echo $o->display('NUM_BACKUP_STREAMS'); ?></td>
</tr>
<tr>
<td>Backup Device Class</td>
<td class="data"><?php echo $o->display('FULL_DEV_CLASS'); ?></td>
</tr>
</table>

View File

@ -0,0 +1,23 @@
<!-- $o = ORM::factory('DB') -->
<table class="box-full">
<tr>
<td class="head" colspan="5">Database Volumes</td>
</tr>
<tr>
<td class="spacer">&nbsp;</td>
</tr>
<tr>
<td>Location</td>
<td class="right">Free Space</td>
<td class="right">Used Space</td>
<td class="right">Total Space</td>
</tr>
<?php $i=0; foreach ($o->vols() as $vo) { ?>
<tr class="<?php echo $i++%2 ? 'odd' : 'even'; ?>">
<td class="data"><?php echo $vo->display('LOCATION'); ?></td>
<td class="data-right"><?php echo $vo->display('FREE_SPACE_MB'); ?></td>
<td class="data-right"><?php echo $vo->display('USED_FS_SIZE_MB'); ?></td>
<td class="data-right"><?php echo $vo->display('TOTAL_FS_SIZE_MB'); ?></td>
</tr>
<?php } ?>
</table>

View File

@ -1,12 +0,0 @@
# phpTSMadmin
<Directory "/var/www/phpTSMadmin">
AllowOverride AuthConfig Limit
</Directory>
<VirtualHost *>
ServerName phptsmadmin.mydomain.net
DocumentRoot /var/www/phpTSMadmin
ErrorLog /var/log/httpd/phptsmadmin.mydomain.net-error_log
TransferLog /var/log/httpd/phptsmadmin.mydomain.net-access_log
</VirtualHost>

View File

@ -1,15 +0,0 @@
$Header: /cvsroot/phptsmadmin/phpTSMadmin/docs/CREDITS,v 1.2 2004/10/03 05:35:28 wurley Exp $
----------------------------
| phpTSMadmin contributors |
============================
Developers:
* Deon George (wurley@users.sf.net)
Other OS software:
* This script uses the template class from phplib - all credit to those developers.
For more information on phplib, check out their website http://phplib.shonline.de
* JPGraph is used to draw the gantt charts, you'll need to get it from http://www.aditus.nu/jpgraph/
If you would like to assist, contribute, develop, help then drop me an email.

View File

@ -1,70 +0,0 @@
<?php
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/help.php,v 1.3 2009/04/19 03:53:40 wurley Exp $
# This page should detail on Client storage usage.
# Required Libraries
require './common.php';
# Defaults
$help = objectCache('help');
$form['command'] = get_request('command','REQUEST');
# List of Clients.
$blockTitle['help'] = sprintf(_('Select HELP on %s'),$app['server']->getValue('server','name'));
$blockBody['help'] = '<form action="cmd.php">';
$blockBody['help'] .= sprintf('<input type="hidden" name="cmd" value="%s" />',get_request('cmd','REQUEST'));
$blockBody['help'] .= '<table class="blockcitem">';
$blockBody['help'] .= '<tr><td width=0%>';
$blockBody['help'] .= sprintf('<input type="hidden" name="index" value="%s" />',$app['server']->getIndex());
$blockBody['help'] .= '<select name="command">';
foreach ($help->getCommands() as $command) {
$blockBody['help'] .= sprintf('<option id="%s" %s>%s</option>',
$command,
isset($form['command']) && $command == $form['command'] ? 'selected' : '',
$command);
}
$blockBody['help'] .= '</select>';
$blockBody['help'] .= '</td>';
$blockBody['help'] .= '<td><input type="checkbox" name="raw" title="Show RAW help page"/></td>';
$blockBody['help'] .= '<td><input align="left" type="submit" name="submit" value="Go" /></td>';
$blockBody['help'] .= '<td width=100%>&nbsp;</td>';
$blockBody['help'] .= '</tr>';
$blockBody['help'] .= '</table>';
$blockBody['help'] .= '</form>';
if (isset($form['command'])) {
$helpCommand = $help->getCommand($form['command']);
if (get_request('raw','REQUEST')) {
$blockBody['help'] .= '<pre>'.implode('<br />',$helpCommand->raw).'</pre>';
} else {
$blockBody['help'] .= '<br />';
$blockBody['help'] .= '<table class="blockcitem">';
$blockBody['help'] .= sprintf('<tr><td><h3><u>%s</u></h3></td></tr>',$helpCommand->getTitle());
$blockBody['help'] .= sprintf('<tr><td>%s</td></tr>',$helpCommand->getDescription());
$blockBody['help'] .= sprintf('<tr><td><b>%s</b></td></tr>',_('Privileges Required'));
$blockBody['help'] .= sprintf('<tr><td>%s</td></tr>',$helpCommand->getClass());
$blockBody['help'] .= sprintf('<tr><td><b>%s</b></td></tr>',_('Syntax'));
$blockBody['help'] .= sprintf('<tr><td>%s</td></tr>',$helpCommand->getSyntax());
$blockBody['help'] .= sprintf('<tr><td><b>%s</b></td></tr>',_('Parameters'));
$blockBody['help'] .= sprintf('<tr><td>%s</td></tr>',$helpCommand->getParameters());
$blockBody['help'] .= '<tr><td>&nbsp;</td></tr>';
$blockBody['help'] .= sprintf('<tr><td><b>%s</b></td></tr>',_('Related Commands'));
$blockBody['help'] .= sprintf('<tr><td>%s</td></tr>',$helpCommand->getRelated());
$blockBody['help'] .= '</table>';
}
}
# End
render_page($blockTitle,$blockBody);
?>

View File

@ -1,57 +0,0 @@
<?php
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/image.backupevents.php,v 1.6 2009/04/19 03:53:40 wurley Exp $
# Required Libraries
require './common.php';
initJPGraph(true);
if (! isset($_SESSION['graph']['backupevent']))
exit;
# Make sure all our keys for each sched are the same.
foreach ($_SESSION['graph']['backupevent']['data'] as $sched => $details) {
foreach ($_SESSION['graph']['backupevent']['legend'] as $key => $count) {
@$_SESSION['graph']['backupevent']['data'][$sched][$key] += 0;
}
ksort($_SESSION['graph']['backupevent']['data'][$sched]);
}
$graph_row = 2;
$xcounter = 1;
$ycounter = 1;
$numrows = round(count($_SESSION['graph']['backupevent']['data'])/$graph_row);
$graph = new PieGraph(500,30+180*$numrows,'auto');
foreach ($_SESSION['graph']['backupevent']['data'] as $sched => $details) {
ksort($details);
$newsched = preg_replace('/-/','_',$sched);
$$newsched = new PiePlot(array_values($details));
$$newsched->SetCenter(120+(($xcounter%$graph_row)*160),120+(($ycounter-1)*180));
$$newsched->SetGuideLines(false,false);
$$newsched->SetGuideLinesAdjust(1.0);
$$newsched->SetSize(60);
$$newsched->SetTheme('sand');
$$newsched->value->SetFormat('%2.1f%%');
$$newsched->title->Set($sched);
$$newsched->title->SetMargin(10);
if ($xcounter == 1)
$$newsched->SetLegends(array_keys($details));
$graph->Add($$newsched);
if (! ($xcounter%$graph_row))
$ycounter++;
$xcounter++;
}
$graph->legend->SetFillColor('azure');
$graph->SetMarginColor('azure2');
$graph->title->Set(sprintf('Schedule Backup Status for %s',$app['server']->GetStatusDetail('SERVER_NAME')));
# Display the chart
unset($_SESSION['graph']['backupevent']);
$graph->Stroke();
?>

View File

@ -1,83 +0,0 @@
<?php
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/image.dbbackuphistory.php,v 1.7 2009/04/19 03:54:40 wurley Exp $
# Required Libraries
require './common.php';
initJPGraph(true);
$history = $app['server']->GetDBBackupDetail('history');
if (! $history)
exit;
$graph = new Graph(400,200,'auto');
$graph->SetScale('textlin');
$fulldata = array();
$incrdata = array();
$xtitles = array();
foreach ($app['server']->GetDBBackupDetail('history') as $index => $backupdetails) {
switch ($backupdetails['type']) {
case 'FULL' :
$fulldata[] = $backupdetails['size'];
$incrdata[] = 0;
break;
case 'INCR' :
$fulldata[] = 0;
$incrdata[] = $backupdetails['size'];
break;
}
$xtitles[] = preg_replace('/ /',"\n",tsmDate($backupdetails['date'],'daytime'));
$maxdata[] = $app['server']->GetDBDetail('USABLE_PAGES');
$curdata[] = $app['server']->GetDBDetail('USED_PAGES');
}
$cplot = new LinePlot($maxdata);
$cplot->SetLegend('Max DB Size');
$cplot->SetColor('red');
$cplot->SetWeight(2);
if (count($maxdata) == 1)
$cplot->mark->SetType(MARK_IMG_MBALL,'red',0.5);
$graph->Add($cplot);
$dplot = new LinePlot($curdata);
$dplot->SetLegend('Cur Size');
$dplot->SetColor('lightred');
$dplot->SetWeight(2);
$graph->Add($dplot);
$aplot = new BarPlot($fulldata);
$aplot->SetLegend('Full');
$aplot->SetFillColor('blue');
$aplot->value->Show();
$aplot->value->SetFormat('%5.0f');
$graph->Add($aplot);
$bplot = new BarPlot($incrdata);
$bplot->SetLegend('Incremental');
$bplot->SetFillColor('lightblue');
$bplot->value->Show();
$bplot->value->SetFormat('%5.0f');
$graph->Add($bplot);
$graph->img->SetMargin(60,110,20,40);
$graph->legend->Pos(0.01,0.80,'right','center');
$graph->legend->SetFillColor('azure');
$graph->xaxis->SetTickLabels($xtitles);
$graph->xaxis->SetLabelAngle(90);
$graph->xgrid->Show(true);
$graph->yaxis->title->Set('Database Pages \'000s');
$graph->yaxis->SetLabelFormatCallback('labelformat');
$graph->yaxis->SetTitleMargin(45);
$graph->SetMarginColor('azure2');
$graph->title->Set(sprintf('Database Backups %s',$app['server']->GetStatusDetail('SERVER_NAME')));
# Display the Gantt chart
$graph->Stroke();
function labelformat($label) {
return number_format($label/1000);
}
?>

View File

@ -1,145 +0,0 @@
<?php
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/server.db.php,v 1.12 2009/04/19 04:00:59 wurley Exp $
# This page should return all information about tde TSM database.
# Required Libraries
require './common.php';
# Database Summary Information
$blockTitle['db'] = sprintf(_('Database Information for %s (%s) %s.%s.%s.%s'),
$app['server']->GetStatusDetail('SERVER_NAME'),
$app['server']->GetStatusDetail('PLATFORM'),
$app['server']->GetStatusDetail('VERSION'),
$app['server']->GetStatusDetail('RELEASE'),
$app['server']->GetStatusDetail('LEVEL'),
$app['server']->GetStatusDetail('SUBLEVEL'));
$blockBody['db'] = '<table class="blockcitem">';
$blockBody['db'] .= sprintf('<tr><td colspan=2 class="titlel">%s</td></tr>',_('Database Summary'));
$blockBody['db'] .= '<tr><td><table class="result" border=0>';
$blockBody['db'] .= sprintf('<tr><td colspan=2>'.classValue(_('%s DB volumes totaling %sMB (%s%% utilsed).'),'value').'</td></tr>',
$app['server']->GetDBDetail('PHYSICAL_VOLUMES'),$app['server']->GetDBDetail('AVAIL_SPACE_MB'),
$app['server']->GetDBDetail('PCT_UTILIZED'));
foreach ($app['server']->GetDBDetail('dbvols') as $key) {
$blockBody['db'] .= sprintf('<tr><td>&nbsp;</td><td>'.classValue(_('%s (%sMB) (%sMB Free) (%s).'),'value').'</td></tr>',
$key['COPY1_NAME'],$key['AVAIL_SPACE_MB'],$key['FREE_SPACE_MB'],$key['COPY1_STATUS']);
if ($key['COPY2_NAME'])
$blockBody['db'] .= sprintf('<tr><td>&nbsp;</td><td>'.classValue(_('%s (%s).'),'value').'</td></tr>',
$key['COPY2_NAME'],$key['COPY2_STATUS']);
if ($key['COPY3_NAME'])
$blockBody['db'] .= sprintf('<tr><td>&nbsp;</td><td>'.classValue(_('%s (%s).'),'value').'</td></tr>',
$key['COPY3_NAME'],$key['COPY3_STATUS']);
}
$blockBody['db'] .= '<tr><td colspan=2>&nbsp;</td></tr>';
$blockBody['db'] .= sprintf('<tr><td colspan=2>'.classValue(_('%s LOG volumes totaling %sMB (%s%% utilsed).'),'value').'</td></tr>',
$app['server']->GetLogDetail('PHYSICAL_VOLUMES'),$app['server']->GetLogDetail('AVAIL_SPACE_MB'),
$app['server']->GetLogDetail('PCT_UTILIZED'));
foreach ($app['server']->GetLogDetail('logvols') as $key) {
$blockBody['db'] .= sprintf('<tr><td>&nbsp;</td><td>'.classValue(_('%s (%sMB) (%sMB Free) (%s).'),'value').'</td></tr>',
$key['COPY1_NAME'],$key['AVAIL_SPACE_MB'],$key['FREE_SPACE_MB'],$key['COPY1_STATUS']);
if ($key['COPY2_NAME'])
$blockBody['db'] .= sprintf('<tr><td>&nbsp;</td><td>'.classValue(_('%s (%s).'),'value').'</td></tr>',
$key['COPY2_NAME'],$key['COPY2_STATUS']);
if ($key['COPY3_NAME'])
$blockBody['db'] .= sprintf('<tr><td>&nbsp;</td><td>'.classValue(_('%s (%s).'),'value').'</td></tr>',
$key['COPY3_NAME'],$key['COPY3_STATUS']);
}
$blockBody['db'] .= '<tr><td colspan=2>&nbsp;</td></tr>';
$blockBody['db'] .= sprintf('<tr><td colspan=2>'.classValue(_('Database REDO log mode %s.'),'value').'</td></tr>',
$app['server']->GetStatusDetail('LOGMODE'));
$blockBody['db'] .= '<tr><td colspan=2>&nbsp;</td></tr>';
$blockBody['db'] .= sprintf('<tr><td colspan=2>'.classValue(_('%s%% database cache hit rate (%s%% cache wait).'),'value').'</td></tr>',
$app['server']->GetDBDetail('CACHE_HIT_PCT'),$app['server']->GetDBDetail('CACHE_WAIT_PCT'));
if ($trigger = $app['server']->GetDBBackupDetail('trigger')) {
$blockBody['db'] .= '<tr><td colspan=2>&nbsp;</td></tr>';
$blockBody['db'] .= sprintf('<tr><td colspan=2>'.classValue(_('TSM will automatically backup the database to %s when the logs reach %s%% full.'),'value').'</td></tr>',
sprintf('<a href="cmd.php?cmd=devclass.info&index=%s&devclass=%s">%s</a>',$app['server']->getIndex(),$trigger['INCRDEVCLASS'],$trigger['INCRDEVCLASS']),
$trigger['LOGFULLPCT']);
$blockBody['db'] .= sprintf('<tr><td colspan=2>'.classValue(_('After %s INCREMENTAL backups, a full backup will be performed to %s.'),'value').'</td></tr>',
$trigger['NUMICREMENTAL'],
sprintf('<a href="cmd.php?cmd=devclass.info&index=%s&devclass=%s">%s</a>',$app['server']->getIndex(),$trigger['DEVCLASS'],$trigger['DEVCLASS']));
}
$blockBody['db'] .= '</table></td>';
# Show our dbbackup graph
$blockBody['db'] .= sprintf('<td align="right"><img src="image.dbbackuphistory.php?index=%s" /></td></tr>',
$app['server']->getIndex());
$blockBody['db'] .= '</table>';
# Database Backup Information
$blockTitle['backup'] = sprintf(_('Database backup information for %s'),$app['server']->getValue('server','name'));
$blockBody['backup'] = '<table class="result">';
if ($app['server']->GetDBDetail('LAST_BACKUP_DATE')) {
$blockBody['backup'] .= sprintf('<tr><td colspan=6>'.classValue(_('%sMB (%s%%) has changed since the last backup on %s'),'value').'</td></tr>',
$app['server']->GetDBDetail('BACKUP_CHG_MB'),$app['server']->GetDBDetail('BACKUP_CHG_PCT'),
tsmDate($app['server']->GetDBDetail('LAST_BACKUP_DATE')));
$blockBody['backup'] .= '<tr><td colspan=6>&nbsp;</td></tr>';
## Show DB Vols
$blockBody['backup'] .= sprintf('<tr><td colspan=6>'.classValue(_('%s backups between %s and %s available for TSM DB restore.'),'value').'</td></tr>',
tsmDate($app['server']->GetDBBackupDetail('count'),'nosec'),
tsmDate($app['server']->GetDBBackupDetail('first'),'nosec'),
tsmDate($app['server']->GetDBBackupDetail('last'),'nosec'));
$blockBody['backup'] .= sprintf('<tr><td class="titlel">&nbsp;</td><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td></tr>',
'SEQ #','DATE','TYPE','DEVICE','VOLUME','LOCATION','STATUS');
$counter = 0;
$lastseries = 0;
foreach ($app['server']->GetDBBackupDetail('vols') as $volname => $voldetails) {
if (! is_array($voldetails))
continue;
if ($lastseries != $voldetails['BACKUP_SERIES']) {
$lastseries = $voldetails['BACKUP_SERIES'];
$counter ++;
}
$blockBody['backup'] .= sprintf('<tr %s><td>&nbsp;</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>',
($voldetails['STATUS'] == 'InValid' ? 'class="shadow"' : ($counter%2==0?'class="even"':'class="odd"')),
sprintf('%s-%s-%s',$voldetails['BACKUP_SERIES'],$voldetails['BACKUP_OPERATION'],$voldetails['VOLUME_SEQ']),
tsmDate($voldetails['DATE_TIME'],'nosec'),
tsmBackupType($voldetails['TYPE']),
$voldetails['DEVCLASS'],
$volname,
$app['server']->GetVolLocation($volname),
$voldetails['STATUS']);
}
$blockBody['backup'] .= '<tr><td colspan=4>&nbsp;</td></tr>';
} else {
$blockBody['backup'] .= sprintf('<tr><td colspan=6>%s</td></tr>',_('It looks like you have NOT yet run a TSM backup.'));
}
if ($app['server']->GetDBDetail('BACKUP_RUNNING') == 'YES')
$blockBody['backup'] .= sprintf('<tr><td colspan=6>%s</td></tr>',_('Database backup IS currently running.'));
else
$blockBody['backup'] .= sprintf('<tr><td colspan=6>%s</td></tr>',_('Database backup is NOT currently running.'));
$blockBody['backup'] .= '<tr><td colspan=6>&nbsp;</td></tr>';
$blockBody['backup'] .= '</table>';
# End
render_page($blockTitle,$blockBody);
?>

View File

@ -1,95 +0,0 @@
<?php
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/volume.inventory.php,v 1.11 2008/08/19 11:06:50 wurley Exp $
# Required Libraries
require './common.php';
# Defaults
$libraries = objectCache('libraries');
$libvolumes = objectCache('volumes');
# The following VOLUMES in the library can be checked out.
$blockTitle['innotci'] = 'Volume Inventory Summary.';
$blockBody['innotci'] = '<table class="result_table" width=100% border=0>';
$blockBody['innotci'] .= '<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>';
$blockBody['innotci'] .= sprintf('<tr><td colspan=0><b>%s</b></td></tr>',_('The following volumes are in a library, but NOT checked in.'));
$counter = 0;
foreach ($libraries->libVolumes(false) as $library => $volumes) {
foreach ($volumes as $element => $volume) {
$blockBody['innotci'] .= 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'] : 'Unknown LIB',
isset($volume->location) ? $volume->location : $volume->lib['slot'],
$volume->name,
$volume->stgpool,
$volume->status['volume'],
$volume->access,
isset($volume->lib['access']) ? $volume->lib['access'] : 'N/A',
$volume->utilisation,
$volume->reclaim,
tsmDate($volume->last['read'],'notime'),tsmDate($volume->last['write'],'notime'));
}
}
$blockBody['innotci'] .= '<tr><td colspan=0>&nbsp;</td></tr>';
# The following PRIMARY VOLUMES not in the library.
$blockBody['innotci'] .= sprintf('<tr><td colspan=0><b>%s</b></td></tr>',_('The following PRIMARY pool volumes are NOT checked in a library.'));
$counter = 0;
foreach ($libvolumes->primaryNotInLib() as $volume) {
$blockBody['innotci'] .= 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',
'N/A',
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['innotci'] .= '<tr><td colspan=0>&nbsp;</td></tr>';
# The following COPY VOLUMES in the library can be checked out.
$blockBody['innotci'] .= 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 ($libvolumes->libCopyVolumes(true) as $volume) {
$blockBody['innotci'] .= 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['innotci'] .= '<tr><td colspan=0>&nbsp;</td></tr>';
# The following PRIMARY VOLUMES not in the library.
$blockBody['innotci'] .= sprintf('<tr><td colspan=0><b>%s</b></td></tr>',_('The following COPY pool volumes are not checked in a library.'));
$counter = 0;
foreach ($libvolumes->libCopyVolumes(false) as $volume) {
$blockBody['innotci'] .= 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',
'N/A',
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['innotci'] .= '</table>';
# End
render_page($blockTitle,$blockBody);
?>

View File

@ -10,14 +10,6 @@
/** Available Commands /** Available Commands
*/ */
$config->configDefinition('command','libraryinfo',array(
'summary'=>'Library Info',
'desc'=>'Information on Automated Tape Libraries.',
'default'=>'redir&page=library'));
$config->configDefinition('command','nodedetail',array(
'summary'=>'Node Detail',
'desc'=>'Detail of Node Storage Usage.',
'default'=>'redir&page=node'));
$config->configDefinition('command','nodeoccupancy',array( $config->configDefinition('command','nodeoccupancy',array(
'summary'=>'Node Occupancy', 'summary'=>'Node Occupancy',
'desc'=>'Summary of Node Occupancy.', 'desc'=>'Summary of Node Occupancy.',
@ -26,23 +18,10 @@ $config->configDefinition('command','schedulegantt',array(
'summary'=>'Schedule Gantt', 'summary'=>'Schedule Gantt',
'desc'=>'Gantt view of todays schedules.', 'desc'=>'Gantt view of todays schedules.',
'default'=>'schedule.gantt')); 'default'=>'schedule.gantt'));
$config->configDefinition('command','summarygantt',array(
'summary'=>'Activity Summary Gantt',
'desc'=>'Gantt view of todays activities.',
'default'=>'redir&page=server/gantt'));
$config->configDefinition('command','serverdb',array(
'summary'=>'Server DB Information',
'desc'=>'Database Information for TSM Server.',
'default'=>'server.db'));
$config->configDefinition('command','serverstats',array( $config->configDefinition('command','serverstats',array(
'summary'=>'Server Stats', 'summary'=>'Server Stats',
'desc'=>'TSM Server Performance Stats.', 'desc'=>'TSM Server Performance Stats.',
'default'=>'server.stats')); 'default'=>'server.stats'));
$config->configDefinition('command','volumeinventory',array(
'summary'=>'Volume Inventory',
'desc'=>'Information on Volumes.',
'default'=>'volume.inventory'));
$config->configDefinition('lib','jpgraph',array( $config->configDefinition('lib','jpgraph',array(
'desc'=>'Path to JPGraph', 'desc'=>'Path to JPGraph',
'default'=>LIBDIR.'JpGraph')); 'default'=>LIBDIR.'JpGraph'));

View File

@ -580,6 +580,7 @@ class node extends base {
} }
function addOccupancy($details) { function addOccupancy($details) {
if (isset($this->fs[$details->filespace_id]))
$this->fs[$details->filespace_id]->setOccupancy($details); $this->fs[$details->filespace_id]->setOccupancy($details);
} }
@ -1432,7 +1433,8 @@ class nodes extends xtsm {
$result = $this->server->query('select * from FILESPACES',null); $result = $this->server->query('select * from FILESPACES',null);
if ($result) if ($result)
foreach ($result as $details) foreach ($result as $details)
$this->nodes[$details['NODE_NAME']]->addFileSpace($details); if (isset($this->nodes[$details['NODE_NAME']]))
$this->nodes[$details['NODE_NAME']]->addFileSpace($details);
# Get the file systems occupancy. # Get the file systems occupancy.
foreach ($this->getNodes() as $node) { foreach ($this->getNodes() as $node) {
@ -1444,7 +1446,8 @@ class nodes extends xtsm {
$result = $this->server->query('select * from VOLUMEUSAGE',null); $result = $this->server->query('select * from VOLUMEUSAGE',null);
if ($result) if ($result)
foreach ($result as $details) foreach ($result as $details)
$this->nodes[$details['NODE_NAME']]->addVolumeUsage($details); if (isset($this->nodes[$details['NODE_NAME']]))
$this->nodes[$details['NODE_NAME']]->addVolumeUsage($details);
} }
function getNodes() { function getNodes() {

View File

@ -1,15 +0,0 @@
<?php
require '../lib/common.php';
if ($var = get_request('var','REQUEST')) {
debug_dump($var);
debug_dump(unserialize($var));
} else {
echo '<form>';
echo '<input type="text" name="var" />';
echo '<input type="submit" />';
echo '</form>';
}
?>