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

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);
?>