Initial checking from CVS
61
htdocs/cmd.php
Normal file
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/cmd.php,v 1.2 2009/04/19 03:52:21 wurley Exp $
|
||||
|
||||
/**
|
||||
* Main command page for this application
|
||||
* All pages are rendered through this script.
|
||||
*
|
||||
* @package leenooksApp
|
||||
* @subpackage Page
|
||||
*/
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
require_once './common.php';
|
||||
|
||||
$www['cmd'] = get_request('cmd','REQUEST');
|
||||
$www['meth'] = get_request('meth','REQUEST');
|
||||
|
||||
ob_start();
|
||||
|
||||
switch ($www['cmd']) {
|
||||
case '_debug' :
|
||||
debug_dump($_REQUEST,1);
|
||||
break;
|
||||
|
||||
default :
|
||||
if (defined('HOOKSDIR') && file_exists(HOOKSDIR.$www['cmd'].'.php'))
|
||||
$app['script_cmd'] = HOOKSDIR.$www['cmd'].'.php';
|
||||
|
||||
elseif (defined('HTDOCDIR') && file_exists(HTDOCDIR.$www['cmd'].'.php'))
|
||||
$app['script_cmd'] = HTDOCDIR.$www['cmd'].'.php';
|
||||
|
||||
elseif (file_exists('welcome.php'))
|
||||
$app['script_cmd'] = 'welcome.php';
|
||||
|
||||
else
|
||||
$app['script_cmd'] = null;
|
||||
}
|
||||
|
||||
if (DEBUG_ENABLED)
|
||||
debug_log('Ready to render page for command [%s,%s].',128,__FILE__,__LINE__,__METHOD__,$www['cmd'],$app['script_cmd']);
|
||||
|
||||
# Create page.
|
||||
# Set the index so that we render the right menu tree.
|
||||
$www['page'] = new page($app['server']->getIndex());
|
||||
|
||||
if ($app['script_cmd'])
|
||||
include $app['script_cmd'];
|
||||
|
||||
# Capture the output and put into the body of the page.
|
||||
$www['body'] = new block();
|
||||
$www['body']->SetBody(ob_get_contents());
|
||||
$www['page']->block_add('body',$www['body']);
|
||||
ob_end_clean();
|
||||
|
||||
if ($www['meth'] == 'ajax')
|
||||
$www['page']->show(get_request('frame','REQUEST',false,'BODY'),true);
|
||||
else
|
||||
$www['page']->display();
|
||||
?>
|
16
htdocs/common.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/common.php,v 1.2 2009/04/19 03:53:40 wurley Exp $
|
||||
|
||||
/**
|
||||
* This script provides a convienent method to call the proper common.php
|
||||
*
|
||||
* @package leenooksApp
|
||||
*/
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
if (! defined('LIBDIR'))
|
||||
define('LIBDIR',sprintf('%s/',realpath('../lib/')));
|
||||
require_once LIBDIR.'common.php';
|
||||
?>
|
862
htdocs/css/style.css
Normal file
@@ -0,0 +1,862 @@
|
||||
/* $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/css/style.css,v 1.5 2009/04/19 04:00:59 wurley Exp $ */
|
||||
|
||||
/* Global Page */
|
||||
table.page {
|
||||
font-weight: normal;
|
||||
color: #000000;
|
||||
|
||||
font-family: bitstream vera sans,luxi sans,verdana,geneva,arial,helvetica,sans-serif;
|
||||
background-color: #FFFFFF;
|
||||
font-size: 13px;
|
||||
empty-cells: hide;
|
||||
}
|
||||
|
||||
/* Global Page - Defaults */
|
||||
/* A HREF Links */
|
||||
table.page a {
|
||||
color: #0000AA;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
table.page a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
table.page a img {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
/* Global Page - Logo & Title */
|
||||
table.page tr.head {
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
background-color: #001188;
|
||||
font-weight: bold;
|
||||
font-size: 11px;
|
||||
height: 25px;
|
||||
}
|
||||
|
||||
table.page tr.head img.logo {
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
|
||||
width: 100px;
|
||||
height: 60px;
|
||||
}
|
||||
|
||||
table.page tr.pagehead td.imagetop {
|
||||
width: 100%;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
/* Global Page - Control Line */
|
||||
table.page tr.control td {
|
||||
border-top: 1px solid #AAAACC;
|
||||
border-bottom: 1px solid #AAAACC;
|
||||
}
|
||||
|
||||
/* Global Page - Control Line Menu Items */
|
||||
table.page table.control {
|
||||
table-layout: fixed;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table.page table.control td {
|
||||
border-top: 0px;
|
||||
border-bottom: 0px;
|
||||
width: 30px;
|
||||
padding: 0px;
|
||||
padding-top: 2px;
|
||||
padding-bottom: 2px;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
font-size: 11px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.page table.control img {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
table.page table.control a {
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
table.page table.control a:hover {
|
||||
text-decoration: none;
|
||||
background-color: #FFFFFF;
|
||||
color: #0000AA;
|
||||
}
|
||||
|
||||
table.page table.control td.spacer {
|
||||
width: 20%;
|
||||
}
|
||||
|
||||
table.page table.control td.logo {
|
||||
text-align: right;
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
table.page table.control td.logo img.logo {
|
||||
vertical-align: middle;
|
||||
text-align: right;
|
||||
|
||||
width: 100px;
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
/* Global Page - Menu */
|
||||
table.page td.menu {
|
||||
border-right: 1px solid #AAAACC;
|
||||
vertical-align: top;
|
||||
background-color: #FCFCFE;
|
||||
width: 10%;
|
||||
}
|
||||
|
||||
/* Global Page - Main Body */
|
||||
table.page td.body {
|
||||
vertical-align: top;
|
||||
width: 100%;
|
||||
background-color: #FCFCFE;
|
||||
}
|
||||
|
||||
/* Global Page - Main Body System Message */
|
||||
table.page table.sysmsg {
|
||||
border-bottom: 2px solid #AAAACC;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table.page table.sysmsg td.head {
|
||||
font-size: small;
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.page table.sysmsg td.body {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
table.page table.sysmsg td.icon {
|
||||
text-align: center;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* Global Page - Main Body */
|
||||
table.page table.body {
|
||||
font-weight: normal;
|
||||
background-color: #FCFCFE;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table.page table.body h3.title {
|
||||
text-align: center;
|
||||
margin: 0px;
|
||||
padding: 10px;
|
||||
color: #FFFFFF;
|
||||
background-color: #000088;
|
||||
border: 1px solid #000000;
|
||||
font-weight: normal;
|
||||
font-size: 150%;
|
||||
}
|
||||
|
||||
table.page table.body h3.subtitle {
|
||||
text-align: center;
|
||||
margin: 0px;
|
||||
margin-bottom: 15px;
|
||||
font-size: 75%;
|
||||
color: #FFFFFF;
|
||||
border-bottom: 1px solid #000000;
|
||||
border-left: 1px solid #000000;
|
||||
border-right: 1px solid #000000;
|
||||
background: #000088;
|
||||
padding: 4px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
table.page table.body td.spacer {
|
||||
border-top: 2px solid #AAAACC;
|
||||
padding: 0px;
|
||||
font-size: 5px;
|
||||
}
|
||||
|
||||
table.page table.body td.head {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.page table.body td.foot {
|
||||
font-size: small;
|
||||
border-top: 1px solid #AAAACC;
|
||||
border-bottom: 1px solid #AAAACC;
|
||||
}
|
||||
|
||||
/* Global Page Footer */
|
||||
table.page tr.foot td {
|
||||
border-top: 1px solid #AAAACC;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
/* Global Page - Other Layouts */
|
||||
/* Server Select */
|
||||
table.page table.server_select {
|
||||
font-weight: bold;
|
||||
font-size: 13px;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
/* Individual table layouts */
|
||||
/* Menu */
|
||||
table.menu {
|
||||
}
|
||||
|
||||
table.menu tr.server td.icon {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
table.menu tr.server td.name {
|
||||
padding-right: 10px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
table.menu tr.server td {
|
||||
padding-top: 5px;
|
||||
font-size: 18px;
|
||||
text-align: left;
|
||||
padding-right: 0px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
table.menu tr.links td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
table.menu tr.links td td.ds_option {
|
||||
vertical-align: top;
|
||||
text-align: center;
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
padding-left: 3px;
|
||||
padding-right: 3px;
|
||||
}
|
||||
|
||||
table.menu tr.links td td.ds_option img {
|
||||
height: 22px;
|
||||
width: 22px;
|
||||
}
|
||||
|
||||
table.menu tr.links a {
|
||||
color: #000000;
|
||||
text-decoration: none;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
table.menu tr.links a:hover {
|
||||
text-decoration: none;
|
||||
background-color: #FFFFFF;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
table.menu tr.option td.expander {
|
||||
text-align: center;
|
||||
width: 22px;
|
||||
max-width: 22px;
|
||||
min-width: 22px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
table.menu tr.option td.icon {
|
||||
text-align: center;
|
||||
width: 22px;
|
||||
max-width: 22px;
|
||||
min-width: 22px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
table.menu tr.option td.item a {
|
||||
font-size: 13px;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
table.menu tr.option td.item a:hover {
|
||||
font-size: 13px;
|
||||
color: #841212;
|
||||
background-color: #FFF0C0;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
table.menu tr.option td.item span.count {
|
||||
font-size: 13px;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
table.menu td.links a {
|
||||
color: #0000AA;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.menu td.create a {
|
||||
font-size: 13px;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
table.menu td.create a:hover {
|
||||
font-size: 13px;
|
||||
color: #841212;
|
||||
background-color: #FFF0C0;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
table.menu td.links a:hover {
|
||||
text-decoration: none;
|
||||
color: blue;
|
||||
}
|
||||
|
||||
table.menu td.links a img {
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
}
|
||||
|
||||
table.menu td.blank {
|
||||
font-size: 1px;
|
||||
}
|
||||
|
||||
table.menu td.spacer {
|
||||
width: 22px;
|
||||
}
|
||||
|
||||
table.menu td.logged_in {
|
||||
font-size: 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
table.menu td.logged_in a {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
table.menu td.logged_in a:hover {
|
||||
color: #841212;
|
||||
background-color: #FFF0C0;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
/* Tree Global Defaults */
|
||||
table.menu tr td {
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
table.menu a {
|
||||
text-decoration: none;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
table.menu a:hover {
|
||||
text-decoration: underline;
|
||||
color: blue;
|
||||
}
|
||||
|
||||
/* Standard Form */
|
||||
table.forminput {
|
||||
background-color: #F9F9FA;
|
||||
padding: 10px;
|
||||
border: 1px solid #AAAACC;
|
||||
}
|
||||
|
||||
table.forminput td.title {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.forminput td.subtitle {
|
||||
text-align: center;
|
||||
font-weight: normal;
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
table.forminput tr td.heading {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.forminput td.small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
table.forminput td.top {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
table.forminput input.val {
|
||||
width: 350px;
|
||||
border: 1px solid #AAAACC;
|
||||
}
|
||||
|
||||
table.forminput input.roval {
|
||||
width: 350px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
table.forminput td.icon {
|
||||
width: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.forminput td.icon img {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
table.forminput td.label {
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
/* Menu on top of entry form */
|
||||
table.menu {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
table.menu td.icon {
|
||||
width: 16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Edit */
|
||||
div.add_value {
|
||||
font-size: 12px;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
/* Edit Entry */
|
||||
table.entry {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0px;
|
||||
empty-cells: show;
|
||||
}
|
||||
|
||||
table.entry input {
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
table.entry input.value {
|
||||
color: #000000;
|
||||
font-size: 14px;
|
||||
width: 350px;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
table.entry div.helper {
|
||||
text-align: left;
|
||||
white-space: nowrap;
|
||||
background-color: #FFFFFF;
|
||||
color: #888;
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
table.entry input.roval {
|
||||
font-size: 14px;
|
||||
width: 350px;
|
||||
background-color: #FFFFFF;
|
||||
color: #000000;
|
||||
border: none;
|
||||
}
|
||||
|
||||
table.entry textarea.value {
|
||||
font-size: 14px;
|
||||
width: 350px;
|
||||
background-color: #FFFFFF;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
table.entry textarea.roval {
|
||||
font-size: 14px;
|
||||
width: 350px;
|
||||
background-color: #FFFFFF;
|
||||
color: #000000;
|
||||
border: none;
|
||||
}
|
||||
|
||||
table.entry tr td {
|
||||
padding: 4px;
|
||||
padding-right: 0px;
|
||||
}
|
||||
|
||||
table.entry tr td.heading {
|
||||
border-top: 3px solid #C0C0C0;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.entry tr td.note {
|
||||
text-align: right;
|
||||
background-color: #E0E0E0;
|
||||
}
|
||||
|
||||
table.entry tr td.title {
|
||||
background-color: #E0E0E0;
|
||||
vertical-align: top;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.entry tr td.title a {
|
||||
text-decoration: none;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
table.entry tr td.title a:hover {
|
||||
text-decoration: underline;
|
||||
color: #016;
|
||||
}
|
||||
|
||||
table.entry tr td.value {
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
padding-bottom: 10px;
|
||||
padding-left: 50px;
|
||||
}
|
||||
|
||||
/** When an attr is updated, it is highlighted to indicate such */
|
||||
table.entry tr.updated td.title {
|
||||
border-top: 1px dashed #AAAA88;
|
||||
border-left: 1px dashed #AAAA88;
|
||||
background-color: #999988;
|
||||
}
|
||||
|
||||
table.entry tr.updated td.note {
|
||||
border-top: 1px dashed #AAAA88;
|
||||
border-right: 1px dashed #AAAA88;
|
||||
background-color: #999988;
|
||||
}
|
||||
|
||||
/** An extra row that sits at the bottom of recently modified attrs to encase them in dashes */
|
||||
table.entry tr.updated td.bottom {
|
||||
border-top: 1px dashed #AAAA88;
|
||||
}
|
||||
|
||||
/** Formatting for the value cell when it is the attribute that has been recently modified */
|
||||
table.entry tr.updated td.value {
|
||||
border-left: 1px dashed #AAAA88;
|
||||
border-right: 1px dashed #AAAA88;
|
||||
}
|
||||
|
||||
/* Need to prevent sub-tables (like the one in which jpegPhotos are displayed)
|
||||
* from drawing borders as well. */
|
||||
table.entry tr.updated td table td {
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
table.entry tr.noinput {
|
||||
background: #E0E0E0;
|
||||
}
|
||||
|
||||
span.hint {
|
||||
font-size: small;
|
||||
font-weight: normal;
|
||||
color: #888;
|
||||
}
|
||||
|
||||
/* Login Box */
|
||||
#login {
|
||||
background: url('../images/uid.png') no-repeat 0 1px;
|
||||
background-color: #FAFAFF;
|
||||
color: #000000;
|
||||
padding-left: 17px;
|
||||
}
|
||||
|
||||
#login:focus {
|
||||
background-color: #F0F0FF;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#login:disabled {
|
||||
background-color: #DDDDFF;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#password {
|
||||
background: url('../images/key.png') no-repeat 0 1px;
|
||||
background-color: #FAFAFF;
|
||||
color: #000000;
|
||||
padding-left: 17px;
|
||||
}
|
||||
|
||||
#password:focus {
|
||||
background-color: #F0F0FF;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#password:disabled {
|
||||
background-color: #DDDDFF;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#generic {
|
||||
background-color: #FAFAFF;
|
||||
color: #000000;
|
||||
padding-left: 17px;
|
||||
}
|
||||
#generic:focus {
|
||||
background-color: #F0F0FF;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
#generic:disabled {
|
||||
background-color: #DDDDFF;
|
||||
color: #000000;
|
||||
}
|
||||
|
||||
/* After input results */
|
||||
div.execution_time {
|
||||
font-size: 75%;
|
||||
font-weight: normal;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
table.result {
|
||||
width: 100%;
|
||||
vertical-align: top;
|
||||
empty-cells: show;
|
||||
border: 1px solid #AAAACC;
|
||||
border-spacing: 0px;
|
||||
background-color: #F2F2FF;
|
||||
}
|
||||
|
||||
table.result td.titlel {
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.result td.titlec {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.result td.titler {
|
||||
text-align: right;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.result tr.heading {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
table.result tr.list_title {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
table.result tr.list_title td.icon {
|
||||
text-align: center;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
table.result tr.list_item {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
table.result tr.list_item td.blank {
|
||||
width: 25px;
|
||||
}
|
||||
|
||||
table.result tr.list_item td.heading {
|
||||
vertical-align: top;
|
||||
color: gray;
|
||||
width: 10%;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
table.result tr.list_item td.value {
|
||||
color: #000000;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
table.result_table {
|
||||
border: 1px solid #AAAACC;
|
||||
border-collapse: collapse;
|
||||
empty-cells: show;
|
||||
}
|
||||
|
||||
table.result_table td {
|
||||
font-size: 12px;
|
||||
vertical-align: top;
|
||||
border: 1px solid #AAAACC;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
table.result_table th {
|
||||
border: 1px solid #AAAACC;
|
||||
padding: 10px;
|
||||
padding-left: 20px;
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
table.result_table tr.highlight {
|
||||
background-color: #EEEBBB;
|
||||
}
|
||||
|
||||
table.result_table tr.highlight td {
|
||||
border: 1px solid #AAAACC;
|
||||
font-weight: bold;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
table.result_table td.heading {
|
||||
color: #FFFFFF;
|
||||
background-color: #000088;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
table.result_table td.value {
|
||||
color: #000000;
|
||||
background-color: #E0E0E0;
|
||||
}
|
||||
|
||||
table.result_table tr.heading {
|
||||
color: #FFFFFF;
|
||||
background-color: #000088;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.result_table tr.heading a {
|
||||
color: #FFFFFF;
|
||||
font-size: 15px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.result_table tr.heading td {
|
||||
border: 1px solid #AAAACC;
|
||||
font-weight: normal;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
table.result_table td.titlel {
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.result_table td.titlec {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.result_table td.titler {
|
||||
text-align: right;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.result_table tr.even {
|
||||
background-color: #E0E0E0;
|
||||
}
|
||||
|
||||
table.result_table tr.even td {
|
||||
border: 1px solid #AAAACC;
|
||||
font-weight: normal;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
table.result_table tr.even td.title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.result_table tr.odd {
|
||||
background-color: #F0F0F0;
|
||||
}
|
||||
|
||||
table.result_table tr.odd td {
|
||||
border: 1px solid #AAAACC;
|
||||
font-weight: normal;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
table.result_table tr.odd td.title {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
table.result_table ul.list {
|
||||
margin: 5px;
|
||||
margin-left: 0px;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
table.result_table ul.list li {
|
||||
margin-left: 0px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
table.result_table ul.list li small {
|
||||
font-size: 75%;
|
||||
color: #707070;
|
||||
}
|
||||
|
||||
table.result_table ul.list li small a {
|
||||
color: #7070C0;
|
||||
}
|
||||
|
||||
/* Error Dialog Box */
|
||||
table.error {
|
||||
width: 500px;
|
||||
border: 1px solid #AA0000;
|
||||
background-color: #FFF0F0;
|
||||
}
|
||||
|
||||
table.error th {
|
||||
background-color: #AA0000;
|
||||
border: 0px;
|
||||
color: #FFFFFF;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
table.error th.img {
|
||||
vertical-align: middle;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
table.error td {
|
||||
border: 0px;
|
||||
background-color: #FFF0F0;
|
||||
padding: 2px;
|
||||
text-align: left;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* Popup Window */
|
||||
div.popup h3.subtitle {
|
||||
text-align: center;
|
||||
margin: 0px;
|
||||
margin-bottom: 15px;
|
||||
color: #FFFFFF;
|
||||
border-bottom: 1px solid #000000;
|
||||
border-left: 1px solid #000000;
|
||||
border-right: 1px solid #000000;
|
||||
background: #000088;
|
||||
padding: 4px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
span.good {
|
||||
color: green;
|
||||
}
|
||||
|
||||
span.bad {
|
||||
color: red;
|
||||
}
|
||||
|
||||
span.value {
|
||||
font-weight: bold;
|
||||
}
|
319
htdocs/devclass.info.php
Normal file
@@ -0,0 +1,319 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/devclass.info.php,v 1.13 2009/04/19 03:53:40 wurley Exp $
|
||||
|
||||
# Required Libraries
|
||||
require './common.php';
|
||||
# @todo: Graph storage by storage pool
|
||||
|
||||
# Defaults
|
||||
$devclasses = objectCache('devclasses');
|
||||
$volumes = objectCache('volumes');
|
||||
$drives = objectCache('drives');
|
||||
$stgps = objectCache('stgps');
|
||||
$occupancy = objectCache('occupancy');
|
||||
$nodes = objectCache('nodes');
|
||||
|
||||
# Start
|
||||
echo 'Show device class';
|
||||
echo '<form action="cmd.php">';
|
||||
printf('<input type="hidden" name="cmd" value="%s" />',get_request('cmd','REQUEST'));
|
||||
printf('<input type="hidden" name="index" value="%s" />',$app['server']->getIndex());
|
||||
|
||||
echo '<select name="devclass" onchange="javascript:submit()">';
|
||||
echo '<option value=""> </option>';
|
||||
|
||||
foreach ($devclasses->getDevClasses() as $devc => $devclass) {
|
||||
printf('<option value="%s" %s>%s</option>',
|
||||
$devclass->getName(),
|
||||
(isset($_REQUEST['devclass']) && ($_REQUEST['devclass'] == $devclass->getName())) ? 'selected' : '',
|
||||
$devclass->getName());
|
||||
}
|
||||
echo '</select>';
|
||||
echo '</form>';
|
||||
|
||||
if (isset($_REQUEST['devclass']) && trim($_REQUEST['devclass']))
|
||||
foreach ($devclasses->getDevClasses() as $devc => $devclass) {
|
||||
if ($_REQUEST['devclass'] != $devclass->getName())
|
||||
continue;
|
||||
|
||||
echo '<table width="100%" class="page_detail" border=0>';
|
||||
printf(_('<tr><td>Device Class</td><td><b>%s</b></td><td> </td></tr>'),$devc);
|
||||
|
||||
printf('<tr><td>Type</td><td>'.
|
||||
classValue(_('%s %s media is used for this device class.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$devclass->access,
|
||||
$devclass->type);
|
||||
|
||||
if (trim($devclass->library)) {
|
||||
printf('<tr><td>Library</td><td>'.
|
||||
classValue(_('%s library is used to store this media.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$devclass->library);
|
||||
|
||||
printf('<tr><td> </td><td>'.
|
||||
classValue(_('%s drives defined in this library.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
count($drives->getDrives($devclass->library)));
|
||||
}
|
||||
|
||||
if (trim($devclass->dir))
|
||||
printf('<tr><td>Local Directory</td><td>'.
|
||||
classValue(_('%s directory will contain %s volumes for this device class.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$devclass->dir,$devclass->capacity);
|
||||
|
||||
echo '</table>';
|
||||
echo '<br />';
|
||||
printf(_('Storage Pools using device class %s.').'<br />',$devc);
|
||||
|
||||
$stgcount = 0;
|
||||
foreach ($stgps->getStoragePools() as $stgp => $stgpool) {
|
||||
# Ignore storage pools not of this device class.
|
||||
if ($stgpool->devclass != $devc) continue;
|
||||
|
||||
echo '<table width="100%" class="result" border=0>';
|
||||
# Title
|
||||
echo "\n\n";
|
||||
printf('<tr><td colspan=2 class="titlel">%s - %s (%s)</td><td class="titlec"> </td></tr>',
|
||||
$stgpool->getName(),$stgpool->type,$stgpool->access);
|
||||
|
||||
# Utlisation and Migration details
|
||||
echo "\n\n";
|
||||
switch ($stgpool->type) {
|
||||
case 'PRIMARY' :
|
||||
switch ($devclass->access) {
|
||||
case 'Sequential' :
|
||||
printf('<tr><td> </td><td>'.
|
||||
classValue(_('%s%% storage capacity utilised with %s%% volumes used.'),
|
||||
'value').
|
||||
'</td><td> </td></tr>',
|
||||
$stgpool->utilisation,$stgpool->migratable);
|
||||
break;
|
||||
|
||||
case 'Random' :
|
||||
printf('<tr><td> </td><td>'.
|
||||
classValue(_('%s%% storage capacity utilised with %s%% migratable data.'),
|
||||
'value').
|
||||
'</td><td> </td></tr>',
|
||||
$stgpool->utilisation,$stgpool->migratable);
|
||||
break;
|
||||
|
||||
default :
|
||||
printf('<tr><td colspan=2>Unknown access strategy %s.</td><td>',$devclass->access);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'COPY' :
|
||||
printf('<tr><td> </td><td>'.
|
||||
classValue(_('%s%% storage capacity utilised.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$stgpool->utilisation);
|
||||
break;
|
||||
|
||||
default :
|
||||
printf('<tr><td colspan=2><b>%s</b> %s.</td><td>',
|
||||
_('Unknown pooltype'),$stgpool->type);
|
||||
}
|
||||
|
||||
# Max object size
|
||||
echo "\n\n";
|
||||
if ($stgpool->maxsize)
|
||||
printf('<tr><td> </td><td>'.
|
||||
classValue(_('%3.2fMB Maximum Object Size.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$stgpool->maxsize/1024/1024);
|
||||
|
||||
if ($stgpool->reclaim)
|
||||
printf('<tr><td> </td><td>'.
|
||||
classValue(_('%s%% wasted space is required before reclaimation. Reclamation will use %s'),
|
||||
'value').
|
||||
'</td><td> </td></tr>',
|
||||
$stgpool->reclaim,($stgpool->reclaimstgp ? $stgpool->reclaimstgp : $stgp));
|
||||
|
||||
if ($stgpool->reclaimrunning)
|
||||
printf('<tr><td> </td><td>'.
|
||||
_('Reclamation IS currently running.').
|
||||
'</td><td> </td></tr>');
|
||||
|
||||
if ($stgpool->reuse)
|
||||
printf('<tr><td> </td><td>'.
|
||||
classValue(_('%s days must pass before volumes will be reused.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$stgpool->reuse);
|
||||
|
||||
# Migration details
|
||||
if ($stgpool->nextstgp)
|
||||
printf('<tr><td> </td><td>'.
|
||||
classValue(_('Migration to %s will occur at %s%% (stopping at %s%%)'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$stgpool->nextstgp,$stgpool->migr['hi'],$stgpool->migr['low']);
|
||||
|
||||
if ($stgpool->migr['running'])
|
||||
printf('<tr><td> </td><td>'.
|
||||
classValue(_('Migration IS currently running. %sMB Migrated %ss'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$stgpool->migr['mb'],$stgpool->migr['sec']);
|
||||
|
||||
# Collocation Information
|
||||
if ($stgpool->collocate)
|
||||
printf('<tr><td> </td><td>'.
|
||||
classValue(_('%s Collocation.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$stgpool->collocate);
|
||||
|
||||
# Disk Caching.
|
||||
if ($stgpool->cache)
|
||||
printf('<tr><td> </td><td>'.
|
||||
classValue(_('%s Migration caching.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$stgpool->cache);
|
||||
|
||||
$stgcount++;
|
||||
echo '<tr><td> </td></tr>';
|
||||
|
||||
# Volume information.
|
||||
echo "\n\n";
|
||||
switch ($devclass->type) {
|
||||
case 'DISK' :
|
||||
if ($volumes->getStoragePoolVolumes($stgpool->getName()))
|
||||
foreach ($volumes->getStoragePoolVolumes($stgpool->getName()) as $volume) {
|
||||
|
||||
printf('<tr><td> </td><td>'.
|
||||
classValue(_('Vol %s (%s%% %s) - %s.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$volume->getName(),$volume->utilisation,
|
||||
$volume->status['volume'],
|
||||
$volume->access);
|
||||
}
|
||||
break;
|
||||
|
||||
default :
|
||||
|
||||
# Scratch Media
|
||||
$temp = '';
|
||||
if (count($volumes->getStoragePoolScratchVolumes($stgpool->getName())))
|
||||
$temp .= sprintf('<tr><td> </td><td>'.
|
||||
classValue(_('%s scratch media in use (of %s).'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
count($volumes->getStoragePoolScratchVolumes($stgpool->getName())),$stgpool->maxscratch);
|
||||
|
||||
if (count($volumes->getStoragePoolDefinedVolumes($stgpool->getName())))
|
||||
$temp .= sprintf('<tr><td> </td><td>'.
|
||||
classValue(_('%s defined media in use.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
count($volumes->getStoragePoolDefinedVolumes($stgpool->getName())));
|
||||
|
||||
if ($temp) {
|
||||
printf('<tr><td colspan=3>%s</td></tr>',
|
||||
_('Media SCRATCH Status'));
|
||||
echo $temp;
|
||||
echo '<tr><td> </td></tr>';
|
||||
$temp = '';
|
||||
}
|
||||
|
||||
# Media Access
|
||||
foreach (array('FULL','FILLING','PENDING','EMPTY') as $status) {
|
||||
if (count($volumes->getStoragePoolVolumesStatus($stgpool->getName(),$status)))
|
||||
$temp .= sprintf('<tr><td> </td><td>'.
|
||||
classValue(_('%s media %s.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
count($volumes->getStoragePoolVolumesStatus($stgpool->getName(),$status)),$status);
|
||||
}
|
||||
if ($temp) {
|
||||
printf('<tr><td colspan=3>%s</td></tr>',
|
||||
_('Media FILLING Status'));
|
||||
echo $temp;
|
||||
echo '<tr><td> </td></tr>';
|
||||
$temp = '';
|
||||
}
|
||||
|
||||
foreach (array('READWRITE','READONLY','UNAVAILABLE','OFFSITE','DESTROYED') as $status) {
|
||||
if (count($volumes->getStoragePoolVolumesAccess($stgpool->getName(),$status)))
|
||||
$temp .= sprintf('<tr><td> </td><td>'.
|
||||
classValue(_('%s media %s.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
count($volumes->getStoragePoolVolumesAccess($stgpool->getName(),$status)),$status);
|
||||
}
|
||||
if ($temp) {
|
||||
printf('<tr><td colspan=3>%s</td></tr>',
|
||||
_('Media ACCESS Status'));
|
||||
echo $temp;
|
||||
echo '<tr><td> </td></tr>';
|
||||
$temp = '';
|
||||
}
|
||||
|
||||
# Utilisation
|
||||
$stat['count'] = 0;
|
||||
$stat['util'] = 0;
|
||||
$stat['reclaim'] = 0;
|
||||
$stat['cap'] = 0;
|
||||
foreach ($volumes->getStoragePoolVolumes($stgpool->getName()) as $volume) {
|
||||
$stat['util'] += $volume->utilisation;
|
||||
$stat['reclaim'] += $volume->reclaim;
|
||||
$stat['cap'] += $volume->estcap;
|
||||
$stat['count']++;
|
||||
}
|
||||
if ($stat['count'] > 0) {
|
||||
printf('<tr><td colspan=3>%s</td></tr>',
|
||||
_('Media Stats'));
|
||||
printf('<tr><td> </td><td>'.
|
||||
classValue(_('%3.2f%% average utilisation.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$stat['util']/$stat['count']);
|
||||
printf('<tr><td> </td><td>'.
|
||||
classValue(_('%3.2f%% average wasted space.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$stat['reclaim']/$stat['count']);
|
||||
printf('<tr><td> </td><td>'.
|
||||
classValue(_('%3.0f MB average capacity.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$stat['cap']/$stat['count']);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
echo '<tr><td> </td></tr>';
|
||||
|
||||
# Nodes with data in this pool
|
||||
echo "\n\n";
|
||||
$total = 0;
|
||||
$nodedata = '';
|
||||
$counter = 0;
|
||||
foreach ($occupancy->getStoragePoolTotals($stgpool->getName()) as $node => $typedetails) {
|
||||
$node = $nodes->getNode($node);
|
||||
|
||||
foreach ($typedetails as $type => $details) {
|
||||
$nodedata .= sprintf('<tr class="%s"><td>%s</td><td>%s</td><td align="right">%s %s</td><td align="right">%s MB</td></tr>',
|
||||
($counter++%2==0?'even':'odd'),
|
||||
$node->getName(),$type,
|
||||
(isset($detail['files']) ? number_format($detail['files']) : ' '),
|
||||
(count($node->getTapeVolumes($stgpool->getName(),$type)) ? count($node->getTapeVolumes($stgpool->getName(),$type)) : ' '),
|
||||
isset($details['physical']) ? number_format($details['physical']) : ' ');
|
||||
|
||||
$total += $details['physical'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($nodedata) {
|
||||
echo '<tr><td colspan=2>'."\n\n";
|
||||
echo '<table class="result_table" border=0>';
|
||||
printf('<tr><td colspan=4 class="heading">%s</td></tr>',
|
||||
_('Nodes with data in this storage pool.'));
|
||||
printf('<tr class="title"><td class="titlel">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td></tr>',
|
||||
_('Node'),_('Type'),_('Volumes'),_('MB'));
|
||||
echo $nodedata;
|
||||
printf('<tr class="highlight"><td colspan=3 class="titlel">%s</td><td class="titler">%s MB</td></tr>',
|
||||
_('Total'),number_format($total));
|
||||
echo '</table>'."\n\n";
|
||||
echo '</td><td> </td></tr>';
|
||||
echo '<tr><td> </td></tr>';
|
||||
}
|
||||
echo '</table><br />'."\n\n";
|
||||
}
|
||||
|
||||
if (! $stgcount)
|
||||
printf('<b>%s</b><br />',_('There are no storage pools using this DEVCLASS.'));
|
||||
|
||||
}
|
||||
?>
|
116
htdocs/gantt.activity.php
Normal file
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/gantt.activity.php,v 1.6 2008/07/01 01:18:34 wurley Exp $
|
||||
|
||||
# Required Libraries
|
||||
require './common.php';
|
||||
initJPGraph(true);
|
||||
|
||||
# Defaults
|
||||
$reportEnd = strftime('%y-%m-%d %H:%M',time());
|
||||
$reportStart = strftime('%y-%m-%d %H:%M',time()-86400);
|
||||
|
||||
$startActivities['811'] = array('start'=>'Expire Inventory');
|
||||
$startActivities['812'] = array('success'=>'Expire Inventory');
|
||||
$startActivities['2562'] = array('start'=>'Event Records Delete');
|
||||
$startActivities['2564'] = array('success'=>'Event Records Delete');
|
||||
$startActivities['2102'] = array('start'=>'Activity Log Delete');
|
||||
$startActivities['2102'] = array('success'=>'Activity Log Delete');
|
||||
$startActivities['2280'] = array('start'=>'DB Backup');
|
||||
$startActivities['4550'] = array('success'=>'DB Backup');
|
||||
$startActivities['406'] = array('start'=>'Session');
|
||||
$startActivities['403'] = array('success'=>'Session');
|
||||
|
||||
# Admin schedules
|
||||
$tsmActivitys = TSMQuery($_REQUEST['server_id'],"select date(DATE_TIME) as DATE,time(DATE_TIME) as TIME,MSGNO from ACTLOG where ORIGINATOR='SERVER' and DATE_TIME \> '$reportStart' and MSGNO in (".implode(",",array_keys($startActivities)).")");
|
||||
|
||||
foreach ($tsmActivitys as $tsmActivity) {
|
||||
|
||||
$datetime = $tsmActivity['DATE']." ".(preg_replace('/(.*:.*):.*/',"$1",$tsmActivity['TIME']));
|
||||
$msgNum = $tsmActivity['MSGNO'];
|
||||
# Do we know this message number?
|
||||
if (isset($startActivities[$msgNum])) {
|
||||
|
||||
# New Event.
|
||||
if (isset($startActivities[$msgNum]['start'])) {
|
||||
|
||||
$activity[$startActivities[$msgNum]['start']][]['start'] = $datetime;
|
||||
|
||||
} else if (isset($startActivities[$msgNum]['success'])) {
|
||||
$item = (isset($activity[$startActivities[$msgNum]['success']]) ?
|
||||
count($activity[$startActivities[$msgNum]['success']])-1 : 0);
|
||||
|
||||
# Is there a start event.
|
||||
if (! isset($activity[$startActivities[$msgNum]['success']][$item]['start'])) {
|
||||
$activity[$startActivities[$msgNum]['success']][$item]['start'] = $datetime;
|
||||
}
|
||||
$activity[$startActivities[$msgNum]['success']][$item]['end'] = $datetime;
|
||||
|
||||
} else {
|
||||
print "Che? Unknown index??";
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
||||
}
|
||||
// A new graph with automatic size
|
||||
$graph = new GanttGraph(0,0,"auto");
|
||||
|
||||
$item = 0;
|
||||
|
||||
# Admin Schedules
|
||||
foreach ($activity as $tsmSchedAdmin => $value) {
|
||||
|
||||
foreach ($value as $instance) {
|
||||
|
||||
printf ("Drawing [%s] [%s] [%s] [%s]<BR>",$item,$tsmSchedAdmin,$instance['start'],($instance['end'] ? $instance['end'] : $instance['start']));
|
||||
$activity = new GanttBar($item,$tsmSchedAdmin,$instance['start'],($instance['end'] ? $instance['end'] : $instance['start']));
|
||||
$item++;
|
||||
$graph->Add($activity);
|
||||
}
|
||||
}
|
||||
|
||||
$graph->SetMarginColor('white');
|
||||
$graph->SetFrame(false);
|
||||
|
||||
// We want to display day, hour and minute scales
|
||||
$graph->ShowHeaders(GANTT_HDAY | GANTT_HHOUR | GANTT_HMIN);
|
||||
|
||||
$graph->hgrid->Show();
|
||||
$graph->hgrid->SetRowFillColor('darkred@0.85');
|
||||
$graph->hgrid->line->SetColor('red@0.85');
|
||||
$graph->hgrid->line->Show(false);
|
||||
|
||||
// A new activity on row '0'
|
||||
// Setup hour format
|
||||
$graph->scale->hour->SetIntervall(1);
|
||||
$graph->scale->hour->SetStyle(HOURSTYLE_H24);
|
||||
$graph->scale->minute->SetIntervall(30);
|
||||
|
||||
// Display the Gantt chart
|
||||
$graph->Stroke();
|
||||
|
||||
die();
|
||||
# Block Title
|
||||
$blockTitle = _('Server Status for').' '.TSMServerName($_REQUEST['server_id']);
|
||||
|
||||
$blockBody = '<table border="0" cellpadding="0" cellspacing="0" class="blockcitem">';
|
||||
|
||||
# Client Details
|
||||
$blockBody .= '<tr><th colspan=2 class="title"> Clients</th><th class="title"> </th></tr>';
|
||||
|
||||
#$blockBody .= sprintf('<tr><td> </td><td>'.
|
||||
# classValue(_('%s clients registered to this TSM server.'),'value').
|
||||
# '</td><td> </td></tr>',
|
||||
# count($tsmClientsTotal));
|
||||
|
||||
$blockBody .= '<tr><td colspan=3> </td></tr>';
|
||||
|
||||
# End
|
||||
$blockBody .= '</table>';
|
||||
|
||||
$left = ''; # Use default left blocks.
|
||||
$centre = buildBlock("centre",$blockTitle,$blockBody);
|
||||
$right = ''; # Use default right blocks.
|
||||
print buildPage($left,$centre,$right);
|
||||
|
||||
?>
|
70
htdocs/help.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?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%> </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> </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);
|
||||
?>
|
57
htdocs/image.backupevents.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?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();
|
||||
?>
|
83
htdocs/image.dbbackuphistory.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
?>
|
37
htdocs/image.occupancy.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/image.occupancy.php,v 1.8 2009/04/19 03:54:40 wurley Exp $
|
||||
|
||||
# Required Libraries
|
||||
require './common.php';
|
||||
initJPGraph(true);
|
||||
|
||||
if (! isset($_SESSION['graph']['occupancy']))
|
||||
exit;
|
||||
|
||||
ksort($_SESSION['graph']['occupancy']);
|
||||
$num = count($_SESSION['graph']['occupancy'])-10;
|
||||
|
||||
if ($num < 0)
|
||||
$num = 0;
|
||||
|
||||
$graph = new PieGraph(400,200+20*$num,'auto');
|
||||
|
||||
$plot = new PiePlot(array_values($_SESSION['graph']['occupancy']));
|
||||
$plot->SetLegends(array_keys($_SESSION['graph']['occupancy']));
|
||||
# It seems the guide lines break the grpah if there are large number of points.
|
||||
//$plot->SetGuideLines(false,false);
|
||||
//$plot->SetGuideLinesAdjust(1.0);
|
||||
$plot->value->SetFormat('%2.1f%%');
|
||||
$plot->SetCenter(200,100);
|
||||
$plot->SetSize(60);
|
||||
$plot->SetTheme('sand');
|
||||
$graph->Add($plot);
|
||||
|
||||
$graph->legend->SetFillColor('azure');
|
||||
$graph->SetMarginColor('azure2');
|
||||
$graph->title->Set(sprintf('Storage Used by Last Access for %s',$app['server']->GetStatusDetail('SERVER_NAME')));
|
||||
|
||||
# Display the chart
|
||||
unset($_SESSION['graph']['occupancy']);
|
||||
$graph->Stroke();
|
||||
?>
|
88
htdocs/image.schedule.gantt.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/image.schedule.gantt.php,v 1.2 2009/04/19 03:54:40 wurley Exp $
|
||||
|
||||
# TODO:
|
||||
# Need better date handling - currently this script misses out events that start before midnight, but flow into today.
|
||||
# Want to make a week/month view, or select the day to view.
|
||||
# Currently only DURUNITS of HOUR schedules are shown.
|
||||
# Currently ASSUMES PERUNITS of DAY.
|
||||
|
||||
# Required Libraries
|
||||
require './common.php';
|
||||
initJPGraph(true);
|
||||
|
||||
# Defaults
|
||||
# Get Schedules
|
||||
$dayOfWeek = strtoupper(strftime('%A',time()));
|
||||
$todayDate = strftime('%y-%m-%d',time());
|
||||
|
||||
$tsmSchedAdmins = $app['server']->query("select * from ADMIN_SCHEDULES where DAYOFWEEK in ('ANY','".$dayOfWeek."')",null,'SCHEDULE_NAME');
|
||||
$tsmSchedClients = $app['server']->query("select * from CLIENT_SCHEDULES where DAYOFWEEK in ('ANY','".$dayOfWeek."')",null,'SCHEDULE_NAME');
|
||||
|
||||
# A new graph with automatic size
|
||||
$graph = new GanttGraph(0,0,"auto");
|
||||
|
||||
# Only show the current date.
|
||||
$graph->SetDateRange($todayDate,$todayDate);
|
||||
|
||||
$graph->SetMarginColor('#eeeeff');
|
||||
$graph->SetFrame(true,'#eeeeff',0);
|
||||
|
||||
# We want to display day, hour and minute scales
|
||||
$graph->ShowHeaders(GANTT_HDAY | GANTT_HHOUR | GANTT_HMIN);
|
||||
|
||||
# Setup hour format
|
||||
$graph->scale->hour->SetIntervall(1);
|
||||
$graph->scale->hour->SetStyle(HOURSTYLE_H24);
|
||||
$graph->scale->minute->SetIntervall(30);
|
||||
$graph->hgrid->Show();
|
||||
$graph->hgrid->SetRowFillColor('darkred@0.85');
|
||||
|
||||
$item = 0;
|
||||
|
||||
# Admin Schedules
|
||||
if ($tsmSchedAdmins) {
|
||||
foreach ($tsmSchedAdmins as $tsmSchedAdmin) {
|
||||
|
||||
if ($tsmSchedAdmin['DURUNITS'] == 'HOURS') {
|
||||
$activity = new GanttBar($item,$tsmSchedAdmin['SCHEDULE_NAME'].
|
||||
($tsmSchedAdmin['DESCRIPTION'] ? ' ('.$tsmSchedAdmin['DESCRIPTION'].')' : null),
|
||||
strftime('%Y-%m-%d',time()).' '.$tsmSchedAdmin['STARTTIME'],
|
||||
$tsmSchedAdmin['DURATION']/24);
|
||||
|
||||
if ($tsmSchedAdmin['ACTIVE'] == "NO") {
|
||||
$activity->SetColor('gray');
|
||||
$activity->SetPattern(GANTT_SOLID,'gray',50);
|
||||
}
|
||||
|
||||
$item++;
|
||||
$graph->Add($activity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$item++;
|
||||
|
||||
# ClientSchedules
|
||||
if ($tsmSchedClients) {
|
||||
foreach ($tsmSchedClients as $tsmSchedAdmin) {
|
||||
|
||||
if ($tsmSchedAdmin['DURUNITS'] == 'HOURS') {
|
||||
$activity = new GanttBar($item,$tsmSchedAdmin['SCHEDULE_NAME'].
|
||||
($tsmSchedAdmin['DESCRIPTION'] ? ' ('.$tsmSchedAdmin['DESCRIPTION'].')' : null),
|
||||
strftime('%Y-%m-%d',time()).' '.$tsmSchedAdmin['STARTTIME'],
|
||||
$tsmSchedAdmin['DURATION']/24);
|
||||
|
||||
$item++;
|
||||
$graph->Add($activity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Show the current time.
|
||||
$vline = new GanttVLine (strftime('%Y-%m-%d %H:%M',time()),"", "darkred",5);
|
||||
$graph->Add($vline);
|
||||
|
||||
# Display the Gantt chart
|
||||
$graph->Stroke();
|
||||
?>
|
62
htdocs/image.server.stats.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/image.server.stats.php,v 1.6 2009/04/19 03:54:40 wurley Exp $
|
||||
|
||||
# Required Libraries
|
||||
require './common.php';
|
||||
initJPGraph(true);
|
||||
|
||||
$activity = $_REQUEST['activity'];
|
||||
if (! isset($_SESSION['graph'][$activity]))
|
||||
exit;
|
||||
|
||||
$color_array = array(
|
||||
'darkred','aquamarine','blue','violet','blueviolet','red','brown','burlywood','cadetblue','chocolate','red','darkred');
|
||||
|
||||
$graph = new Graph(900,300,'auto');
|
||||
$graph->SetScale('datlin',0,(isset($_SESSION['graph'][$activity]['mode']) ? $_SESSION['graph'][$activity]['mode']*2 : 0));
|
||||
|
||||
ksort($_SESSION['graph'][$activity]['data']);
|
||||
|
||||
$counter = 0;
|
||||
foreach ($_SESSION['graph'][$activity]['data'] as $process => $detail) {
|
||||
$color = $counter%count($color_array);
|
||||
|
||||
$$process = new LinePlot(array_values($detail),array_keys($detail));
|
||||
$$process->SetLegend($process);
|
||||
$$process->SetColor($color_array[$color]);
|
||||
$$process->mark->SetType(MARK_IMG_MBALL,$color,0.3);
|
||||
$graph->Add($$process);
|
||||
$counter++;
|
||||
}
|
||||
|
||||
$graph->xaxis->SetLabelAngle(90);
|
||||
$graph->img->SetMargin(60,160,20,80);
|
||||
$graph->legend->Pos(0.01,0.50,'right','center');
|
||||
$graph->legend->SetFillColor('azure');
|
||||
$graph->yaxis->SetLabelFormatCallback('labelformat');
|
||||
$graph->yaxis->SetTitleMargin(45);
|
||||
$graph->SetMarginColor('azure2');
|
||||
|
||||
switch($activity) {
|
||||
case 'mediawait' :
|
||||
$graph->yaxis->title->Set('Wait Time (mins)');
|
||||
$graph->title->Set(sprintf('Media Wait Time %s',$app['server']->GetStatusDetail('SERVER_NAME')));
|
||||
break;
|
||||
|
||||
case 'thruput' :
|
||||
$graph->yaxis->title->Set('Thruput (MB/s)');
|
||||
$graph->title->Set(sprintf('Data Thruput %s',$app['server']->GetStatusDetail('SERVER_NAME')));
|
||||
break;
|
||||
|
||||
default :
|
||||
$graph->yaxis->title->Set('Unknown');
|
||||
$graph->title->Set(sprintf('Unknown Report %s',$app['server']->GetStatusDetail('SERVER_NAME')));
|
||||
}
|
||||
# Display the chart
|
||||
$graph->Stroke();
|
||||
unset($_SESSION['graph'][$activity]);
|
||||
|
||||
function labelformat($label) {
|
||||
return sprintf('%3.1f',$label/60);
|
||||
}
|
||||
?>
|
BIN
htdocs/images/ajax-spinner.gif
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
htdocs/images/debug-cache.png
Normal file
After Width: | Height: | Size: 648 B |
BIN
htdocs/images/error.png
Normal file
After Width: | Height: | Size: 1.8 KiB |
BIN
htdocs/images/favicon.ico
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
htdocs/images/home-big.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
55
htdocs/images/index.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/images/index.php,v 1.1 2008/01/15 10:15:28 wurley Exp $
|
||||
|
||||
/**
|
||||
* This will show a nice table of all the icons used by this application.
|
||||
*
|
||||
* @package leenooksApp
|
||||
*/
|
||||
|
||||
echo '<html>';
|
||||
echo '<title>Application Icons</title>';
|
||||
echo '<head><link type="text/css" rel="stylesheet" href="../css/style.css" media="screen" /></head>';
|
||||
|
||||
echo '<body>';
|
||||
echo '<h3 class="title">Application Icons</h3>';
|
||||
echo '<br />';
|
||||
echo '<center>';
|
||||
|
||||
$dir = opendir('.');
|
||||
while (($file = readdir($dir)) !== false) {
|
||||
if ($file == '.' || $file == '..')
|
||||
continue;
|
||||
|
||||
if (! preg_match('/\.png$/',$file))
|
||||
continue;
|
||||
|
||||
$files[filesize($file).'_'.$file] = $file;
|
||||
}
|
||||
|
||||
sort($files);
|
||||
|
||||
$cell_style = 'color: #888; text-align:center; padding: 10px; padding-bottom: 20px; vertical-align: bottom;';
|
||||
|
||||
printf('<center><b>The %s icons used by this application.</b></center>',count($files));
|
||||
echo '<table style="font-family: arial; font-size: 12px;">';
|
||||
|
||||
$counter = 0;
|
||||
foreach ($files as $file) {
|
||||
if ($counter % 6 == 0) {
|
||||
if ($counter)
|
||||
echo '</tr>'."\n";
|
||||
flush();
|
||||
echo '<tr>';
|
||||
}
|
||||
|
||||
$counter++;
|
||||
printf('<td style="%s"><img title="%s" src="%s" /><br />%s</td>',$cell_style,htmlspecialchars($file),htmlspecialchars($file),$file);
|
||||
}
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
|
||||
echo '</center>';
|
||||
echo '</body>';
|
||||
echo '</html>';
|
||||
?>
|
BIN
htdocs/images/info.png
Normal file
After Width: | Height: | Size: 733 B |
BIN
htdocs/images/key.png
Executable file
After Width: | Height: | Size: 519 B |
BIN
htdocs/images/logo-small.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
htdocs/images/logout.png
Normal file
After Width: | Height: | Size: 829 B |
BIN
htdocs/images/minus.png
Normal file
After Width: | Height: | Size: 98 B |
BIN
htdocs/images/plus.png
Normal file
After Width: | Height: | Size: 102 B |
BIN
htdocs/images/server.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
htdocs/images/timeout.png
Normal file
After Width: | Height: | Size: 608 B |
BIN
htdocs/images/trash-big.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
htdocs/images/uid.png
Normal file
After Width: | Height: | Size: 654 B |
BIN
htdocs/images/warning.png
Executable file
After Width: | Height: | Size: 2.2 KiB |
133
htdocs/index.php
Normal file
@@ -0,0 +1,133 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/index.php,v 1.13 2009/04/19 03:55:24 wurley Exp $
|
||||
|
||||
/**
|
||||
* Application Start Page
|
||||
*
|
||||
* @package phpTSMadmin
|
||||
* @subpackage Page
|
||||
*/
|
||||
|
||||
/**
|
||||
* @package leenooksApp
|
||||
*/
|
||||
|
||||
/*******************************************
|
||||
<pre>
|
||||
|
||||
If you are seeing this in your browser,
|
||||
PHP is not installed on your web server!!!
|
||||
|
||||
</pre>
|
||||
*******************************************/
|
||||
|
||||
/**
|
||||
* We will perform some sanity checking here, since this file is normally loaded first when users
|
||||
* first access the application.
|
||||
*/
|
||||
|
||||
# The index we will store our config in $_SESSION
|
||||
define('APPCONFIG','appConfig');
|
||||
|
||||
define('LIBDIR',sprintf('%s/',realpath('../lib/')));
|
||||
ini_set('display_errors',1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
# General functions needed to proceed.
|
||||
ob_start();
|
||||
if (! file_exists(LIBDIR.'functions.php')) {
|
||||
if (ob_get_level()) ob_end_clean();
|
||||
die(sprintf("Fatal error: Required file '<b>%sfunctions.php</b>' does not exist.",LIBDIR));
|
||||
}
|
||||
|
||||
if (! is_readable(LIBDIR.'functions.php')) {
|
||||
if (ob_get_level()) ob_end_clean();
|
||||
die(sprintf("Cannot read the file '<b>%sfunctions.php</b>' its permissions may be too strict.",LIBDIR));
|
||||
}
|
||||
|
||||
if (ob_get_level())
|
||||
ob_end_clean();
|
||||
|
||||
# Make sure this PHP install has pcre
|
||||
if (! extension_loaded('pcre'))
|
||||
die('<p>Your install of PHP appears to be missing PCRE support.</p><p>Please install PCRE support before using this application.<br /><small>(Dont forget to restart your web server afterwards)</small></p>');
|
||||
|
||||
require LIBDIR.'functions.php';
|
||||
|
||||
# Define the path to our configuration file.
|
||||
if (defined('CONFDIR'))
|
||||
$app['config_file'] = CONFDIR.'config.php';
|
||||
else
|
||||
$app['config_file'] = 'config.php';
|
||||
|
||||
# Make sure this PHP install has session support
|
||||
if (! extension_loaded('session'))
|
||||
error('<p>Your install of PHP appears to be missing php-session support.</p><p>Please install php-session support before using this application.<br /><small>(Dont forget to restart your web server afterwards)</small></p>','error',null,true);
|
||||
|
||||
# Make sure this PHP install has gettext, we use it for language translation
|
||||
if (! extension_loaded('gettext'))
|
||||
system_message(array(
|
||||
'title'=>_('Missing required extension'),
|
||||
'body'=>'Your install of PHP appears to be missing GETTEXT support.</p><p>GETTEXT is used for language translation.</p><p>Please install GETTEXT support before using this application.<br /><small>(Dont forget to restart your web server afterwards)</small>',
|
||||
'type'=>'error'));
|
||||
|
||||
# Make sure this PHP install has all our required extensions
|
||||
|
||||
/**
|
||||
* Helper functions.
|
||||
* Our required helper functions are defined in functions.php
|
||||
*/
|
||||
if (isset($app['function_files']) && is_array($app['function_files']))
|
||||
foreach ($app['function_files'] as $file_name ) {
|
||||
if (! file_exists($file_name))
|
||||
error(sprintf('Fatal error: Required file "%s" does not exist.',$file_name),'error',null,true);
|
||||
|
||||
if (! is_readable($file_name))
|
||||
error(sprintf('Fatal error: Cannot read the file "%s", its permissions may be too strict.',$file_name),'error',null,true);
|
||||
|
||||
ob_start();
|
||||
require $file_name;
|
||||
if (ob_get_level()) ob_end_clean();
|
||||
}
|
||||
|
||||
# Configuration File check
|
||||
if (! file_exists($app['config_file'])) {
|
||||
error(sprintf(_('You need to configure %s. Edit the file "%s" to do so. An example config file is provided in "%s.example".'),app_name(),$app['config_file'],$app['config_file']),'error',null,true);
|
||||
|
||||
} elseif (! is_readable($app['config_file'])) {
|
||||
error(sprintf('Fatal error: Cannot read your configuration file "%s", its permissions may be too strict.',$app['config_file']),'error',null,true);
|
||||
}
|
||||
|
||||
# If our config file fails the sanity check, then stop now.
|
||||
if (! $config = check_config($app['config_file'])) {
|
||||
$www['page'] = new page();
|
||||
$www['body'] = new block();
|
||||
$www['page']->block_add('body',$www['body']);
|
||||
$www['page']->display();
|
||||
exit;
|
||||
|
||||
} else {
|
||||
app_session_start();
|
||||
$_SESSION[APPCONFIG] = $config;
|
||||
}
|
||||
|
||||
if ($uri = get_request('URI','GET'))
|
||||
header(sprintf('Location: cmd.php?%s',base64_decode($uri)));
|
||||
|
||||
if (! ereg('^([0-9]+\.?)+',app_version())) {
|
||||
if (count($_SESSION[APPCONFIG]->untested()))
|
||||
system_message(array(
|
||||
'title'=>'Untested configuration paramaters',
|
||||
'body'=>sprintf('The following parameters have not been tested. If you have configured these parameters, and they are working as expected, please let the developers know, so that they can be removed from this message.<br/><small>%s</small>',join(', ',$_SESSION[APPCONFIG]->untested())),
|
||||
'type'=>'info','special'=>true));
|
||||
|
||||
$server = $_SESSION[APPCONFIG]->getServer(get_request('server_id','REQUEST'));
|
||||
if (count($server->untested()))
|
||||
system_message(array(
|
||||
'title'=>'Untested server configuration paramaters',
|
||||
'body'=>sprintf('The following parameters have not been tested. If you have configured these parameters, and they are working as expected, please let the developers know, so that they can be removed from this message.<br/><small>%s</small>',join(', ',$server->untested())),
|
||||
'type'=>'info','special'=>true));
|
||||
}
|
||||
|
||||
include './cmd.php';
|
||||
?>
|
111
htdocs/js/app_ajax.js
Normal file
@@ -0,0 +1,111 @@
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/js/app_ajax.js,v 1.1 2008/01/14 22:13:26 wurley Exp $
|
||||
|
||||
/**
|
||||
* @package leenooksApp
|
||||
*/
|
||||
|
||||
// current request
|
||||
var http_request = null;
|
||||
var http_request_success_callback = '';
|
||||
var http_request_error_callback = '';
|
||||
|
||||
// include html into a component
|
||||
function includeHTML(component, html) {
|
||||
if (typeof(component) != 'object' || typeof(html) != 'string') return;
|
||||
component.innerHTML = html;
|
||||
|
||||
var scripts = component.getElementsByTagName('script');
|
||||
if (!scripts) return;
|
||||
|
||||
// load scripts
|
||||
for (var i = 0; i < scripts.length; i++) {
|
||||
var scriptclone = document.createElement('script');
|
||||
if (scripts[i].attributes.length > 0) {
|
||||
for (var j in scripts[i].attributes) {
|
||||
if (typeof(scripts[i].attributes[j]) != 'undefined'
|
||||
&& typeof(scripts[i].attributes[j].nodeName) != 'undefined'
|
||||
&& scripts[i].attributes[j].nodeValue != null
|
||||
&& scripts[i].attributes[j].nodeValue != '') {
|
||||
scriptclone.setAttribute(scripts[i].attributes[j].nodeName, scripts[i].attributes[j].nodeValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
scriptclone.text = scripts[i].text;
|
||||
scripts[i].parentNode.replaceChild(scriptclone, scripts[i]);
|
||||
eval(scripts[i].innerHTML);
|
||||
}
|
||||
}
|
||||
|
||||
// callback function
|
||||
function alertHttpRequest() {
|
||||
if (http_request && (http_request.readyState == 4)) {
|
||||
if (http_request.status == 200) {
|
||||
response = http_request.responseText;
|
||||
http_request = null;
|
||||
//alert(response);
|
||||
if (http_request_success_callback) {
|
||||
eval(http_request_success_callback + '(response)');
|
||||
}
|
||||
} else {
|
||||
alert('There was a problem with the request.');
|
||||
cancelHttpRequest();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cancelHttpRequest() {
|
||||
if (http_request) {
|
||||
http_request = null;
|
||||
if (http_request_error_callback) {
|
||||
eval(http_request_error_callback + '()');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// resquest
|
||||
function makeGETRequest(url, parameters, successCallbackFunctionName, errorCallbackFunctionName) {
|
||||
makeHttpRequest(url, parameters, 'GET', successCallbackFunctionName, errorCallbackFunctionName);
|
||||
}
|
||||
|
||||
function makePOSTRequest(url, parameters, successCallbackFunctionName, errorCallbackFunctionName) {
|
||||
makeHttpRequest(url, parameters, 'POST', successCallbackFunctionName, errorCallbackFunctionName);
|
||||
}
|
||||
|
||||
function makeHttpRequest(url, parameters, meth, successCallbackFunctionName, errorCallbackFunctionName) {
|
||||
cancelHttpRequest();
|
||||
|
||||
http_request_success_callback = successCallbackFunctionName;
|
||||
http_request_error_callback = errorCallbackFunctionName;
|
||||
|
||||
if (window.XMLHttpRequest) { // Mozilla, Safari,...
|
||||
http_request = new XMLHttpRequest();
|
||||
if (http_request.overrideMimeType) {
|
||||
http_request.overrideMimeType('text/html');
|
||||
}
|
||||
} else if (window.ActiveXObject) { // IE
|
||||
try {
|
||||
http_request = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
} catch (e) {
|
||||
try {
|
||||
http_request = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
if (!http_request) {
|
||||
alert('Cannot create XMLHTTP instance.');
|
||||
return false;
|
||||
}
|
||||
|
||||
http_request.onreadystatechange = window['alertHttpRequest'];
|
||||
if (meth == 'GET') url = url + '?' + parameters;
|
||||
http_request.open(meth, url, true);
|
||||
|
||||
http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
http_request.setRequestHeader("Content-length", parameters.length);
|
||||
http_request.setRequestHeader("Connection", "close");
|
||||
|
||||
if (meth == 'GET') parameters = null;
|
||||
http_request.send(parameters);
|
||||
}
|
||||
|
18
htdocs/js/menu_hide.js
Normal file
@@ -0,0 +1,18 @@
|
||||
var current;
|
||||
|
||||
/**
|
||||
* Toggle the displayed menu
|
||||
*/
|
||||
function menu_unhide(whichLayer,old) {
|
||||
if (current == null) current = old;
|
||||
var oldmenu = document.getElementById('MID_'+current).style;
|
||||
oldmenu.display = 'none';
|
||||
|
||||
if (document.getElementById) {
|
||||
// this is the way the standards work
|
||||
var newmenu = document.getElementById(whichLayer).value;
|
||||
var newmenu_div = document.getElementById('MID_'+newmenu).style;
|
||||
newmenu_div.display = 'block';
|
||||
}
|
||||
current = newmenu;
|
||||
}
|
166
htdocs/library.info.php
Normal file
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/library.info.php,v 1.21 2008/08/14 06:44:39 wurley Exp $
|
||||
|
||||
# @todo: It would be nice, if show slots hasnt been run, that we display a message to run audit libr. Then we will know that slots are empty, and be able to show that correctly.
|
||||
|
||||
# Required Libraries
|
||||
require './common.php';
|
||||
|
||||
# Data collection.
|
||||
$libraries = objectCache('libraries');
|
||||
$volumes = objectCache('volumes');
|
||||
$stgpools = objectCache('stgps');
|
||||
|
||||
# Library
|
||||
if ($libraries->getLibraries()) {
|
||||
foreach ($libraries->getLibraries() as $library) {
|
||||
|
||||
printf(_('Information on libraries %s.'),$library->getName());
|
||||
echo '<table width="100%" class="result" border=0>';
|
||||
|
||||
# Does this library support show slots?
|
||||
if (isset($library->slots)) {
|
||||
|
||||
printf('<tr><td colspan=3>'.
|
||||
classValue(_('This is a %s library, with %s slots and %s drives.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$library->getAttr('ProductId'),
|
||||
$library->getAttr('Slots'),
|
||||
$library->getAttr('Drives'));
|
||||
|
||||
# Show the drives
|
||||
foreach ($library->getDrives() as $drive) {
|
||||
printf('<tr><td> </td><td colspan=2>'.
|
||||
classValue(_('Drive %s (Status %s).'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$drive->getName(),
|
||||
$drive->volume ? sprintf('%s-%s',$drive->status,$drive->volume) : $drive->status);
|
||||
}
|
||||
echo '<tr><td colspan=3> </td></tr>';
|
||||
|
||||
# Library Configuration
|
||||
printf('<tr><td> </td><td colspan=2>'.
|
||||
classValue(_('%s shared library.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$library->shared);
|
||||
|
||||
printf('<tr><td> </td><td colspan=2>'.
|
||||
classValue(_('%s auto label.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
($library->autolabel ? $library->autolabel : 'NO'));
|
||||
|
||||
# Volume Details
|
||||
printf('<tr><td> </td><td colspan=2>'.
|
||||
classValue(_('%s slots with NO volumes.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$library->getAttr('Slots') - count($library->slots));
|
||||
|
||||
printf('<tr><td> </td><td colspan=2>'.
|
||||
classValue(_('%s volumes physically in this library.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
count($library->slotVolumes(true))+count($library->slotVolumes(false)));
|
||||
|
||||
printf('<tr><td> </td><td colspan=2>'.
|
||||
classValue(_('%s volumes NOT checked in.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
count($library->slotVolumes(false)));
|
||||
|
||||
printf('<tr><td> </td><td colspan=2>'.
|
||||
classValue(_('%s volumes are checked into this library.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
count($library->slotVolumes(true)));
|
||||
|
||||
printf('<tr><td> </td><td> </td><td>'.
|
||||
classValue(_('%s EMPTY volumes.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
count($library->getLibraryEmpty()));
|
||||
|
||||
printf('<tr><td> </td><td> </td><td>'.
|
||||
classValue(_('%s PENDING volumes.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
count($library->getLibraryPending()));
|
||||
|
||||
printf('<tr><td> </td><td> </td><td>'.
|
||||
classValue(_('%s SCRATCH volumes.'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
count($library->getLibraryScratch()));
|
||||
|
||||
echo '<tr><td colspan=4> </td></tr>';
|
||||
|
||||
# Volumes in Library.
|
||||
printf('<tr><td colspan=3>%s</td></tr>',
|
||||
_('The following volumes are currently in this library:'));
|
||||
echo '<tr><td colspan=3><table width="100%" class="result_table" border=0>';
|
||||
echo '<tr><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>';
|
||||
|
||||
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 '<tr class="highlight">';
|
||||
elseif ($slot['status'] == 'Full')
|
||||
echo '<tr class="shadow">';
|
||||
else
|
||||
echo '<tr class="'.(@$counter++%2==0?'even':'odd').'">';
|
||||
|
||||
printf('<td><acronym title="Element: %s">%s</acronym></td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td><acronym title="Storage Pool Reclaim: %s">%s</acronym></td><td>%s</td><td>%s</td></tr>',
|
||||
$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 '</table></td></tr>';
|
||||
echo '<tr><td colspan=3> </td></tr>';
|
||||
|
||||
} else {
|
||||
printf('<tr><td colspan=2>'.
|
||||
classValue(_('This is a %s library'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$library->type);
|
||||
|
||||
# Show the drives
|
||||
foreach ($library->getDrives() as $drive) {
|
||||
printf('<tr><td> </td><td>'.
|
||||
classValue(_('Drive %s (Status %s).'),'value').
|
||||
'</td><td> </td></tr>',
|
||||
$drive->getName(),
|
||||
$drive->volume ? sprintf('%s-%s',$drive->status,$drive->volume) : $drive->status);
|
||||
}
|
||||
echo '<tr><td colspan=3> </td></tr>';
|
||||
}
|
||||
echo '</table>';
|
||||
}
|
||||
} else {
|
||||
echo _('No Library');
|
||||
printf('<table><tr><td colspan=3>%s</td></tr></table>',
|
||||
_('There are no automated libraries defined to this TSM server.'));
|
||||
}
|
||||
?>
|
39
htdocs/login.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/login.php,v 1.2 2009/04/19 04:00:59 wurley Exp $
|
||||
|
||||
/**
|
||||
* Log the user in.
|
||||
*
|
||||
* @package leenooksApp
|
||||
* @subpackage Page
|
||||
*/
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
require './common.php';
|
||||
|
||||
$user = array();
|
||||
$user['login'] = get_request('login');
|
||||
$user['password'] = get_request('login_pass');
|
||||
|
||||
if ($user['login'] && ! strlen($user['password']))
|
||||
system_message(array(
|
||||
'title'=>_('Authenticate to server'),
|
||||
'body'=>_('You left the password blank.'),
|
||||
'type'=>'warn'),
|
||||
sprintf('cmd.php?cmd=login_form&server_id=%s',get_request('server_id','REQUEST')));
|
||||
|
||||
if ($app['server']->login($user['login'],$user['password'],'user'))
|
||||
system_message(array(
|
||||
'title'=>_('Authenticate to server'),
|
||||
'body'=>_('Successfully logged into server.'),
|
||||
'type'=>'info'),
|
||||
sprintf('cmd.php?server_id=%s',get_request('server_id','REQUEST')));
|
||||
else
|
||||
system_message(array(
|
||||
'title'=>_('Failed to Authenticate to server'),
|
||||
'body'=>_('Invalid Username or Password.'),
|
||||
'type'=>'error'),
|
||||
sprintf('cmd.php?cmd=login_form&server_id=%s',get_request('server_id','REQUEST')));
|
||||
?>
|
90
htdocs/login_form.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/login_form.php,v 1.3 2009/04/19 04:00:59 wurley Exp $
|
||||
|
||||
/**
|
||||
* Displays the login form for a server for users who specify 'cookie' or 'session' for their auth_type.
|
||||
*
|
||||
* @author Deon George (c) 2009
|
||||
* @package leenooksApp
|
||||
* @see login.php
|
||||
*/
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
require './common.php';
|
||||
|
||||
printf('<h3 class="title">%s %s</h3>',_('Authenticate to server'),$app['server']->getName());
|
||||
echo '<br />';
|
||||
|
||||
# Check for a secure connection
|
||||
if (! isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on') {
|
||||
echo '<center>';
|
||||
echo '<span style="color:red">';
|
||||
printf('<acronym title="%s"><b>%s: %s.</b></acronym>',
|
||||
_('You are not using \'https\'. Web browser will transmit login information in clear text.'),
|
||||
_('Warning'),_('This web connection is unencrypted'));
|
||||
echo '</span>';
|
||||
echo '</center>';
|
||||
}
|
||||
echo '<br />';
|
||||
|
||||
# Login form.
|
||||
echo '<form action="cmd.php" method="post" name="login_form">';
|
||||
echo '<input type="hidden" name="cmd" value="login" />';
|
||||
printf('<input type="hidden" name="server_id" value="%s" />',$app['server']->getIndex());
|
||||
|
||||
if (get_request('redirect','GET',false,false))
|
||||
printf('<input type="hidden" name="redirect" value="%s" />',rawurlencode(get_request('redirect','GET')));
|
||||
|
||||
echo '<center>';
|
||||
echo '<table class="forminput">';
|
||||
|
||||
printf('<tr><td><b>%s:</b></td></tr>',
|
||||
$app['server']->getValue('login','auth_text') ? $app['server']->getValue('login','auth_text') :
|
||||
($app['server']->getValue('login','attr') == 'dn' ? _('Login DN') : $_SESSION[APPCONFIG]->getFriendlyName($app['server']->getValue('login','attr'))));
|
||||
|
||||
printf('<tr><td><input type="text" id="login" name="login" size="40" value="%s" /></td></tr>',
|
||||
$app['server']->getValue('login','attr',false) == 'dn' ? $app['server']->getValue('login','bind_id') : '');
|
||||
|
||||
echo '<tr><td colspan=2> </td></tr>';
|
||||
printf('<tr><td><b>%s:</b></td></tr>',_('Password'));
|
||||
echo '<tr><td><input type="password" id="password" size="40" value="" name="login_pass" /></td></tr>';
|
||||
echo '<tr><td colspan=2> </td></tr>';
|
||||
|
||||
if (method_exists($app['server'],'registerEnabled') && $app['server']->registerEnabled()) {
|
||||
printf('<tr><td><center><a href="%s"><img src="%s" /> %s</a></center></td></tr>','cmd.php?cmd=register_form',IMGDIR.'add.png',_('Register'));
|
||||
echo '<tr><td colspan=2> </td></tr>';
|
||||
}
|
||||
|
||||
# If Anon bind allowed, then disable the form if the user choose to bind anonymously.
|
||||
if ($app['server']->isAnonBindAllowed())
|
||||
printf('<tr><td colspan="2"><small><b>%s</b></small> <input type="checkbox" name="anonymous_bind" onclick="toggle_disable_login_fields(this)" id="anonymous_bind_checkbox" /></td></tr>',
|
||||
_('Anonymous'));
|
||||
|
||||
printf('<tr><td colspan="2"><center><input type="submit" name="submit" value="%s" /></center></td></tr>',
|
||||
_('Authenticate'));
|
||||
|
||||
echo '</table>';
|
||||
echo '</center>';
|
||||
echo '</form>';
|
||||
|
||||
echo '<script type="text/javascript" language="javascript">document.getElementById(\'login\').focus()</script>';
|
||||
|
||||
if ($app['server']->isAnonBindAllowed() ) {
|
||||
?>
|
||||
<script type="text/javascript" language="javascript">
|
||||
function toggle_disable_login_fields(anon_checkbox) {
|
||||
if (anon_checkbox.checked) {
|
||||
anon_checkbox.form.login.disabled = true;
|
||||
anon_checkbox.form.password.disabled = true;
|
||||
} else {
|
||||
anon_checkbox.form.login.disabled = false;
|
||||
anon_checkbox.form.login.focus();
|
||||
anon_checkbox.form.password.disabled = false;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
28
htdocs/logout.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/logout.php,v 1.2 2009/04/19 04:00:59 wurley Exp $
|
||||
|
||||
/**
|
||||
* Log the user out of the application.
|
||||
*
|
||||
* @package leenooksApp
|
||||
* @subpackage Page
|
||||
*/
|
||||
|
||||
/**
|
||||
*/
|
||||
|
||||
require './common.php';
|
||||
|
||||
if ($app['server']->logout('user'))
|
||||
system_message(array(
|
||||
'title'=>_('Authenticate to server'),
|
||||
'body'=>_('Successfully logged out of server.'),
|
||||
'type'=>'info'),
|
||||
'index.php');
|
||||
else
|
||||
system_message(array(
|
||||
'title'=>_('Failed to Logout of server'),
|
||||
'body'=>_('Please report this error to the admins.'),
|
||||
'type'=>'error'),
|
||||
'index.php');
|
||||
?>
|
297
htdocs/node.detail.php
Normal file
@@ -0,0 +1,297 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/node.detail.php,v 1.11 2009/04/19 04:57:32 wurley Exp $
|
||||
|
||||
# This page should detail on Client storage usage.
|
||||
|
||||
# Required Libraries
|
||||
require './common.php';
|
||||
|
||||
/**
|
||||
* This function returns an HTML table of the NODES FILE SYSTEMS for the $type
|
||||
*/
|
||||
function showFSDetails($node,$type) {
|
||||
if (! $node->getFSOccupancy($type))
|
||||
return null;
|
||||
|
||||
$blockBody = '<table class="result_table">';
|
||||
switch ($type) {
|
||||
case 'Bkup' :
|
||||
$blockBody .= sprintf('<tr><td class="heading" colspan="%s">Backup Space Utilisation</td></tr>',
|
||||
3+count($node->getStoragePools()));
|
||||
break;
|
||||
|
||||
case 'Arch' :
|
||||
$blockBody .= sprintf('<tr><td class="heading" colspan="%s">Archive Space Utilisation</td></tr>',
|
||||
3+count($node->getStoragePools()));
|
||||
break;
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
$blockBody .= '<tr>';
|
||||
$blockBody .= '<td class="titlel">File System</td>';
|
||||
$blockBody .= '<td class="titlel">Last Backup</td>';
|
||||
$blockBody .= '<td class="titler">Last Size</td>';
|
||||
# List out the Storage Pools
|
||||
foreach ($node->getStoragePools() as $stgp)
|
||||
$blockBody .= sprintf('<td class="titler">%s</td>',$stgp);
|
||||
$blockBody .= '</tr>';
|
||||
|
||||
$counter = 0;
|
||||
foreach ($node->getFSOccupancy($type) as $fs => $object) {
|
||||
$blockBody .= sprintf('<tr class="%s">',($counter++%2==0?'even':'odd'));
|
||||
$blockBody .= sprintf('<td><acronym title="%s">%s</acronym></td>',
|
||||
trim($object->type) ? $object->type : 'Unknown File System',$object->getName());
|
||||
|
||||
$blockBody .= sprintf('<td><acronym title="%s - %s">%s </acronym></td>',
|
||||
isset($object->backup['start']) ? tsmdate($object->backup['start'],'nomsec') : 'NO START',
|
||||
isset($object->backup['end']) ? tsmdate($object->backup['end'],'nomsec') : 'NO END',
|
||||
isset($object->backup['end']) ? tsmdate($object->backup['end'],'notime') : 'NO DATE',
|
||||
$object->getName());
|
||||
|
||||
$blockBody .= sprintf('<td align="right"><acronym title="%s MB (%s%%)">%s MB</acronym></td>',
|
||||
isset($object->capacity) ? number_format($object->capacity) : '?',
|
||||
isset($object->util) ? $object->util : '?',
|
||||
number_format($object->capacity*$object->util/100));
|
||||
|
||||
foreach ($node->getStoragePools() as $stgp) {
|
||||
if (isset($object->occupancy[$type][$stgp]))
|
||||
$blockBody .= sprintf('<td align="right"><acronym title="%s files">%s</acronym>%s</td>',
|
||||
number_format($object->occupancy[$type][$stgp]['num'],0),
|
||||
number_format($object->occupancy[$type][$stgp]['physical'],2),
|
||||
count($object->getVolumeUsage($stgp)) ? sprintf(' <acronym title="# Volumes"><sub>(%s)</sub></acronym>',count($object->getVolumeUsage($stgp))) : '');
|
||||
else
|
||||
$blockBody .= '<td> </td>';
|
||||
}
|
||||
$blockBody .= '</tr>';
|
||||
}
|
||||
$blockBody .= '</table>';
|
||||
$blockBody .= "\n\n";
|
||||
|
||||
return $blockBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function returns an HTML table of the VOLUMES used by a $node of $type
|
||||
*/
|
||||
function showVols($node,$type='Bkup') {
|
||||
if (! $node->getVolumes($type))
|
||||
return null;
|
||||
|
||||
$blockBody = '<table class="result_table">';
|
||||
switch ($type) {
|
||||
case 'Bkup' :
|
||||
$blockBody .= sprintf('<tr><td class="heading" colspan="3">Backup Volume Utilisation</td></tr>');
|
||||
break;
|
||||
|
||||
case 'Arch' :
|
||||
$blockBody .= sprintf('<tr><td class="heading" colspan="3">Archive Volume Utilisation</td></tr>');
|
||||
break;
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
$blockBody .= '<tr>';
|
||||
$blockBody .= '<td class="titlel">File System</td>';
|
||||
$blockBody .= '<td class="titlel">Storage Pool</td>';
|
||||
$blockBody .= '<td class="titlel">Volume</td>';
|
||||
$blockBody .= '</tr>';
|
||||
|
||||
$last['stg'] = '';
|
||||
$last['fs'] = '';
|
||||
$counter = 0;
|
||||
foreach ($node->getVolumes($type) as $fs => $object) {
|
||||
foreach ($object->volume[$type] as $stgp => $volumes) {
|
||||
foreach ($volumes as $vol => $volume) {
|
||||
$blockBody .= sprintf('<tr class="%s"><td>%s</td><td>%s</td><td>%s</td></tr>',
|
||||
($counter%2==0?'even':'odd'),
|
||||
$object->getName() == $last['fs'] ? '' : $object->getName(),
|
||||
$stgp == $last['stg'] ? '' : $stgp,
|
||||
sprintf('%s (%s/%s%s)',$vol,
|
||||
$volume->status['volume'],$volume->access,
|
||||
trim($volume->location) ? '-'.$volume->location : ''));
|
||||
|
||||
$last['stg'] = $stgp;
|
||||
$last['fs'] = $object->getName();
|
||||
}
|
||||
$counter++;
|
||||
}
|
||||
}
|
||||
$blockBody .= '</table>';
|
||||
$blockBody .= "\n\n";
|
||||
|
||||
return $blockBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function returns an HTML table of the VOLUMES by PRIMARY/COPY used by a $node of $type
|
||||
*/
|
||||
function showAllvols($node,$type='Bkup') {
|
||||
if (! $node->getVolumes($type))
|
||||
return null;
|
||||
|
||||
$blockBody = '<table class="result_table">';
|
||||
switch ($type) {
|
||||
case 'Bkup' :
|
||||
$blockBody .= sprintf('<tr><td class="heading" colspan="2">Backup Volume Utilisation</td></tr>');
|
||||
break;
|
||||
|
||||
case 'Arch' :
|
||||
$blockBody .= sprintf('<tr><td class="heading" colspan="2">Archive Volume Utilisation</td></tr>');
|
||||
break;
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
$counter = 0;
|
||||
foreach ($node->getPrimaryVolumes($type) as $volumename => $volume) {
|
||||
$blockBody .= sprintf('<tr class="%s"><td>%s</td><td>%s</td></tr>',
|
||||
($counter%2==0?'even':'odd'),
|
||||
! $counter ? 'Primary' : ' ',
|
||||
sprintf('%s (%s/%s%s)',$volume->getName(),
|
||||
$volume->status['volume'],$volume->access,
|
||||
trim($volume->location) ? '-'.$volume->location : ''));
|
||||
$counter++;
|
||||
}
|
||||
|
||||
$counter = 0;
|
||||
foreach ($node->getCopyVolumes($type) as $volumename => $volume) {
|
||||
$blockBody .= sprintf('<tr class="%s"><td>%s</td><td>%s</td></tr>',
|
||||
($counter%2==0?'even':'odd'),
|
||||
! $counter ? 'Copy' : ' ',
|
||||
sprintf('%s (%s/%s%s)',$volume->getName(),
|
||||
$volume->status['volume'],$volume->access,
|
||||
trim($volume->location) ? '-'.$volume->location : ''));
|
||||
$counter++;
|
||||
}
|
||||
|
||||
$blockBody .= '</table>';
|
||||
$blockBody .= "\n\n";
|
||||
|
||||
return $blockBody;
|
||||
}
|
||||
|
||||
# Defaults
|
||||
$nodes = objectCache('nodes');
|
||||
$mgmtclass = objectCache('mgmtclasses');
|
||||
|
||||
# List of Clients.
|
||||
printf(_('Select NODE on %s'),$app['server']->getValue('server','name'));
|
||||
|
||||
echo '<form action="cmd.php">';
|
||||
printf('<input type="hidden" name="cmd" value="%s" />',get_request('cmd','REQUEST'));
|
||||
printf('<input type="hidden" name="index" value="%s" />',$app['server']->getIndex());
|
||||
|
||||
echo '<select name="NODE">';
|
||||
foreach ($nodes->getNodes() as $node) {
|
||||
printf('<option id="%s" %s>%s</option>',
|
||||
$node->getName(),
|
||||
isset($_REQUEST['NODE']) && $node->getName() == $_REQUEST['NODE'] ? 'selected' : '',
|
||||
$node->getName());
|
||||
}
|
||||
echo '</select>';
|
||||
echo '<input align="left" type="submit" name="submit" value="Go" />';
|
||||
echo '</form>';
|
||||
echo "\n";
|
||||
|
||||
if (isset($_REQUEST['NODE'])) {
|
||||
echo '<br />';
|
||||
echo '<table class="result" width=100% border=0>';
|
||||
printf('<tr><td colspan=3><h3>NODE detail for <u>%s</u> on %s</h3></td></tr>',
|
||||
$_REQUEST['NODE'],$app['server']->getValue('server','name'));
|
||||
|
||||
$node = $nodes->nodes[$_REQUEST['NODE']];
|
||||
if ($node->url)
|
||||
printf('<tr><td colspan=2>System Name</td><td><a href="%s"><b>%s</b></a></td></tr>',
|
||||
$node->url,$node->hostname);
|
||||
else
|
||||
printf('<tr><td colspan=2>System Name</td><td><b>%s</b></td></tr>',$node->hostname ? $node->hostname : ' ');
|
||||
|
||||
printf('<tr><td colspan=2>Contact</td><td><b>%s</b></td></tr>',$node->contact ? $node->contact : ' ');
|
||||
|
||||
printf('<tr><td colspan=2>OS</td><td><b>%s (%s)</b></td></tr>',
|
||||
$node->os,$node->level['os']);
|
||||
|
||||
printf('<tr><td colspan=2>TSM Client Version</td><td><b>%s.%s.%s.%s</b></td></tr>',
|
||||
$node->level['tsm_ver'],$node->level['tsm_rel'],$node->level['tsm_lvl'],$node->level['tsm_slv']);
|
||||
|
||||
echo '<tr><td colspan=3><h4>Access Information</h4></td></tr>';
|
||||
printf('<tr><td colspan=2>Registered</td><td><b>%s</b></td></tr>',
|
||||
tsmDate($node->time['registered'],'nosec'));
|
||||
printf('<tr><td colspan=2>Last Accessed</td><td><b>%s</b> (%2.0f days ago)</td></tr>',
|
||||
tsmDate($node->time['lastacc'],'nosec'),
|
||||
(time()-strtotime(tsmDate($node->time['lastacc'],'nosec')))/86400);
|
||||
printf('<tr><td colspan=2>Last Password Change</td><td><b>%s</b> (%2.0f days ago)</td></tr>',
|
||||
tsmDate($node->time['pwset'],'nosec'),
|
||||
(time()-strtotime(tsmDate($node->time['pwset'],'nosec')))/86400);
|
||||
printf('<tr><td colspan=2>Password Expiry</td><td><b>%s</b></td></tr>',
|
||||
tsmDate($node->passwd['expiry'],'nosec') ? tsmDate($node->passwd['expiry'],'nosec') : ' ');
|
||||
printf('<tr><td colspan=2>Invalid Password Count</td><td><b>%s</b> (%s)</td></tr>',
|
||||
$node->passwd['invalid'],
|
||||
$node->locked ? 'LOCKED' : 'NOT Locked');
|
||||
|
||||
echo '<tr><td colspan=3><h4>Configuration Options</h4></td></tr>';
|
||||
printf('<tr><td colspan=2>Option Set</td><td><b>%s</b></td></tr>',$node->cloptset ? $node->cloptset : ' ');
|
||||
printf('<tr><td colspan=2>Compression </td><td><b>%s</b></td></tr>',
|
||||
$node->compression ? 'YES' : 'NO');
|
||||
printf('<tr><td colspan=2>TXN Group Max</td><td><b>%s</b></td></tr>',$node->txngroupmax ? $node->txngroupmax : ' ');
|
||||
printf('<tr><td colspan=2>Can Delete Archives</td><td><b>%s</b></td></tr>',
|
||||
$node->delete['arch'] ? 'YES' : 'NO');
|
||||
printf('<tr><td colspan=2>Can Delete Backups</td><td><b>%s</b></td></tr>',
|
||||
$node->delete['back'] ? 'YES' : 'NO');
|
||||
printf('<tr><td colspan=2>Keep Mount Points</td><td><b>%s</b> (%s)</td></tr>',
|
||||
$node->mp['keep'] ? 'YES' : 'NO',$node->mp['max']);
|
||||
|
||||
echo '<tr><td colspan=3><h4>Storage Configuration</h4></td></tr>';
|
||||
printf('<tr><td colspan=2>Colloc Group Name</td><td><b>%s</b></td></tr>',$node->group ? $node->group : _('Not Set'));
|
||||
echo '<tr><td colspan=3> </td></tr>';
|
||||
printf('<tr><td colspan=2>Backup Domain</td><td><b>%s</b></td></tr>',$node->domain);
|
||||
|
||||
# Show the MGMTClasses that apply to this node.
|
||||
printf('<tr><td> </td><td colspan=2><i>Available Backup Management Classes</i></td></tr>');
|
||||
foreach ($mgmtclass->getMgmtClasses($node->domain,'Bkup') as $object) {
|
||||
if (is_object($object))
|
||||
printf('<tr><td> </td><td><acronym title="File Exists: %s Version(s)/%s Day(s), File Deleted: %s Version(s)/%s Day(s), Frequency: %s Day(s)"><b>%s</b></acronym>%s</td><td>Storage Pool: <b>%s</b></td></tr>',
|
||||
$object->version['EXISTS'],$object->retain['EXTRA'],$object->version['DELETED'],$object->retain['ONLY'],$object->frequency,$object->getName(),
|
||||
$object->isDefaultMgmtClass() ? ' <sub>(Default)</sub>' : '',
|
||||
$object->getStoragePool() ? $object->getStoragePool()->getName() : sprintf('<sub>(%s)</sub>',_('Storage Pool Doesnt Exist')));
|
||||
}
|
||||
|
||||
printf('<tr><td> </td><td colspan=2><i>Available Archive Management Classes</i></td></tr>');
|
||||
foreach ($mgmtclass->getMgmtClasses($node->domain,'Arch') as $object) {
|
||||
if (is_object($object))
|
||||
printf('<tr><td> </td><td><acronym title="Days: %s"><b>%s</b></acronym>%s</td><td>Storage Pool: <b>%s</b></td></tr>',
|
||||
$object->retain['DAYS'],$object->getName(),
|
||||
$object->isDefaultMgmtClass() ? ' <sub>(Default)</sub>' : '',
|
||||
$object->getStoragePool() ? $object->getStoragePool()->getName() : sprintf('<sub>(%s)</sub>',_('Storage Pool Doesnt Exist')));
|
||||
}
|
||||
|
||||
echo '<tr><td colspan=3><h4>Storage Utilisation</h4></td></tr>';
|
||||
|
||||
if ($node->getFileSystems()) {
|
||||
printf('<tr><td colspan=3>%s</td></tr>',showFSDetails($node,'Bkup'));
|
||||
echo '<tr><td colspan=3> </td></tr>';
|
||||
printf('<tr><td colspan=3>%s</td></tr>',showFSDetails($node,'Arch'));
|
||||
|
||||
} else {
|
||||
echo '<tr><td colspan=3>TSM does not have any data for this host.</td></tr>';
|
||||
}
|
||||
|
||||
if (count($node->getVolumeUsage())) {
|
||||
echo '<tr><td colspan=3><h4>Volume Utilisation</h4></td></tr>';
|
||||
printf('<tr><td colspan=3>%s</td></tr>',showAllVols($node,'Bkup'));
|
||||
echo '<tr><td colspan=3> </td></tr>';
|
||||
printf('<tr><td colspan=3>%s</td></tr>',showAllVols($node,'Arch'));
|
||||
|
||||
echo '<tr><td colspan=3><h4>Volume Utilisation by File System</h4></td></tr>';
|
||||
printf('<tr><td colspan=3>%s</td></tr>',showVols($node,'Bkup'));
|
||||
echo '<tr><td colspan=3> </td></tr>';
|
||||
printf('<tr><td colspan=3>%s</td></tr>',showVols($node,'Arch'));
|
||||
}
|
||||
|
||||
echo '</table>';
|
||||
}
|
||||
?>
|
92
htdocs/node.occupancy.php
Normal file
@@ -0,0 +1,92 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/node.occupancy.php,v 1.9 2009/04/19 04:57:32 wurley Exp $
|
||||
|
||||
# This page should return the summary of the client occupancy.
|
||||
|
||||
# Required Libraries
|
||||
require './common.php';
|
||||
|
||||
# Defaults
|
||||
$nodes = objectCache('nodes');
|
||||
|
||||
# Header
|
||||
$blockTitle['graph'] = sprintf(_('Client Occupancy Summary on %s'),$app['server']->getValue('server','name'));
|
||||
$blockBody['graph'] = '<table class="result_table">';
|
||||
|
||||
$blockTitle['occ'] = sprintf(_('Client Occupancy Summary on %s'),$app['server']->getValue('server','name'));
|
||||
$blockBody['occ'] = '<table class="result_table">';
|
||||
|
||||
$counter = 0;
|
||||
$grandtotal = 0;
|
||||
|
||||
# Work out our stgpools with data in them.
|
||||
$stgpooltotal = array();
|
||||
$blockBody['occ'] .= sprintf('<tr><td class="heading">%s</td><td class="heading">%s</td><td class="heading">%s</td>',
|
||||
'Node','Last Acc','Type');
|
||||
foreach ($nodes->getNodes() as $node) {
|
||||
foreach ($node->getStoragePools() as $stgp) {
|
||||
if (! isset($stgpooltotal[$stgp])) {
|
||||
$blockBody['occ'] .= sprintf('<td class="heading">%s</td>',$stgp);
|
||||
$stgpooltotal[$stgp] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
$blockBody['occ'] .= sprintf('<td class="heading">%s</td></tr>','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('<tr class="%s"><td>%s</td><td>%s</td><td>%s</td>',
|
||||
($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('<td align="right">%s</td>',number_format($stgpools[$stgpool]['physical']));
|
||||
$nodetotal += $stgpools[$stgpool]['physical'];
|
||||
$stgpooltotal[$stgpool] += $stgpools[$stgpool]['physical'];
|
||||
|
||||
} else
|
||||
$blockBody['occ'] .= sprintf('<td>%s</td>',' ');
|
||||
}
|
||||
|
||||
$blockBody['occ'] .= sprintf('<td align="right"> %s</td></tr>',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'] .= '<tr><td><table class="result_table">';
|
||||
$blockBody['graph'] .= sprintf('<tr><td class="heading">%s</td><td class="heading">%s</td><td class="heading">%%</td></tr>','Days Since Access','Storage Used');
|
||||
$counter = 0;
|
||||
foreach ($_SESSION['graph']['occupancy'] as $age => $size) {
|
||||
$blockBody['graph'] .= sprintf('<tr class="%s"><td>%s</td><td align="right">%s</td><td align="right">%s</td></tr>',
|
||||
($counter++%2==0?'even':'odd'),$age,number_format($size),sprintf('%2.1f%%',$size/$grandtotal*100));
|
||||
}
|
||||
$blockBody['graph'] .= '</table></td>';
|
||||
$blockBody['graph'] .= '<td> </td>';
|
||||
$blockBody['graph'] .= sprintf('<td align="right"><img src="image.occupancy.php?index=%s" /></td></tr>',
|
||||
$app['server']->getIndex());
|
||||
$blockBody['graph'] .= '</table>';
|
||||
|
||||
$blockBody['occ'] .= sprintf('<tr class="highlight"><td class="titlel" colspan=3>%s</td>','TOTAL');
|
||||
foreach ($stgpooltotal as $stgpool => $total)
|
||||
$blockBody['occ'] .= sprintf('<td class="titler">%s</td>',number_format($total));
|
||||
$blockBody['occ'] .= sprintf('<td class="titler"> %s</td></tr>',number_format($grandtotal));
|
||||
$blockBody['occ'] .= '</table>';
|
||||
|
||||
# End
|
||||
render_page($blockTitle,$blockBody);
|
||||
?>
|
126
htdocs/node.summary.php
Normal file
@@ -0,0 +1,126 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/node.summary.php,v 1.5 2009/04/19 04:00:59 wurley Exp $
|
||||
|
||||
# This page should return all a summary of Client activitie, for the last 24 hours.
|
||||
|
||||
# @TODO: Need to allow for multiple schedules in 1 day.
|
||||
|
||||
# Required Libraries
|
||||
require './common.php';
|
||||
|
||||
# Defaults
|
||||
$todayDate = date('Y-m-d H:i');
|
||||
$yesterDate = date('Y-m-d H:i',time()-86400);
|
||||
$summaryInfo = objectCache('summaryinfo');
|
||||
$nodes = objectCache('nodes');
|
||||
|
||||
# Data collection.
|
||||
$tsmBackupSummary = $app['server']->GetActlogBackupSummary($yesterDate,$todayDate);
|
||||
|
||||
# Database Summary Information
|
||||
$blockTitle['sched'] = sprintf(_('Client Schedule Activity on %s'),$app['server']->getValue('server','name'));
|
||||
$blockBody['sched'] = '<table border=0>';
|
||||
|
||||
$blockBody['sched'] .= '<tr><td width=100%><table class="result" width=100%>';
|
||||
$blockBody['sched'] .= sprintf('<tr><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td></tr>',
|
||||
'Client','Schedule','Sched Status','Sched Start');
|
||||
|
||||
$counter = 0;
|
||||
$events = $app['server']->GetEvents($yesterDate,$todayDate,'ACTUAL_START');
|
||||
|
||||
if (count($events['detail'])) {
|
||||
foreach ($events['detail'] as $index => $tsmEvent) {
|
||||
$node = $nodes->getNode($tsmEvent['NODE_NAME']);
|
||||
|
||||
$blockBody['sched'] .= sprintf('<tr class="%s"><td><acronym title="%s (%s.%s.%s.%s)">%s</acronym></td><td>%s</td><td><acronym title="Result Code %s">%s</acronym></td><td>%s</td></tr>',
|
||||
$tsmEvent['STATUS'] == 'Failed' ? 'highlight' : ($counter++%2==0?'even':'odd'),
|
||||
$node->os,
|
||||
$node->level['tsm_ver'],$node->level['tsm_rel'],$node->level['tsm_lvl'],$node->level['tsm_slv'],
|
||||
$tsmEvent['NODE_NAME'],
|
||||
$tsmEvent['SCHEDULE_NAME'],
|
||||
$tsmEvent['RESULT'],$tsmEvent['STATUS'],
|
||||
tsmDate($tsmEvent['ACTUAL_START']));
|
||||
|
||||
$key = $tsmEvent['STATUS'].' '.$tsmEvent['RESULT'];
|
||||
@$graph['data'][$tsmEvent['SCHEDULE_NAME']][$key]++;
|
||||
@$graph['legend'][$key]++;
|
||||
}
|
||||
|
||||
} else {
|
||||
$graph = false;
|
||||
|
||||
}
|
||||
$blockBody['sched'] .= '</table></td>';
|
||||
|
||||
if ($graph) {
|
||||
$_SESSION['graph']['backupevent'] = $graph;
|
||||
$blockBody['sched'] .= sprintf('<td align="right"><img src="image.backupevents.php?index=%s" /></td>',
|
||||
$app['server']->getIndex());
|
||||
}
|
||||
$blockBody['sched'] .= '</tr></table>';
|
||||
|
||||
$blockTitle['backup'] = sprintf(_('Client Backup Session Summary on %s'),$app['server']->getValue('server','name'));
|
||||
$blockBody['backup'] = '<table class="result">';
|
||||
$blockBody['backup'] .= sprintf('<tr><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td></tr>',
|
||||
'Client','Sched','Date','Type','Session','Inspected','Backed Up','Failed','Time','MB','Agg Rate Kb/s','Compressed');
|
||||
|
||||
$counter = 0;
|
||||
$summary = $summaryInfo->getSummary($yesterDate,$todayDate);
|
||||
if (! count($summary))
|
||||
$blockBody['backup'] .= sprintf('<tr><td colspan=0>%s</td></tr>','No summary');
|
||||
else
|
||||
foreach ($summary as $tsmSession) {
|
||||
if (! in_array($tsmSession['ACTIVITY'],array('BACKUP','ARCHIVE'))) continue;
|
||||
|
||||
# Summary Information
|
||||
$client_summary = sprintf('Update: %s, Rebound: %s, Delete: %s, Expire: %s.',
|
||||
(isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Update']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Update'] : '-'),
|
||||
(isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Rebound']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Rebound'] : '-'),
|
||||
(isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Delete']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Delete'] : '-'),
|
||||
(isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Expire']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Expire'] : '-'));
|
||||
|
||||
$blockBody['backup'] .= sprintf('<tr class="%s"><td>%s</td><td>%s</td><td>%s</td><td><acronym title="%s">%s</acronym></td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td></tr>',
|
||||
($counter++%2==0?'even':'odd'),
|
||||
$tsmSession['ENTITY'],
|
||||
$tsmSession['SCHEDULE_NAME'],
|
||||
tsmDate($tsmSession['START_TIME'],'daytime'),
|
||||
$client_summary,
|
||||
$tsmSession['ACTIVITY'],
|
||||
$tsmSession['NUMBER'],
|
||||
number_format($tsmSession['EXAMINED']),
|
||||
$tsmSession['AFFECTED'],
|
||||
(isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Failed']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Failed'] : '-'),
|
||||
(isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['ProcTime']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['ProcTime'] : '-'),
|
||||
sprintf('%3.2f',$tsmSession['BYTES']/1024/1024),
|
||||
(isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['AggRate']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['AggRate'] : '-'),
|
||||
(isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Compress']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['Compress'] : '-'));
|
||||
}
|
||||
$blockBody['backup'] .= '</table>';
|
||||
|
||||
$counter = 0;
|
||||
$blockTitle['restore'] = sprintf(_('Client Restore Session Summary on %s'),$app['server']->getValue('server','name'));
|
||||
$blockBody['restore'] = '<table class="result">';
|
||||
$blockBody['restore'] .= sprintf('<tr><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td><td class="titlel">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td><td class="titler">%s</td></tr>',
|
||||
'Client','Time','Session','Type','Restored','Failed','Media W','Time','MB','Agg Rate Kb/s');
|
||||
|
||||
foreach ($summary as $tsmSession) {
|
||||
if (! in_array($tsmSession['ACTIVITY'],array('RESTORE','RETRIEVE'))) continue;
|
||||
|
||||
$blockBody['restore'] .= sprintf('<tr class="%s"><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td><td align="right">%s</td></tr>',
|
||||
($counter++%2==0?'even':'odd'),
|
||||
$tsmSession['ENTITY'],
|
||||
tsmDate($tsmSession['START_TIME'],'nosec'),
|
||||
$tsmSession['NUMBER'],
|
||||
$tsmSession['ACTIVITY'],
|
||||
$tsmSession['AFFECTED'],
|
||||
$tsmSession['FAILED'],
|
||||
$tsmSession['MEDIAW'],
|
||||
(isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['ProcTime']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['ProcTime'] : '-'),
|
||||
sprintf('%3.1fMB',$tsmSession['BYTES']/1024/1024),
|
||||
(isset($tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['AggRate']) ? $tsmBackupSummary['detail'][$tsmSession['ENTITY']][$tsmSession['NUMBER']]['AggRate'] : '-'),
|
||||
$tsmSession['SCHEDULE_NAME']);
|
||||
}
|
||||
$blockBody['restore'] .= '</table>';
|
||||
# End
|
||||
render_page($blockTitle,$blockBody);
|
||||
?>
|
21
htdocs/node.thruput.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/node.thruput.php,v 1.1 2009/04/19 05:27:13 wurley Exp $
|
||||
|
||||
# This page should show recent client thruput
|
||||
|
||||
# Required Libraries
|
||||
require './common.php';
|
||||
|
||||
$thruput = $app['server']->query("SELECT substr(varchar(END_TIME),1,10) as ADATE,ENTITY,ACTIVITY,cast(float(sum(BYTES))/1024/1024/1024 as dec(8,2)) as GB from SUMMARY where ACTIVITY='BACKUP' and END_TIME>CURRENT_TIMESTAMP-(30)DAY and (ACTIVITY in ('ARCHIVE','BACKUP','RESTORE','RETRIEVE')) group by END_TIME,ENTITY,ACTIVITY order by ADATE desc,ENTITY ",null,false,false);
|
||||
|
||||
echo '<table class="result_table">';
|
||||
printf('<tr class="%s"><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>',
|
||||
'heading','Date','Node','Type','GB');
|
||||
$counter = 0;
|
||||
foreach ($thruput as $details) {
|
||||
printf('<tr class="%s"><td>%s</td><td>%s</td><td>%s</td><td>%s</td></tr>',
|
||||
$counter++%2 ? 'even' : 'odd',
|
||||
$details['ADATE'],$details['ENTITY'],$details['ACTIVITY'],$details['GB']);
|
||||
}
|
||||
echo '</table>';
|
||||
?>
|
35
htdocs/purge_cache.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/purge_cache.php,v 1.1 2008/01/14 22:13:26 wurley Exp $
|
||||
|
||||
/**
|
||||
* @package leenooksApp
|
||||
*/
|
||||
|
||||
require './common.php';
|
||||
|
||||
if (! $_SESSION[APPCONFIG]->isCommandAvailable('purge')) {
|
||||
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('purge')),'warn');
|
||||
return;
|
||||
}
|
||||
|
||||
$purge_session_keys = array('cache');
|
||||
|
||||
$size = 0;
|
||||
foreach ($purge_session_keys as $key) {
|
||||
if (isset($_SESSION[$key])) {
|
||||
$size += strlen(serialize($_SESSION[$key]));
|
||||
unset($_SESSION[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
if (! $size)
|
||||
$body = _('No cache to purge.');
|
||||
else
|
||||
$body = sprintf(_('Purged %s bytes of cache.'),number_format($size));
|
||||
|
||||
system_message(array(
|
||||
'title'=>_('Purge cache'),
|
||||
'body'=>$body,
|
||||
'type'=>'info'),
|
||||
'index.php');
|
||||
?>
|
17
htdocs/schedule.gantt.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/schedule.gantt.php,v 1.4 2009/04/19 04:00:59 wurley Exp $
|
||||
|
||||
# @todo: Hotlink the hostname to the detail script.
|
||||
|
||||
# Required Libraries
|
||||
require './common.php';
|
||||
initJPGraph(true);
|
||||
|
||||
$blockTitle['gantt'] = sprintf(_('Schedule Gantt for server %s'),$app['server']->getValue('server','name'));
|
||||
$blockBody['gantt'] = '<table class="result"><tr><td>';
|
||||
$blockBody['gantt'] .= sprintf('<img src="%s?index=%s" border=0 />','image.schedule.gantt.php',$app['server']->getIndex()) ;
|
||||
$blockBody['gantt'] .= '</td></tr></table>';
|
||||
|
||||
# End
|
||||
render_page($blockTitle,$blockBody);
|
||||
?>
|
145
htdocs/server.db.php
Normal file
@@ -0,0 +1,145 @@
|
||||
<?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> </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> </td><td>'.classValue(_('%s (%s).'),'value').'</td></tr>',
|
||||
$key['COPY2_NAME'],$key['COPY2_STATUS']);
|
||||
|
||||
if ($key['COPY3_NAME'])
|
||||
$blockBody['db'] .= sprintf('<tr><td> </td><td>'.classValue(_('%s (%s).'),'value').'</td></tr>',
|
||||
$key['COPY3_NAME'],$key['COPY3_STATUS']);
|
||||
}
|
||||
|
||||
$blockBody['db'] .= '<tr><td colspan=2> </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> </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> </td><td>'.classValue(_('%s (%s).'),'value').'</td></tr>',
|
||||
$key['COPY2_NAME'],$key['COPY2_STATUS']);
|
||||
|
||||
if ($key['COPY3_NAME'])
|
||||
$blockBody['db'] .= sprintf('<tr><td> </td><td>'.classValue(_('%s (%s).'),'value').'</td></tr>',
|
||||
$key['COPY3_NAME'],$key['COPY3_STATUS']);
|
||||
}
|
||||
$blockBody['db'] .= '<tr><td colspan=2> </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> </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> </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> </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"> </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> </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> </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> </td></tr>';
|
||||
$blockBody['backup'] .= '</table>';
|
||||
|
||||
# End
|
||||
render_page($blockTitle,$blockBody);
|
||||
?>
|
103
htdocs/server.stats.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/server.stats.php,v 1.6 2009/04/19 04:00:59 wurley Exp $
|
||||
|
||||
# Required Libraries
|
||||
require './common.php';
|
||||
|
||||
$summaryInfo = objectCache('summaryinfo');
|
||||
|
||||
if (! isset($_REQUEST['mediaactions'])) {
|
||||
$blockTitle['form'] = _('Graph Media Statistics.');
|
||||
$blockBody['form'] = 'Please select the stats you would like to graph.';
|
||||
|
||||
$blockBody['form'] .= '<form action="cmd.php">';
|
||||
$blockBody['form'] .= sprintf('<input type="hidden" name="cmd" value="%s" />',get_request('cmd','REQUEST'));
|
||||
$blockBody['form'] .= '<select multiple size=10 name="mediaactions[]">';
|
||||
foreach ($summaryInfo->mediaActions(true) as $action) {
|
||||
$blockBody['form'] .= sprintf('<option value="%s">%s</option>',$action,$action);
|
||||
}
|
||||
$blockBody['form'] .= '</select><br />';
|
||||
$blockBody['form'] .= '<input align="left" type="submit" name="submit" value="Go" />';
|
||||
$blockBody['form'] .= sprintf('<input type="hidden" name="index" value="%s" />',$app['server']->getIndex());
|
||||
$blockBody['form'] .= '</form>';
|
||||
|
||||
} else {
|
||||
$mediawait = $summaryInfo->mediaActions();
|
||||
$graph['mediawait']['total'] = 0;
|
||||
$graph['mediawait']['count'] = 0;
|
||||
$graph['thruput']['total'] = 0;
|
||||
$graph['thruput']['count'] = 0;
|
||||
$mode = array();
|
||||
|
||||
foreach ($_REQUEST['mediaactions'] as $action) {
|
||||
if (isset($mediawait[$action]))
|
||||
foreach ($mediawait[$action] as $index => $detail) {
|
||||
$start = strtotime(tsmDate($detail['START_TIME'],'nomsec'));
|
||||
$end = strtotime(tsmDate($detail['END_TIME'],'nosec'));
|
||||
$graph['mediawait']['data'][$detail['ACTIVITY']][$end] = $detail['MEDIAW'];
|
||||
|
||||
$graph['mediawait']['total'] += $detail['MEDIAW'];
|
||||
$graph['mediawait']['count']++;
|
||||
@$mode[$detail['MEDIAW']]++;
|
||||
|
||||
$graph['thruput']['data'][$detail['ACTIVITY']][$end] = $detail['BYTES']/1024/($end+.1-$start);
|
||||
}
|
||||
|
||||
# Drop the first and last entry
|
||||
ksort($mode);
|
||||
array_pop($mode);
|
||||
$total = 0;
|
||||
$counter = 0;
|
||||
foreach ($mode as $index => $value) {
|
||||
if ($counter) {
|
||||
$total += $index * $value;
|
||||
}
|
||||
$counter++;
|
||||
}
|
||||
if ($counter)
|
||||
$graph['mediawait']['mode'] = $total/$counter;
|
||||
|
||||
# Save Session
|
||||
$_SESSION['graph'] = $graph;
|
||||
|
||||
# Media Wait Graph
|
||||
$blockTitle['mediawait'] = sprintf(_('Migration 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['mediawait'] = '<table class="blockcitem">';
|
||||
$blockBody['mediawait'] .= sprintf('<tr><th colspan=2 class="title">%s</th></tr>',_('Media Wait Graph'));
|
||||
$blockBody['mediawait'] .= '<tr><td><table class="blockcitem" border=0>';
|
||||
$blockBody['mediawait'] .= '<tr><td colspan=2> </td></tr>';
|
||||
$blockBody['mediawait'] .= '</table></td>';
|
||||
$blockBody['mediawait'] .= sprintf('<td align="right"><img src="image.server.stats.php?index=%s&activity=mediawait" /></td></tr>',
|
||||
$app['server']->getIndex());
|
||||
$blockBody['mediawait'] .= '</table>';
|
||||
|
||||
# Thruput Graph
|
||||
$blockTitle['thruput'] = sprintf(_('Server Thruput 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['thruput'] = '<table class="blockcitem">';
|
||||
$blockBody['thruput'] .= sprintf('<tr><th colspan=2 class="title">%s</th></tr>',_('Server Thruput Graph'));
|
||||
$blockBody['thruput'] .= '<tr><td><table class="blockcitem" border=0>';
|
||||
$blockBody['thruput'] .= '<tr><td colspan=2> </td></tr>';
|
||||
$blockBody['thruput'] .= '</table></td>';
|
||||
$blockBody['thruput'] .= sprintf('<td align="right"><img src="image.server.stats.php?index=%s&activity=thruput" /></td></tr>',
|
||||
$app['server']->getIndex());
|
||||
$blockBody['thruput'] .= '</table>';
|
||||
}
|
||||
}
|
||||
|
||||
# End
|
||||
render_page($blockTitle,$blockBody);
|
||||
?>
|
90
htdocs/show_cache.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/show_cache.php,v 1.4 2009/04/19 04:00:59 wurley Exp $
|
||||
|
||||
/**
|
||||
* This script shows the contents of the cache for debugging purposes
|
||||
*
|
||||
* @package leenooksApp
|
||||
*/
|
||||
/**
|
||||
*/
|
||||
|
||||
require './common.php';
|
||||
|
||||
$entry['key'] = get_request('key','REQUEST');
|
||||
$entry['index'] = get_request('index','REQUEST');
|
||||
|
||||
if (isset($entry['index']) && isset($entry['key'])) {
|
||||
list($entry['server'],$entry['x']) = split(':',$entry['index']);
|
||||
debug_dump($_SESSION[$entry['key']][$entry['server']][$entry['x']],1);
|
||||
}
|
||||
if ($entry['key'])
|
||||
debug_dump($_SESSION[$entry['key']],1);
|
||||
|
||||
if (! $_SESSION[APPCONFIG]->getValue('appearance','hide_debug_info')) {
|
||||
echo '<div style="font-size: 11px"><ul>';
|
||||
foreach (array_keys($_SESSION) as $key) {
|
||||
if (($key == 'cache') && is_array($_SESSION[$key]))
|
||||
foreach (array_keys($_SESSION['cache']) as $server) {
|
||||
foreach (array_keys($_SESSION['cache'][$server]) as $x) {
|
||||
$index = sprintf('%s:%s',$server,$x);
|
||||
|
||||
printf('<li><span id="%s"><a href="javascript:get(\'%s\',\'%s\');">%s</a></span><div id="%sloading" style="display: none" ></div></li>',
|
||||
$key.$index,$key,$index,$key.'.'.$index,$key.$index,$key.$index);
|
||||
}
|
||||
}
|
||||
else
|
||||
printf('<li><span id="%s"><a href="javascript:get(\'%s\', \'\');">%s</a></span><div id="%sloading" style="display: none" ></div></li>',
|
||||
$key,$key,$key,$key);
|
||||
}
|
||||
echo '</ul></div>';
|
||||
}
|
||||
?>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
var http_request = false;
|
||||
var newtree_div;
|
||||
var obj_key = '';
|
||||
var obj_ind = '';
|
||||
var obj = null;
|
||||
|
||||
function alertCacheContents(result) {
|
||||
if (obj) {
|
||||
obj.innerHTML = '<a href="javascript:close(\'' + obj_key + '\', \'' + obj_ind + '\')">' + obj_key + '.' + obj_ind + ' [close]<\/a>';
|
||||
obj.innerHTML += result;
|
||||
obj = null;
|
||||
newtree_div.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
function cancelCacheContents() {
|
||||
if (obj) {
|
||||
obj.innerHTML = '<a href="javascript:get(\'' + obj_key + '\', \'' + obj_ind + '\');">' + obj_key + '.' + obj_ind + '<\/a>';
|
||||
newtree_div.display = 'none';
|
||||
obj = null;
|
||||
}
|
||||
}
|
||||
|
||||
function get(key,xx) {
|
||||
if (obj) cancelHttpRequest();
|
||||
|
||||
obj_key = key;
|
||||
obj_ind = xx;
|
||||
obj = document.getElementById(key + xx);
|
||||
|
||||
newtree_div = document.getElementById(key + xx + 'loading').style;
|
||||
newtree_div.display = 'block';
|
||||
var poststr = "cmd=show_cache&key=" + encodeURI(key);
|
||||
|
||||
if (xx) {
|
||||
poststr += "&index=" + encodeURI(xx);
|
||||
}
|
||||
|
||||
obj.innerHTML = '<img src="images/ajax-spinner.gif" /> Loading...';
|
||||
makePOSTRequest('cmd.php',poststr,'alertCacheContents','cancelCacheContents');
|
||||
}
|
||||
|
||||
function close(key,xx) {
|
||||
document.getElementById(key + xx).innerHTML = '<a href="javascript:get(\'' + key + '\', \'' + xx + '\');">' + key + '.' + xx + '<\/a>';
|
||||
}
|
||||
</script>
|
189
htdocs/summary.gantt.php
Normal file
@@ -0,0 +1,189 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/summary.gantt.php,v 1.4 2009/04/19 04:00:59 wurley Exp $
|
||||
|
||||
# @todo: Hotlink the hostname to the detail script.
|
||||
|
||||
# Required Libraries
|
||||
require './common.php';
|
||||
$form['from'] = get_request('from','REQUEST',false,date('Y-m-d',time()-86400));
|
||||
$form['to'] = get_request('to','REQUEST',false,date('Y-m-d'));
|
||||
|
||||
# Defaults
|
||||
$reportEnd = strftime('%Y-%m-%d 23:59',time());
|
||||
$reportStart = strftime('%Y-%m-%d 00:00',time()-86400);
|
||||
$summaryInfo = objectCache('summaryinfo');
|
||||
|
||||
# List of Clients.
|
||||
$blockTitle['node'] = sprintf(_('Select DATE RANGE on %s'),$app['server']->getValue('server','name'));
|
||||
|
||||
$blockBody['node'] = '<form action="cmd.php">';
|
||||
$blockBody['node'] .= '<input type="hidden" name="cmd" value="summary.gantt" />';
|
||||
$blockBody['node'] .= sprintf('<input type="hidden" name="index" value="%s" />',$app['server']->getIndex());
|
||||
|
||||
$blockBody['node'] .= 'From ';
|
||||
$blockBody['node'] .= '<select name="from">';
|
||||
foreach ($summaryInfo->getSummaryRange() as $date) {
|
||||
$blockBody['node'] .= sprintf('<option id="%s" %s>%s</option>',
|
||||
$date,
|
||||
$date == $form['from'] ? 'selected' : '',
|
||||
$date);
|
||||
}
|
||||
$blockBody['node'] .= '</select>';
|
||||
$blockBody['node'] .= ' ';
|
||||
$blockBody['node'] .= 'To ';
|
||||
$blockBody['node'] .= '<select name="to">';
|
||||
foreach ($summaryInfo->getSummaryRange() as $date) {
|
||||
$blockBody['node'] .= sprintf('<option id="%s" %s>%s</option>',
|
||||
$date,
|
||||
$date == $form['to'] ? 'selected' : '',
|
||||
$date);
|
||||
}
|
||||
$blockBody['node'] .= '</select>';
|
||||
$blockBody['node'] .= '<input align="left" type="submit" name="submit" value="Go" />';
|
||||
$blockBody['node'] .= '</form>';
|
||||
|
||||
if ($form['from'] && $form['to']) {
|
||||
initJPGraph(true);
|
||||
|
||||
# A new graph with automatic size
|
||||
$graph = new GanttGraph(0,0,'auto');
|
||||
|
||||
# A new activity on row '0'
|
||||
$item = 0;
|
||||
foreach ($summaryInfo->getSummary($form['from'],$form['to']) as $tsmActivity) {
|
||||
$tsmCaption = '';
|
||||
$tsmCSIM = '';
|
||||
$waiting = 0;
|
||||
$timestart = preg_replace('/(.*:.*):.*/','$1',$tsmActivity['START_TIME']);
|
||||
$timeend = preg_replace('/(.*:.*):.*/','$1',$tsmActivity['END_TIME']);
|
||||
$timeseconds = strtotime(preg_replace('/([0-9])\..*$/','$1',$tsmActivity['END_TIME'])) -
|
||||
strtotime(preg_replace('/([0-9])\..*$/','$1',$tsmActivity['START_TIME']));
|
||||
if ($timeseconds) {
|
||||
$waiting = $tsmActivity['MEDIAW']/$timeseconds;
|
||||
}
|
||||
|
||||
# It seems sometimes, the MEDIAW time can be larger than the activity time?
|
||||
if ($waiting > 1) $waiting = 1;
|
||||
|
||||
$priority = 10;
|
||||
switch ($tsmActivity['ACTIVITY']) {
|
||||
case('TAPE MOUNT'):
|
||||
$summary = $tsmActivity['ACTIVITY'].' ('.$tsmActivity['DRIVE_NAME'].')';
|
||||
$tsmCSIM = sprintf('%s (%s)',$tsmActivity['VOLUME_NAME'],$tsmActivity['LAST_USE']);
|
||||
$priority = 1;
|
||||
break;
|
||||
case('STGPOOL BACKUP'):
|
||||
$summary = $tsmActivity['ACTIVITY'].' ('.$tsmActivity['ENTITY'].')';
|
||||
$tsmCSIM = sprintf('%3d MB. %ss Media wait',$tsmActivity['BYTES']/1024/1024,$tsmActivity['MEDIAW']);
|
||||
$priority = 4;
|
||||
break;
|
||||
case('ARCHIVE'):
|
||||
$summary = $tsmActivity['ACTIVITY'].' ('.$tsmActivity['ENTITY'].')';
|
||||
$tsmCSIM = sprintf('%3d MB',$tsmActivity['BYTES']/1024/1024);
|
||||
$priority = 3;
|
||||
break;
|
||||
case('BACKUP'):
|
||||
$summary = $tsmActivity['ACTIVITY'].' ('.$tsmActivity['ENTITY'].')';
|
||||
$tsmCSIM = sprintf('%3d MB',$tsmActivity['BYTES']/1024/1024);
|
||||
$priority = 2;
|
||||
break;
|
||||
case('RESTORE'):
|
||||
$summary = $tsmActivity['ACTIVITY'].' ('.$tsmActivity['ENTITY'].')';
|
||||
$tsmCSIM = sprintf('%3d MB. %ss Media wait',$tsmActivity['BYTES']/1024/1024,$tsmActivity['MEDIAW']);
|
||||
$priority = 2;
|
||||
break;
|
||||
case('FULL_DBBACKUP'):
|
||||
$summary = $tsmActivity['ACTIVITY'];
|
||||
$tsmCSIM = sprintf('%3d MB. %ss Media wait',$tsmActivity['BYTES']/1024/1024,$tsmActivity['MEDIAW']);
|
||||
break;
|
||||
case('RECLAMATION'):
|
||||
$summary = $tsmActivity['ACTIVITY'].' ('.preg_replace('/^(.*)\s+\(.*\)$/','$1',$tsmActivity['ENTITY']).')';
|
||||
$tsmCSIM = sprintf('%3d MB. %ss Media wait',$tsmActivity['BYTES']/1024/1024,$tsmActivity['MEDIAW']);
|
||||
$priority = 4;
|
||||
break;
|
||||
case('MIGRATION'):
|
||||
$summary = $tsmActivity['ACTIVITY'].' ('.$tsmActivity['ENTITY'].')';
|
||||
$tsmCSIM = sprintf('%3d MB. %ss Media wait',$tsmActivity['BYTES']/1024/1024,$tsmActivity['MEDIAW']);
|
||||
$priority = 4;
|
||||
break;
|
||||
case('MOVE NODEDATA'):
|
||||
$summary = $tsmActivity['ACTIVITY'].' ('.$tsmActivity['ENTITY'].')';
|
||||
$tsmCSIM = sprintf('%3d MB. %ss Media wait',$tsmActivity['BYTES']/1024/1024,$tsmActivity['MEDIAW']);
|
||||
$priority = 4;
|
||||
break;
|
||||
case('EXPIRATION'):
|
||||
$summary = 'EXPIRATION PROCESSING';
|
||||
$tsmCaption = sprintf('%ss',$tsmActivity['AFFECTED']);
|
||||
default: $summary = $tsmActivity['ACTIVITY'];
|
||||
}
|
||||
|
||||
$lineitems[$summary][$item]['wait'] = $waiting;
|
||||
$lineitems[$summary][$item]['summary'] = $summary;
|
||||
$lineitems[$summary][$item]['start'] = $timestart;
|
||||
$lineitems[$summary][$item]['end'] = $timeend;
|
||||
$lineitems[$summary][$item]['csim'] = $tsmCSIM;
|
||||
$lineitems[$summary][$item]['caption'] = $tsmCaption;
|
||||
$lineitems[$summary]['priority'] = $priority;
|
||||
$lineitems[$summary]['summary'] = $summary;
|
||||
$item++;
|
||||
}
|
||||
|
||||
if ($lineitems) {
|
||||
masort($lineitems,'priority,summary',1);
|
||||
|
||||
$item=0;
|
||||
foreach ($lineitems as $lineitem => $linedetails) {
|
||||
|
||||
# Put a gap between our priority items.
|
||||
if ($item && ($lastPriority <> $linedetails['priority']))
|
||||
$item++;
|
||||
|
||||
foreach ($linedetails as $eventdetails) {
|
||||
if (! is_array($eventdetails)) continue;
|
||||
$activity = new GanttBar($item,$eventdetails['summary'],$eventdetails['start'],$eventdetails['end']);
|
||||
$activity->progress->Set($eventdetails['wait']);
|
||||
$activity->caption ->Set($eventdetails['caption']);
|
||||
$activity->SetCSIMTarget('#',($eventdetails['csim'] ? $eventdetails['csim'] : 'NoCSIM'));
|
||||
$activity->title->SetCSIMTarget('#',($eventdetails['csim'] ? $eventdetails['csim'] : 'NoCSIM'));
|
||||
|
||||
$graph->Add($activity);
|
||||
}
|
||||
$item++;
|
||||
$lastPriority = $linedetails['priority'];
|
||||
}
|
||||
|
||||
$graph->SetMarginColor('#eeeeff');
|
||||
$graph->SetFrame(true,'#eeeeff',0);
|
||||
|
||||
// We want to display day, hour and minute scales
|
||||
$graph->ShowHeaders(GANTT_HDAY | GANTT_HHOUR | GANTT_HMIN);
|
||||
$graph->hgrid->Show();
|
||||
$graph->hgrid->SetRowFillColor('darkred@0.85');
|
||||
|
||||
// Setup hour format
|
||||
$graph->scale->hour->SetIntervall(1);
|
||||
$graph->scale->hour->SetStyle(HOURSTYLE_H24);
|
||||
$graph->scale->minute->SetIntervall(30);
|
||||
|
||||
$graph->scale->dividerh->SetWeight(3);
|
||||
$graph->scale->dividerh->SetColor('navy');
|
||||
|
||||
// Display the Gantt chart
|
||||
$imageFile = sprintf('%s/gantt.summary.%s.png',realpath($_SESSION[APPCONFIG]->getValue('image','path')),$app['server']->getIndex());
|
||||
$imageHTML = sprintf('%sgantt.summary.%s.png',$_SESSION[APPCONFIG]->getValue('image','pathurl'),$app['server']->getIndex());
|
||||
$graph->Stroke($imageFile);
|
||||
|
||||
} else {
|
||||
# @todo: Nice message about no data.
|
||||
}
|
||||
|
||||
$blockTitle['gantt'] = sprintf(_('Activity Summary for server %s'),$app['server']->getValue('server','name'));
|
||||
$blockBody['gantt'] = '<table class="result"><tr><td>';
|
||||
$blockBody['gantt'] .= $graph->GetHTMLImageMap('gantt.summary');
|
||||
$blockBody['gantt'] .= sprintf('<img src="%s" ISMAP USEMAP="#gantt.summary" border=0 />',$imageHTML,$app['server']->getIndex()) ;
|
||||
$blockBody['gantt'] .= '</td></tr></table>';
|
||||
}
|
||||
|
||||
# End
|
||||
render_page($blockTitle,$blockBody);
|
||||
?>
|
160
htdocs/volume.info.php
Normal file
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
// $Header: /cvsroot/phptsmadmin/phpTSMadmin/htdocs/volume.info.php,v 1.21 2009/04/19 04:57:32 wurley Exp $
|
||||
|
||||
# Required Libraries
|
||||
require './common.php';
|
||||
|
||||
# Defaults
|
||||
$volumes = objectCache('volumes');
|
||||
|
||||
$blockTitle['volinfo'] = 'Volume(s) that may need attention';
|
||||
$blockBody['volinfo'] = '<br /><table class="result_table" border=0>';
|
||||
|
||||
$blockBody['volinfo'] .= '<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>';
|
||||
|
||||
# The following COPY VOLUMES in the library can be checked out.
|
||||
if (count($volumes->libCopyVolumes(true))) {
|
||||
$blockBody['volinfo'] .= 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 ($volumes->libCopyVolumes(true) as $volume) {
|
||||
$blockBody['volinfo'] .= 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['volinfo'] .= '<tr><td colspan=0> </td></tr>';
|
||||
}
|
||||
|
||||
# Non-Read/Write Volumes that need to be fixed.
|
||||
if (count($volumes->nonReadWriteVolumes())) {
|
||||
$blockBody['volinfo'] .= sprintf('<tr><td colspan=0><b>%s</b></td></tr>',_('NON READ/WRITE volumes that need to be addressed.'));
|
||||
$counter = 0;
|
||||
foreach ($volumes->nonReadWriteVolumes() as $volume) {
|
||||
$blockBody['volinfo'] .= 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'] : ' ',
|
||||
isset($volume->location) ? $volume->location : 'InLIB',
|
||||
$volume->name,
|
||||
$volume->stgpool,
|
||||
$volume->status['volume'],
|
||||
$volume->access,
|
||||
'N/A',
|
||||
$volume->utilisation,
|
||||
$volume->reclaim,
|
||||
tsmDate($volume->last['read'],'notime'),tsmDate($volume->last['write'],'notime'));
|
||||
}
|
||||
$blockBody['volinfo'] .= '<tr><td colspan=0> </td></tr>';
|
||||
}
|
||||
|
||||
# Non-Read/Write Volumes that need to be fixed.
|
||||
if (count($volumes->reclaimVolumes())) {
|
||||
$blockBody['volinfo'] .= sprintf('<tr><td colspan=0><b>%s</b></td></tr>',_('The following volumes should be RECLAIMed (automatically).'));
|
||||
$counter = 0;
|
||||
foreach ($volumes->reclaimVolumes() as $volume) {
|
||||
$blockBody['volinfo'] .= 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'] : ' ',
|
||||
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['volinfo'] .= '<tr><td colspan=0> </td></tr>';
|
||||
}
|
||||
|
||||
# Following volumes have had errors.
|
||||
if (count($volumes->errorVolumes())) {
|
||||
$blockBody['volinfo'] .= sprintf('<tr><td colspan=0><b>%s</b></td></tr>',_('The following volumes have had ERRORS.'));
|
||||
$counter = 0;
|
||||
foreach ($volumes->errorVolumes() as $volume) {
|
||||
$blockBody['volinfo'] .= 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 (%s)</td><td>%s (%s)</td></tr>',
|
||||
$counter++%2 ? 'even' : 'odd',
|
||||
isset($volume->lib['name']) ? $volume->lib['name'] : ' ',
|
||||
isset($volume->location) ? $volume->location : 'InLIB',
|
||||
$volume->name,
|
||||
$volume->stgpool,
|
||||
$volume->status['volume'],
|
||||
$volume->access,
|
||||
'N/A',
|
||||
$volume->utilisation,
|
||||
$volume->reclaim,
|
||||
tsmDate($volume->last['read'],'notime'),$volume->error['read'],
|
||||
tsmDate($volume->last['write'],'notime'),$volume->error['write']);
|
||||
}
|
||||
$blockBody['volinfo'] .= '<tr><td colspan=0> </td></tr>';
|
||||
}
|
||||
|
||||
# Following volumes have not been read/written to for a long time.
|
||||
if (count($volumes->staleVolumes($app['server']->getValue('system','tapeage')))) {
|
||||
$blockBody['volinfo'] .= sprintf('<tr><td colspan=0><b>%s</b></td></tr>',sprintf(_('The following volumes have NOT been read/written to for %s days.'),$app['server']->getValue('system','tapeage')));
|
||||
$counter = 0;
|
||||
foreach ($volumes->staleVolumes($app['server']->getValue('system','tapeage')) as $volume) {
|
||||
$blockBody['volinfo'] .= 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'] : ' ',
|
||||
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['volinfo'] .= '<tr><td colspan=0> </td></tr>';
|
||||
}
|
||||
|
||||
# Following volumes are empty or pending.
|
||||
if (count($volumes->pendingVolumes()) || count($volumes->emptyVolumes())) {
|
||||
$blockBody['volinfo'] .= sprintf('<tr><td colspan=0><b>%s</b></td></tr>',_('The following volumes are either EMPTY or PENDING.'));
|
||||
$counter = 0;
|
||||
foreach ($volumes->pendingVolumes() as $volume) {
|
||||
$blockBody['volinfo'] .= sprintf('<tr class="%s"><td>%s</td><td>%s</td><td>%s</td><td>%s</td><td><acronym title="Pending: %s Avail: %s">%s</acronym>/%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'] : ' ',
|
||||
isset($volume->location) ? $volume->location : 'InLIB',
|
||||
$volume->name,
|
||||
$volume->stgpool,
|
||||
tsmDate($volume->pending['start'],'notime'),tsmDate($volume->pending['end'],'notime'),
|
||||
$volume->status['volume'],
|
||||
$volume->access,
|
||||
'N/A',
|
||||
$volume->utilisation,
|
||||
$volume->reclaim,
|
||||
tsmDate($volume->last['read'],'notime'),tsmDate($volume->last['write'],'notime'));
|
||||
}
|
||||
$counter = 0;
|
||||
foreach ($volumes->emptyVolumes() as $volume) {
|
||||
$blockBody['volinfo'] .= 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'] : ' ',
|
||||
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['volinfo'] .= '</table>';
|
||||
|
||||
# End
|
||||
render_page($blockTitle,$blockBody);
|
||||
?>
|
95
htdocs/volume.inventory.php
Normal file
@@ -0,0 +1,95 @@
|
||||
<?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> </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> </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> </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);
|
||||
?>
|