diff --git a/htdocs/index.php b/htdocs/index.php index b6c3113..89959a0 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -114,7 +114,7 @@ if (! $config = check_config($app['config_file'])) { if ($uri = get_request('URI','GET')) header(sprintf('Location: cmd.php?%s',base64_decode($uri))); -if (! ereg('^([0-9]+\.?)+',app_version())) { +if (! preg_match('/^([0-9]+\.?)+/',app_version())) { if (count($_SESSION[APPCONFIG]->untested())) system_message(array( 'title'=>'Untested configuration paramaters', diff --git a/htdocs/node.detail.php b/htdocs/node.detail.php deleted file mode 100644 index 6f089a8..0000000 --- a/htdocs/node.detail.php +++ /dev/null @@ -1,297 +0,0 @@ -getFSOccupancy($type)) - return null; - - $blockBody = ''; - switch ($type) { - case 'Bkup' : - $blockBody .= sprintf('', - 3+count($node->getStoragePools())); - break; - - case 'Arch' : - $blockBody .= sprintf('', - 3+count($node->getStoragePools())); - break; - - default: - return null; - } - - $blockBody .= ''; - $blockBody .= ''; - $blockBody .= ''; - $blockBody .= ''; - # List out the Storage Pools - foreach ($node->getStoragePools() as $stgp) - $blockBody .= sprintf('',$stgp); - $blockBody .= ''; - - $counter = 0; - foreach ($node->getFSOccupancy($type) as $fs => $object) { - $blockBody .= sprintf('',($counter++%2==0?'even':'odd')); - $blockBody .= sprintf('', - trim($object->type) ? $object->type : 'Unknown File System',$object->getName()); - - $blockBody .= sprintf('', - 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('', - 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('', - number_format($object->occupancy[$type][$stgp]['num'],0), - number_format($object->occupancy[$type][$stgp]['physical'],2), - count($object->getVolumeUsage($stgp)) ? sprintf(' (%s)',count($object->getVolumeUsage($stgp))) : ''); - else - $blockBody .= ''; - } - $blockBody .= ''; - } - $blockBody .= '
Backup Space Utilisation
Archive Space Utilisation
File SystemLast BackupLast Size%s
%s%s %s MB%s%s 
'; - $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 = ''; - switch ($type) { - case 'Bkup' : - $blockBody .= sprintf(''); - break; - - case 'Arch' : - $blockBody .= sprintf(''); - break; - - default: - return null; - } - - $blockBody .= ''; - $blockBody .= ''; - $blockBody .= ''; - $blockBody .= ''; - $blockBody .= ''; - - $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('', - ($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 .= '
Backup Volume Utilisation
Archive Volume Utilisation
File SystemStorage PoolVolume
%s%s%s
'; - $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 = ''; - switch ($type) { - case 'Bkup' : - $blockBody .= sprintf(''); - break; - - case 'Arch' : - $blockBody .= sprintf(''); - break; - - default: - return null; - } - - $counter = 0; - foreach ($node->getPrimaryVolumes($type) as $volumename => $volume) { - $blockBody .= sprintf('', - ($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('', - ($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 .= '
Backup Volume Utilisation
Archive Volume Utilisation
%s%s
%s%s
'; - $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 '
'; -printf('',get_request('cmd','REQUEST')); -printf('',$app['server']->getIndex()); - -echo ''; -echo ''; -echo '
'; -echo "\n"; - -if (isset($_REQUEST['NODE'])) { - echo '
'; - echo ''; - printf('', - $_REQUEST['NODE'],$app['server']->getValue('server','name')); - - $node = $nodes->nodes[$_REQUEST['NODE']]; - if ($node->url) - printf('', - $node->url,$node->hostname); - else - printf('',$node->hostname ? $node->hostname : ' '); - - printf('',$node->contact ? $node->contact : ' '); - - printf('', - $node->os,$node->level['os']); - - printf('', - $node->level['tsm_ver'],$node->level['tsm_rel'],$node->level['tsm_lvl'],$node->level['tsm_slv']); - - echo ''; - printf('', - tsmDate($node->time['registered'],'nosec')); - printf('', - tsmDate($node->time['lastacc'],'nosec'), - (time()-strtotime(tsmDate($node->time['lastacc'],'nosec')))/86400); - printf('', - tsmDate($node->time['pwset'],'nosec'), - (time()-strtotime(tsmDate($node->time['pwset'],'nosec')))/86400); - printf('', - tsmDate($node->passwd['expiry'],'nosec') ? tsmDate($node->passwd['expiry'],'nosec') : ' '); - printf('', - $node->passwd['invalid'], - $node->locked ? 'LOCKED' : 'NOT Locked'); - - echo ''; - printf('',$node->cloptset ? $node->cloptset : ' '); - printf('', - $node->compression ? 'YES' : 'NO'); - printf('',$node->txngroupmax ? $node->txngroupmax : ' '); - printf('', - $node->delete['arch'] ? 'YES' : 'NO'); - printf('', - $node->delete['back'] ? 'YES' : 'NO'); - printf('', - $node->mp['keep'] ? 'YES' : 'NO',$node->mp['max']); - - echo ''; - printf('',$node->group ? $node->group : _('Not Set')); - echo ''; - printf('',$node->domain); - - # Show the MGMTClasses that apply to this node. - printf(''); - foreach ($mgmtclass->getMgmtClasses($node->domain,'Bkup') as $object) { - if (is_object($object)) - printf('', - $object->version['EXISTS'],$object->retain['EXTRA'],$object->version['DELETED'],$object->retain['ONLY'],$object->frequency,$object->getName(), - $object->isDefaultMgmtClass() ? ' (Default)' : '', - $object->getStoragePool() ? $object->getStoragePool()->getName() : sprintf('(%s)',_('Storage Pool Doesnt Exist'))); - } - - printf(''); - foreach ($mgmtclass->getMgmtClasses($node->domain,'Arch') as $object) { - if (is_object($object)) - printf('', - $object->retain['DAYS'],$object->getName(), - $object->isDefaultMgmtClass() ? ' (Default)' : '', - $object->getStoragePool() ? $object->getStoragePool()->getName() : sprintf('(%s)',_('Storage Pool Doesnt Exist'))); - } - - echo ''; - - if ($node->getFileSystems()) { - printf('',showFSDetails($node,'Bkup')); - echo ''; - printf('',showFSDetails($node,'Arch')); - - } else { - echo ''; - } - - if (count($node->getVolumeUsage())) { - echo ''; - printf('',showAllVols($node,'Bkup')); - echo ''; - printf('',showAllVols($node,'Arch')); - - echo ''; - printf('',showVols($node,'Bkup')); - echo ''; - printf('',showVols($node,'Arch')); - } - - echo '

NODE detail for %s on %s

System Name%s
System Name%s
Contact%s
OS%s (%s)
TSM Client Version%s.%s.%s.%s

Access Information

Registered%s
Last Accessed%s (%2.0f days ago)
Last Password Change%s (%2.0f days ago)
Password Expiry%s
Invalid Password Count%s (%s)

Configuration Options

Option Set%s
Compression %s
TXN Group Max%s
Can Delete Archives%s
Can Delete Backups%s
Keep Mount Points%s (%s)

Storage Configuration

Colloc Group Name%s
 
Backup Domain%s
 Available Backup Management Classes
 %s%sStorage Pool: %s
 Available Archive Management Classes
 %s%sStorage Pool: %s

Storage Utilisation

%s
 
%s
TSM does not have any data for this host.

Volume Utilisation

%s
 
%s

Volume Utilisation by File System

%s
 
%s
'; -} -?> diff --git a/htdocs/node.thruput.php b/htdocs/node.thruput.php deleted file mode 100644 index fef5c05..0000000 --- a/htdocs/node.thruput.php +++ /dev/null @@ -1,21 +0,0 @@ -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 ''; -printf('', - 'heading','Date','Node','Type','GB'); -$counter = 0; -foreach ($thruput as $details) { - printf('', - $counter++%2 ? 'even' : 'odd', - $details['ADATE'],$details['ENTITY'],$details['ACTIVITY'],$details['GB']); -} -echo '
%s%s%s%s
%s%s%s%s
'; -?> diff --git a/lib/config_custom.php b/lib/config_custom.php index 253591a..4965c77 100644 --- a/lib/config_custom.php +++ b/lib/config_custom.php @@ -22,10 +22,6 @@ $config->configDefinition('command','libraryinfo',array( 'summary'=>'Library Info', 'desc'=>'Information on Automated Tape Libraries.', 'default'=>'library.info')); -$config->configDefinition('command','nodedetail',array( - 'summary'=>'Node Detail', - 'desc'=>'Detail of Node Storage Usage.', - 'default'=>'node.detail')); $config->configDefinition('command','nodeoccupancy',array( 'summary'=>'Node Occupancy', 'desc'=>'Summary of Node Occupancy.', @@ -34,10 +30,6 @@ $config->configDefinition('command','nodesummary',array( 'summary'=>'Node Summary', 'desc'=>'Summary of Node activities.', 'default'=>'node.summary')); -$config->configDefinition('command','nodethruput',array( - 'summary'=>'Node Traffic', - 'desc'=>'This will show recent node traffic.', - 'default'=>'node.thruput')); $config->configDefinition('command','schedulegantt',array( 'summary'=>'Schedule Gantt', 'desc'=>'Gantt view of todays schedules.', diff --git a/lib/functions.php b/lib/functions.php index 06c4788..c73cc52 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -968,7 +968,7 @@ function masort(&$data,$sortby,$rev=0) { if (empty($CACHE[$sortby])) { $code = "\$c=0;\n"; - foreach (split(',',$sortby) as $key) { + foreach (explode(',',$sortby) as $key) { $code .= "if (is_object(\$a) || is_object(\$b)) {\n"; $code .= " if (\$a->$key != \$b->$key)\n";