Initial commit

This commit is contained in:
Deon George
2014-10-06 21:57:54 +11:00
commit 62992c1a0e
35 changed files with 2412 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
class Database_Result extends lnApp_Database_Result {}
?>

View File

@@ -0,0 +1,4 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
abstract class Database_TSM extends lnApp_Database_TSM {}
?>

View File

@@ -0,0 +1,4 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
class Database_TSM_Result extends lnApp_Database_TSM_Result {}
?>

View File

@@ -0,0 +1,4 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
class Database_Tsm_dsmadmc extends lnApp_Database_Tsm_dsmadmc {}
?>

View File

@@ -0,0 +1,4 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
class Model_ADMIN extends lnApp_Model_ADMIN {}
?>

View File

@@ -0,0 +1,4 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
class Model_NODE extends lnApp_Model_NODE {}
?>

View File

@@ -0,0 +1,174 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class extends Kohana's [ORM] class to create defaults for TSM.
*
* @package TSM Database Module
* @category Helpers
* @author Deon George
* @copyright (c) 2010-2014 Deon George
* @license http://dev.leenooks.net/license.html
*/
abstract class ORM_TSM extends ORM {
protected $_created_column = NULL;
protected $_updated_column = NULL;
// Suppress ORMs inclusion of <table_name>.*
protected $_disable_wild_select = TRUE;
// Suppress ORMs inclusion of <table_name>. to column joins
protected $_disable_join_table_name = TRUE;
// Suppress ORMs use of limit
protected $_disable_limit = TRUE;
// To enable effective caching, this must disabled.
protected $_reload_on_wakeup = FALSE;
// Enable the formating of columns
protected $_object_formated = array();
protected $_formated = FALSE;
protected $_formats = array();
protected $_tsm = array();
/**
*
* Configuration to enable PLA to work with DSMADMC & DB2 connections
* This is required, because the schema is different between each
* connection?
*/
protected function _initialize() {
// Set out DB connection configuration.
$this->_db_group = Kohana::$config->load('tsm')->client_type;
// Adjustments for DSMADMC or DB2 connections
if (array_key_exists($this->_db_group,$this->_tsm))
foreach ($this->_tsm[$this->_db_group] as $k => $v)
if (preg_match('/^_/',$k))
$this->{$k} = $v;
if ($this->_db_group == 'db2')
$this->_disable_join_table_name = FALSE;
parent::_initialize();
}
public function __get($column) {
// Get a substited column name - need for DB2/DSMADMC schema differences
if (isset($this->_tsm[$this->_db_group]['translate']) AND array_key_exists($column,$this->_tsm[$this->_db_group]['translate']))
return is_null($c=$this->_tsm[$this->_db_group]['translate'][$column]) ? NULL : parent::__get($c);
else
return parent::__get($column);
}
public function find() {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
Log::instance()->add(LOG::DEBUG,'METHOD :method: isCacheable: :cable, table: :table',array(':method'=>__METHOD__,':cable'=>($x=$this->isCacheable()) ? $x : 'N',':table'=>$this->_table_name));
// Check if we can preload our data and havent already done it
// Kohana uses Kohana::cache here, instead of Cache()
if ($time = $this->isCacheable() AND is_null(Kohana::cache($cache_key = 'PRELOAD:'.$this->_table_name))) {
Log::instance()->add(LOG::DEBUG,'PRELOADING :method: table: :table',array(':method'=>__METHOD__,':table'=>$this->_table_name));
// Firstly set our cache, so that we dont get in a loop
Kohana::cache($cache_key,TRUE,$time-1);
// Find all records of this type
$c = get_class($this);
$x = new $c;
foreach ($x->find_all() as $record) {
// Simulate loading the record so that we can get the SQL to use as our cache key
$y = new $c;
$y->where($y->_primary_key,'=',(string)$record);
// Code, as extracted from ORM to complete building the SQL
$y->_build(Database::SELECT);
$y->_db_builder->from(array($y->_table_name,$y->_object_name));
if (! isset($y->_db_applied['order_by']) AND ! empty($y->_sorting))
foreach ($y->_sorting as $column => $direction) {
if (strpos($column, '.') === FALSE)
// Sorting column for use in JOINs
$column = ($y->_disable_join_table_name ? '' : $y->_table_name.'.').$column;
$y->_db_builder->order_by($column, $direction);
}
// Set the cache key based on the database instance name and SQL
$cache_key = 'Database::query("'.$y->_db.'", "'.(string)$y->_db_builder.'")';
unset($y);
// Cache the record, our subsequent find should get a cache hit now.
Kohana::cache($cache_key, array($record->as_array()), $time);
Log::instance()->add(LOG::DEBUG,'Cache SET for TIME: :time, KEY: :cache_key',array(':cache_key'=>$cache_key,':time'=>$time));
}
unset($x);
}
Log::instance()->add(LOG::DEBUG,'LEAVE :method',array(':method'=>__METHOD__));
// Contiue as normal
return parent::find();
}
private function isCacheable() {
$config = Kohana::$config->load('database')->{Kohana::$config->load('tsm')->client_type};
if ($config['caching'] AND isset($config['cachepreload'][$this->_table_name]) AND count($this->_db_pending) == 1 AND $this->_db_pending[0]['name'] == 'where' AND $this->_db_pending[0]['args'][0] == $this->_primary_key AND $this->_db_pending[0]['args'][1] == '=')
return $config['cachepreload'][$this->_table_name];
else
return FALSE;
}
protected function _load_result($multiple = FALSE) {
// We'll cache our query results
if ($c = $this->_db->caching($this->_table_name))
$this->_db_builder->cached($c);
return parent::_load_result($multiple);
}
/**
* Proxy method to Database list_columns.
* This enables caching of the list_columns queries. Since this doesnt
* we hard code the cache to 7 days.
*
* @return array
* @todo This cache time needs to be better integrated with other caching times.
*/
public function list_columns() {
// We'll cache our query results
if ($this->_db->caching('SCHEMA')) {
// Set the cache key based on the database instance name and SQL
$cache_key = 'Database::query(LC:'.$this->_table_name.')';
if (! is_null($result = Cache::instance()->get($cache_key)))
// Return a cached result
return $result;
}
// Proxy to database
$result = $this->_db->list_columns($this->_table_name);
// Cache the result array
if (isset($cache_key))
Cache::instance()->set($cache_key, $result, 604800);
return $result;
}
// Load our values into the ORM object
public function load_object(array $values) {
return parent::_load_values($values);
}
public static function date($date,$format) {
return $date ? date($format,strtotime($date)) : '';
}
protected function datatypemap($type) {
$x = Kohana::$config->load('tsm')->datatypes;
return array_key_exists($type,$x) ? $x[$type] : $x;
}
}
?>

View File

@@ -0,0 +1,21 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* TSM System Messages.
*
* @package TSM Database Module
* @category Helpers
* @author Deon George
* @copyright (c) 2010-2014 Deon George
* @license http://dev.leenooks.net/license.html
*/
class SystemMessage extends lnApp_SystemMessage {
static public function TSM($type,$error,$sql=NULL) {
SystemMessage::add(array(
'title'=>_('While talking to TSM'),
'body'=>($sql ? _('Running SQL').': <b>'.$sql.'</b><br/><br/>' : '').(is_array($error) ? implode('<br/>',$error) : $error),
'type'=>$type,
));
}
}
?>

View File

@@ -0,0 +1,4 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
class TSM extends lnApp_TSM {}
?>

View File

@@ -0,0 +1,62 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* TSM database show result. See [Results](/database/results) for usage and examples.
*
* @package TSM Database Module
* @category Database
* @author Deon George
* @copyright (c) 2010-2014 Deon George
* @license http://dev.leenooks.net/license.html
*/
abstract class lnApp_Database_Result extends Kohana_Database_Result {
protected $_internal_row = 0;
protected $_rows;
// Required Abstract Classes
public function __destruct() {}
public function seek($offset) {
if ($this->offsetExists($offset)) {
// Set the current row to the offset
$this->_current_row = $this->_internal_row = $offset;
return TRUE;
} else {
return FALSE;
}
}
public function current() {
if ($this->_current_row !== $this->_internal_row AND ! $this->seek($this->_current_row))
return FALSE;
// Return an stdClass
if ($this->_as_object === TRUE) {
return $this;
} elseif (is_string($this->_as_object)) {
// Return an object of given class name
$o = new $this->_as_object;
return $o->load_object($this->_rows[$this->_current_row]);
// Return an array of the row
} else {
return $this->_rows[$this->_current_row];
}
}
/**
* Get a row value from the query
*
* TSM returns all columns in upper case
*/
public function get($name, $default = NULL) {
$name = strtoupper($name);
return parent::get($name,$default);
}
}
?>

View File

@@ -0,0 +1,113 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* TSM database connection.
*
* @package TSM Database Module
* @category Drivers
* @author Deon George
* @copyright (c) 2010-2014 Deon George
* @license http://dev.leenooks.net/license.html
*/
abstract class lnApp_Database_TSM extends Database {
// Database in use by each connection
protected static $_current_databases = array();
// Use SET NAMES to set the character set
protected static $_set_names;
// Identifier for this connection within the PHP driver
protected $_connection_id;
// TSM does not use a backtick for identifiers
protected $_identifier = '';
// Our TSM Message Format
protected $msg_format = '[A-Z]{3}[0-9]{4}[I|E|W|S]';
// Our Message Codes stored in the last query
protected $_query_msg_codes = array();
// Our return code error messages we can ignore
protected $ignore_codes = array(
'ANS8001I', // Return code %s.
);
// Our return code error messages we can ignore
protected $nodata_codes = array(
'ANR2034E', // SELECT: No match found using this criteria.
);
protected $execute_stdout = '';
protected $execute_stderr = '';
protected $execute_rc = NULL;
// Our required abstract methods
public function begin($mode = NULL) {}
public function commit() {}
public function rollback() {}
public function set_charset($charset) {}
public function list_tables($like = NULL) {}
// Required methods
abstract protected function execute($sql);
/**
* Return the caching defined in the current configuration.
*
* $cache_time = $db->caching("table");
*
* @return string
*/
public function caching($table) {
return (array_key_exists('cache',Kohana::modules()) AND $this->_config['caching'] AND isset($this->_config['cache'][$table])) ? $this->_config['cache'][$table] : FALSE;
}
private function clear() {
$this->_query_msg_codes = array();
}
public function escape($value) {
// SQL standard is to use single-quotes for all values
return "'$value'";
}
public function query($type, $sql, $as_object = FALSE, array $params = NULL) {
// Make sure the database is connected
if (! $this->_connection && ! $this->connect())
return new Database_TSM_Result(array(),'',$as_object,$params);
$this->clear();
if ( ! empty($this->_config['profiling']))
// Benchmark this query for the current instance
$benchmark = Profiler::start("Database ({$this->_instance})", $sql);
// Execute the query
$result = $this->execute($sql);
if ($this->execute_stderr AND $this->execute_rc) {
// This benchmark is worthless
if (isset($benchmark))
Profiler::delete($benchmark);
SystemMessage::TSM('error',sprintf('%s (%s)',$this->execute_stdout,$this->execute_stderr),$sql);
}
if (isset($benchmark))
Profiler::stop($benchmark);
// Set the last query
$this->last_query = $sql;
if ($type === Database::SELECT)
// Return an iterator of results
return new Database_TSM_Result($result, $sql, $as_object, $params);
elseif ($type === Database::INSERT)
throw new Kohana_Exception('Database INSERTS are not supported');
elseif ($type === Database::SHOW)
return new Database_TSM_Show($result, $sql, $as_object, $params);
elseif ($type === Database::SET)
return new Database_TSM_Set($result, $sql, $as_object, $params);
}
}
?>

View File

@@ -0,0 +1,48 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* TSM database result. See [Results](/database/results) for usage and examples.
*
* @package TSM Database Module
* @category Database
* @author Deon George
* @copyright (c) 2010-2014 Deon George
* @license http://dev.leenooks.net/license.html
*/
abstract class lnApp_Database_TSM_Result extends Database_Result {
public function __construct($result, $sql, $as_object = FALSE, array $params = NULL) {
parent::__construct($result, $sql, $as_object, $params);
$start = FALSE;
// Is this a DB2 result?
if (is_resource($result) AND function_exists('db2_fetch_object')) {
// If we are running a DB2 set command, we can return
if (preg_match('/^SET/',$sql))
return;
while ($r = db2_fetch_object($result))
$this->_rows[$this->_internal_row++] = (array)$r;
// Is this an DSMADMC result?
} elseif (is_array($result))
foreach ($result as $line) {
if (! trim($line)) {
if ($start)
$this->_internal_row++;
continue;
}
list($k,$v) = explode(':',$line,2);
$this->_rows[$this->_internal_row][trim($k)] = trim($v);
$start = TRUE;
}
else
throw new Kohana_Exception('Unknown result :result',array(':result'=>$result));
$this->_total_rows = $this->_internal_row;
$this->_internal_row = 0;
}
}
?>

View File

@@ -0,0 +1,185 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* TSM database connection using DSMADMC.
*
* @package TSM Database Module
* @category Drivers
* @author Deon George
* @copyright (c) 2010-2014 Deon George
* @license http://dev.leenooks.net/license.html
*/
abstract class lnApp_Database_Tsm_dsmadmc extends Database_TSM {
public function connect() {
// Extract the connection parameters, adding required variabels
extract($this->_config['connection'] + array(
'database' => '',
'hostname' => '',
'username' => '',
'password' => '',
'persistent' => FALSE,
));
// Get user login details from user session - these are set by login
if (! $username)
$username = Session::instance()->get_once(Kohana::$config->load('auth')->session_key);
if (! $password)
$password = Session::instance()->get_once('password');
// Prevent this information from showing up in traces
unset($this->_config['connection']['username'], $this->_config['connection']['password']);
if (! file_exists(Kohana::$config->load('tsm')->client)) {
SystemMessage::TSM('error',sprintf('Unable to find the dsmadmc at <b>%s</b>',Kohana::$config->load('tsm')->client),'');
return FALSE;
}
if (! $username OR ! $password)
HTTP::redirect('login');
try {
if ($persistent) {
// Create a persistent connection
throw new Kohana_Exception('Cant do persistant connections');
} else {
// Create a connection and force it to be a new link
$this->_connection = sprintf('%s %s -id=%s -password=%s -displ=list -editor=no -dataonly=YES %s %s ',
Kohana::$config->load('tsm')->client,
$database ? '-server='.$database : '',
$username,
$password,
Kohana::$config->load('tsm')->client_errorlogname ? sprintf('-errorlogname=%s',Kohana::$config->load('tsm')->client_errorlogname) : '',
$database ? sprintf('-se=%s',$database) : ''
);
$result = $this->query(Database::SELECT,'SELECT server_name,platform,version,release,level,sublevel FROM status');
if ($result->count()) {
return TSM::instance()->set($username,$password,$result);
} else {
$this->_connection = FALSE;
// @todo Get ANS8034E (ID not recognised), or ??????E (invalid password)
SystemMessage::add(array(
'title'=>_('Login Failed'),
'type'=>'error',
'body'=>_('Invalid Username and/or Password.')
));
return FALSE;
}
}
} catch (ErrorException $e) {
// No connection exists
$this->_connection = NULL;
throw new Database_Exception(':error', array(
':error' => sprintf('%s error in %s (%s)',$e->getMessage(),$e->getFile(),$e->getLine()),
),
$e->getCode());
}
}
protected function execute($sql) {
$this->execute_stdout = '';
// We need to escape any back slashes, since the exec will transpose them
// @todo Is there a better way of doing this?
$sql = str_replace('\\','\\\\',$sql);
$this->execute_stderr = exec($this->_connection.'"'.$sql.'"',$this->execute_stdout,$this->execute_rc);
if (Kohana::$config->load('config.site.mode') == Kohana::DEVELOPMENT)
SystemMessage::TSM('info',sprintf('%s (%s) [%s]',$this->_connection.'"'.$sql.'"',join("\n",$this->execute_stdout),$this->execute_rc),$sql);
// Work out our message codes
$result = array();
foreach ($this->execute_stdout as $line)
if (! preg_match('/^('.$this->msg_format.')\s+/',$line,$matches))
array_push($result,$line);
elseif (! in_array($matches[1],$this->ignore_codes))
array_push($this->_query_msg_codes,$matches[1]);
// If we got a no data code
if (array_intersect($this->_query_msg_codes,$this->nodata_codes)) {
$result = array();
$this->execute_rc = 0;
}
return $result;
}
public function list_columns($table, $like = NULL, $add_prefix = TRUE) {
// Quote the table name
$table = ($add_prefix === TRUE) ? $this->quote_table($table) : $table;
if (is_string($like))
// Search for column names
throw new Kohana_Exception('Like queries not implemented');
else
// Find all column names
$result = $this->query(Database::SELECT, sprintf('SELECT * FROM SYSCAT.COLUMNS WHERE TABNAME=\'%s\'',$table), FALSE);
$count = 0;
$columns = array();
foreach ($result as $row) {
list($type, $length) = $this->_parse_type($row['TYPENAME']);
$column = $this->datatype($type);
$column['column_name'] = $row['COLNAME'];
$column['data_type'] = $type;
$column['is_nullable'] = ($row['NULLS'] == 'TRUE');
$column['ordinal_position'] = ++$count;
switch (strtolower($column['data_type'])) {
case 'float':
if (isset($length))
list($column['numeric_precision'], $column['numeric_scale']) = explode(',', $length);
break;
case 'int':
if (isset($length))
// MySQL attribute
$column['display'] = $length;
break;
case 'string':
switch ($column['data_type']) {
case 'binary':
case 'varbinary':
$column['character_maximum_length'] = $length;
break;
case 'char':
case 'varchar':
$column['character_maximum_length'] = $length;
case 'text':
case 'tinytext':
case 'mediumtext':
case 'longtext':
$column['collation_name'] = $row['Collation'];
break;
case 'enum':
case 'set':
$column['collation_name'] = $row['Collation'];
$column['options'] = explode('\',\'', substr($length, 1, -1));
break;
}
break;
}
// TSM attributes
$column['comment'] = $row['REMARKS'];
$columns[$row['COLNAME']] = $column;
}
return $columns ? $columns : array('');
}
}
?>

View File

@@ -0,0 +1,32 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* TSM Administrator Model
*
* @package TSM Database Module
* @category Models
* @author Deon George
* @copyright (c) 2010-2014 Deon George
* @license http://dev.leenooks.net/license.html
*/
abstract class lnApp_Model_ADMIN extends ORM_TSM {
protected $_table_name = 'ADMINS';
protected $_primary_key = 'ADMIN_NAME';
protected $_display_filters = array(
'LASTACC_TIME'=>array(
array('ORM_TSM::Date',array(':value','d-M-Y')),
),
'PWSET_TIME'=>array(
array('ORM_TSM::Date',array(':value','d-M-Y')),
),
'REG_TIME'=>array(
array('ORM_TSM::Date',array(':value','d-M-Y')),
),
);
public function name() {
return $this->ADMIN_NAME;
}
}
?>

View File

@@ -0,0 +1,798 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* Obtain TSM details on NODES
*
* @package TSM Database Module
* @category Models
* @author Deon George
* @copyright (c) 2010-2014 Deon George
* @license http://dev.leenooks.net/license.html
*/
abstract class lnApp_Model_NODE extends ORM_TSM {
protected $_table_name = 'NODES';
protected $_primary_key = 'NODE_NAME';
protected $_sorting = array(
'NODE_NAME'=>'ASC',
);
protected $_has_one = array(
'DOMAIN'=>array('foreign_key'=>'DOMAIN_NAME','far_key'=>'DOMAIN_NAME'),
);
protected $_has_many = array(
'ACTLOG'=>array('foreign_key'=>'NODENAME','far_key'=>'NODE_NAME'),
'FILESPACE'=>array('foreign_key'=>'NODE_NAME','far_key'=>'NODE_NAME'),
'VOLUMEUSAGE'=>array('foreign_key'=>'NODE_NAME','far_key'=>'NODE_NAME'),
'ASSOCIATION'=>array('foreign_key'=>'NODE_NAME','far_key'=>'NODE_NAME'),
'MGMTCLASS'=>array('foreign_key'=>'DOMAIN_NAME','far_key'=>'DOMAIN_NAME'),
'CLIENTOPT'=>array('foreign_key'=>'OPTIONSET_NAME','far_key'=>'OPTION_SET'),
'SUMMARY'=>array('foreign_key'=>'ENTITY','far_key'=>'NODE_NAME'),
'EVENT'=>array('foreign_key'=>'NODE_NAME','far_key'=>'NODE_NAME'),
'OCC'=>array('foreign_key'=>'NODE_NAME','far_key'=>'NODE_NAME'),
);
protected $_display_filters = array(
'REG_TIME'=>array(
array('ORM_TSM::Date',array(':value','d-M-Y')),
),
'PWSET_TIME'=>array(
array('ORM_TSM::Date',array(':value','d-M-Y')),
),
'LASTACC_TIME'=>array(
array('ORM_TSM::Date',array(':value','d-M-Y')),
),
'LASTSESS_SENT'=>array(
array('number_format',array(':value',0)),
),
'LASTSESS_RECVD'=>array(
array('number_format',array(':value',0)),
),
'LASTSESS_DURATION'=>array(
array('number_format',array(':value',2)),
),
'LASTSESS_IDLEWAIT'=>array(
array('number_format',array(':value',2)),
),
'LASTSESS_COMMWAIT'=>array(
array('number_format',array(':value',2)),
),
'LASTSESS_MEDIAWAIT'=>array(
array('number_format',array(':value',2)),
),
);
/**
* Get all the ACTIVITIY LOG for this NODE
*/
private function _actlog() {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s',__METHOD__,$this->NODE_NAME);
$c = Kohana::$config->load('tsm')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
// We cant load all records here, like we do with the others, there is too much data!
$result = $this->ACTLOG->find_all();
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);
}
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
/**
* Get all the ACTIVITY SUMMARY for this NODE
*/
private function _actsum() {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s',__METHOD__,$this->NODE_NAME);
$c = Kohana::$config->load('tsm')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
$result = array();
// In the interest of performance, we load all the records and get PHP to process it.
// Our ORM caching we reduce the hit on TSM.
foreach (ORM::factory('ACTSUM')->find_all() as $o)
if ($o->ENTITY == $this->NODE_NAME)
array_push($result,$o);
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);
}
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
/**
* Get all the FILESPACES for this NODE
*/
private function _filespaces() {
$result = array();
// In the interest of performance, we load all the records and get PHP to process it.
// Our ORM caching we reduce the hit on TSM.
foreach (ORM::factory('FILESPACE')->find_all() as $o)
if ($o->NODE_NAME == $this->NODE_NAME)
array_push($result,$o);
return $result;
}
/**
* Get all the OCCUPANCY for this NODE
*/
private function _occupancy() {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s',__METHOD__,$this->NODE_NAME);
$c = Kohana::$config->load('tsm')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
$result = array();
// In the interest of performance, we load all the records and get PHP to process it.
// Our ORM caching we reduce the hit on TSM.
foreach (ORM::factory('OCC')->find_all() as $o)
if ($o->NODE_NAME == $this->NODE_NAME)
array_push($result,$o);
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);
}
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
/**
* Get all the VOLUMES for this NODE
*/
private function _volumeusage() {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s',__METHOD__,$this->NODE_NAME);
$c = Kohana::$config->load('tsm')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
$result = array();
// In the interest of performance, we load all the records and get PHP to process it.
// Our ORM caching we reduce the hit on TSM.
foreach (ORM::factory('VOLUMEUSAGE')->find_all() as $o)
if ($o->NODE_NAME == $this->NODE_NAME)
array_push($result,$o);
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);
}
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
/**
* Return the version of the TSM client
*/
public function version() {
if ($this->CLIENT_VERSION)
return sprintf('%s.%s.%s.%s',$this->CLIENT_VERSION,$this->CLIENT_RELEASE,$this->CLIENT_LEVEL,$this->CLIENT_SUBLEVEL);
else
return '';
}
/**
* Return the OS version for the TSM client
*/
public function platform() {
return sprintf('%s %s',$this->PLATFORM_NAME,$this->CLIENT_OS_LEVEL ? '('.$this->CLIENT_OS_LEVEL.')' : '');
}
// @todo This needs to return the global configuration.
public function passexp() {
if ($this->PASSEXP)
return 'TBA';
else
return _('No Set');
}
// @todo This needs to be validated as a correct calculation
public function lasttransferpercent() {
$x = 100-($this->LASTSESS_IDLEWAIT+$this->LASTSESS_COMMWAIT+$this->LASTSESS_MEDIAWAIT);
return $x < 0 ? 0 : $x;
}
// @todo This needs to be validated as a correct calculation
public function lasttransfertime() {
if ($this->LASTSESS_DURATION)
return $this->LASTSESS_DURATION*($this->lasttransferpercent()/100);
else
return 0;
}
// @todo This needs to be validated as a correct calculation
public function lastsendperformance() {
if ($this->lasttransfertime())
return $this->LASTSESS_SENT/$this->lasttransfertime()/1024/1024;
else
return 0;
}
// @todo This needs to be validated as a correct calculation
public function lastreceiveperformance() {
if ($this->lasttransfertime())
return $this->LASTSESS_RECVD/$this->lasttransfertime()/1024/1024;
else
return 0;
}
/**
* The last sent aggregate performance
*/
public function lastsendaggperformance() {
if ((real)$this->LASTSESS_DURATION)
return $this->LASTSESS_SENT/$this->LASTSESS_DURATION/1024/1024;
else
return 0;
}
/**
* The last receive aggregate performance
*/
public function lastreceiveaggperformance() {
if ((real)$this->LASTSESS_DURATION)
return $this->LASTSESS_RECVD/$this->LASTSESS_DURATION/1024/1024;
else
return 0;
}
// @todo This should return the system setting (cloptset), if the node setting is not configured.
public function txngroupmax() {
return $this->TXNGROUPMAX;
}
// Test to see if a node has any data of type
// @param $type is BACKUP/ARCHIVE/SPACE MANAGED
public function hasData($type) {
return $this->vols_byctype($type) ? TRUE : FALSE;
}
public function activity() {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s',__METHOD__,$this->NODE_NAME);
$c = Kohana::$config->load('tsm')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
$result = array();
$result = $this->ACTLOG->ExcludeBA()->find_all();
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);
}
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
/**
* Get all the ACTIVITY LOG information for a SESSION
* @param $sid Session ID
* @param $start Session Start Time (to illiminate any duplication session data)
*/
public function actlog_session($sid,$start) {
$result = array();
foreach ($this->_actlog() as $alo)
if ($alo->SESSION == $sid AND $alo->start() >= $start)
array_push($result,$alo);
return $result;
}
/**
* Return the ACTIVITY of this NODE
* @param $type is Bkup/Arch/SpMg
*/
public function act_bybtype($type) {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s-%s',__METHOD__,$this->NODE_NAME,$type);
$c = Kohana::$config->load('tsm')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
$result = array();
foreach ($this->_actsum() as $aso)
if ($aso->ACTIVITY == $this->datatypemap($type))
array_push($result,$aso);
Sort::MASort($result,'SCHEDULE_NAME,START_TIME');
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);
}
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
/**
* Return the Schedules used for all activites of type
* @param $type is Bkup/Arch/SpMg
*/
public function act_schedules($type) {
$result = array();
foreach ($this->act_bybtype($type) as $ao)
if (! in_array($ao->SCHEDULE_NAME,$result))
array_push($result,$ao->SCHEDULE_NAME);
return $result;
}
/**
* Return the BACKUP TYPES used by this NODE
* ie: Bkup/Arch/SpMg
*/
public function btypes() {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s',__METHOD__,$this->NODE_NAME);
$c = Kohana::$config->load('tsm')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
$result = array();
foreach ($this->_occupancy() as $oo)
if (! in_array($oo->TYPE,$result))
array_push($result,$oo->TYPE);
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);
}
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
/**
* Return the total of a field for this NODE has by backup TYPE
* @param $field the field to check
* @param $data the value of that field to match
* @param $metric is metric of the storpage pool, eg: NUM_FILES
*/
private function _data_int($field,$data,$metric) {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s-%s-%s-%s',__METHOD__,$this->NODE_NAME,$field,$data,$metric);
$c = Kohana::$config->load('tsm')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
$result = 0;
foreach ($this->_occupancy() as $oo)
if ($oo->{$field} == $data)
$result += $oo->{$metric};
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);
}
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
/**
* Return the data that this NODE has in a STORAGE POOL by backup TYPE
* @param $pool is STORAGE POOL NAME
* @param $metric is metric of the storpage pool, eg: NUM_FILES
* @param $type is Bkup/Arch/SpMg
*/
private function _data_bypoolbybtype($pool,$metric,$type) {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s-%s-%s-%s',__METHOD__,$this->NODE_NAME,$pool,$metric,$type);
$c = Kohana::$config->load('tsm')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
$result = 0;
foreach ($this->_occupancy() as $oo)
if ($oo->STGPOOL_NAME == $pool AND $oo->TYPE == $type)
$result += $oo->{$metric};
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);
}
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
/**
* Return the FILES that this NODE has by backup TYPE
* @param $type is Bkup/Arch/SpMg
*/
public function file_bybtype($type) {
Log::instance()->add(LOG::DEBUG,'FLYBY :method',array(':method'=>__METHOD__));
return $this->_data_int('TYPE',$type,'NUM_FILES');
}
/**
* Return the FILES that this NODE has in a STORAGE POOL
* @param $pool is STORAGE POOL NAME
*/
public function file_bypool($pool) {
Log::instance()->add(LOG::DEBUG,'FLYBY :method',array(':method'=>__METHOD__));
return $this->_data_int('STGPOOL_NAME',$pool,'NUM_FILES');
}
public function file_bypoolbybtype($pool,$type) {
Log::instance()->add(LOG::DEBUG,'FLYBY :method',array(':method'=>__METHOD__));
return $this->_data_bypoolbybtype($pool,'NUM_FILES',$type);
}
/**
* Return the FILES that this NODE has in a STORAGE POOL TYPE
* @param $type is ACTIVEDATA/PRIMARY/COPY
*/
public function file_byptype($type) {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$result = 0;
foreach ($this->stgpools_byptype($type) as $spo)
$result += $this->file_bypool($spo);
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
public function file_active() {
return $this->file_byptype('ACTIVE') == 0 ? 'Unknown' : (int)$this->file_byptype('ACTIVE')/(int)$this->file_byptype('PRIMARY');
}
public function file_mediaprotection() {
return number_format((int)$this->file_byptype('COPY')/(int)$this->file_byptype('PRIMARY')*100,2);
}
public function fs() {
return $this->_filespaces();
}
public function fs_capacity() {
$result = 0;
foreach ($this->_filespaces() as $fso)
$result += $fso->CAPACITY;
return (int)$result;
}
public function fs_data() {
$result = 0;
foreach ($this->_filespaces() as $fso)
$result += $fso->utilsation();
return (int)$result;
}
public function fs_logical() {
$result = 0;
foreach ($this->_filespaces() as $fso)
$result += $fso->data_logical();
return (int)$result;
}
public function fs_utilisation() {
return round($this->fs_data()/$this->fs_capacity()*100,2);
}
public function fs_vol($vol) {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s-%s',__METHOD__,$this->NODE_NAME,$vol);
$c = Kohana::$config->load('tsm')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
$result = array();
foreach ($this->_volumeusage() as $vuo)
if ($vuo->VOLUME_NAME == $vol AND ! in_array($vuo->FILESPACE_NAME,$result))
array_push($result,$vuo->FILESPACE);
Sort::MASort($result,'FILESPACE_NAME');
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);
}
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
/**
* Return a Graph of the BA Client Sessions
* @param $type is Bkup/Arch/SpMg
* @see [node/ajaxjson_basessions]
*/
public function graph_basessions($type='Bkup',$schedule='') {
$chart = 'ComboChart';
$google = GoogleChart::factory($chart)
->div(sprintf('bas_%s_%s',$type,$schedule))
->dataurl(URL::site(sprintf('node/ajaxjson_basessions/%s?c=%s&s=%s&t=%s',$this->NODE_NAME,$chart,$schedule,$type)));
return (string)$google;
}
/**
* Return a Graph of the Schedule Backup Activity
* @param $type is Bkup/Arch/SpMg
* @see [node/ajaxjson_schedules]
*/
public function graph_schedules($type='Bkup',$schedule='') {
$chart = 'ComboChart';
$google = GoogleChart::factory($chart)
->div(sprintf('sch_%s_%s',$type,$schedule))
->dataurl(URL::site(sprintf('node/ajaxjson_schedules/%s?c=%s&s=%s&t=%s',$this->NODE_NAME,$chart,$schedule,$type)));
return (string)$google;
}
/**
* Return the LOGICAL_MB that this NODE has by backup TYPE
* @param $type is Bkup/Arch/SpMg
*/
public function logmb_bybtype($type) {
Log::instance()->add(LOG::DEBUG,'FLYBY :method',array(':method'=>__METHOD__));
return $this->_data_int('TYPE',$type,'LOGICAL_MB');
}
/**
* Return the LOGICAL_MB that this NODE has in a STORAGE POOL
* @param $pool is STORAGE POOL NAME
*/
public function logmb_bypool($pool) {
Log::instance()->add(LOG::DEBUG,'FLYBY :method',array(':method'=>__METHOD__));
return $this->_data_int('STGPOOL_NAME',$pool,'LOGICAL_MB');
}
public function logmb_bypoolbybtype($pool,$type) {
Log::instance()->add(LOG::DEBUG,'FLYBY :method',array(':method'=>__METHOD__));
return $this->_data_bypoolbybtype($pool,'LOGICAL_MB',$type);
}
/**
* Return the FILES that this NODE has in a STORAGE POOL TYPE
* @param $type is ACTIVEDATA/PRIMARY/COPY
*/
public function logmb_byptype($type) {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$result = 0;
foreach ($this->stgpools_byptype($type) as $spo)
$result += $this->logmb_bypool($spo);
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
public function occupancy() {
return $this->_occupancy();
}
/**
* Return the STORAGE POOLS this NODE has data in
*/
public function stgpools() {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s',__METHOD__,$this->NODE_NAME);
$c = Kohana::$config->load('tsm')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
$x = $result = array();
foreach ($this->_occupancy() as $oo)
if (! in_array($oo->STGPOOL_NAME,$x)) {
array_push($result,$oo->STGPOOL);
array_push($x,$oo->STGPOOL_NAME);
}
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);
}
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
/**
* Return the STORAGE POOL TYPES used by this NODE
* ie: ACTIVE/PRIMARY/COPY
* @todo This should be sorted by PRIMARY/ACTIVE/COPY
*/
public function stgpooltypes() {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s',__METHOD__,$this->NODE_NAME);
$c = Kohana::$config->load('tsm')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
$result = array();
foreach ($this->stgpools() as $spo)
if (! in_array($spo->POOLTYPE,$result))
array_push($result,$spo->POOLTYPE);
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);
}
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
/**
* Return the STORAGE POOLS that this NODE uses by BACKUP TYPE
* @param $type is Bkup/Arch/SpMg
*/
public function stgpools_bybtype($type) {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s-%s',__METHOD__,$this->NODE_NAME,$type);
$c = Kohana::$config->load('tsm')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
$x = $result = array();
foreach ($this->_occupancy() as $oo)
if ($oo->TYPE == $type AND ! in_array($oo->STGPOOL_NAME,$x)) {
array_push($result,$oo->STGPOOL);
array_push($x,$oo->STGPOOL_NAME);
}
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);
}
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
/**
* Return the STORAGE POOLS that this NODE uses by BACKUP TYPE
* @param $type is ACTIVEDATA/PRIMARY/COPY
*/
public function stgpools_byptype($type) {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s-%s',__METHOD__,$this->NODE_NAME,$type);
$c = Kohana::$config->load('tsm')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
$result = array();
foreach ($this->stgpools() as $spo)
if ($spo->POOLTYPE == $type)
array_push($result,$spo);
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);
}
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
public function vols_bybtype($type) {
return $this->vols_byctype($this->datatypemap($type));
}
private function _vols_metric($metric,$data) {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s-%s-%s',__METHOD__,$this->NODE_NAME,$metric,$data);
$c = Kohana::$config->load('tsm')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
$x = $result = array();
foreach ($this->_volumeusage() as $vuo)
if ($vuo->{$metric} == $data AND ! in_array($vuo->VOLUME_NAME,$x)) {
array_push($result,$vuo->VOLUME);
array_push($x,$vuo->VOLUME_NAME);
}
Sort::MASort($result,'VOLUME_NAME');
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);
}
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
/**
* Return the VOLUMES that this NODE uses by BACKUP TYPE
* @param $type is BACKUP/ARCHIVE/SPACE MANAGED
*/
public function vols_byctype($type) {
return $this->_vols_metric('COPY_TYPE',$type);
}
/**
* Return the VOLUMES that this NODE uses
* @param $pool is STORAGE POOL NAME
*/
public function vols_bypool($pool) {
return $this->_vols_metric('STGPOOL_NAME',$pool);
}
/**
* Return the VOLUMES that this NODE has in a STORAGE POOL TYPE
* @param $type is ACTIVEDATA/PRIMARY/COPY
*/
public function vols_byptype($type) {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$result = array();
foreach ($this->stgpools_byptype($type) as $spo)
$result = array_merge($result,$this->vols_bypool($spo));
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
/**
* Return the VOLUMES that this NODE uses by POOL and BACKUP TYPE
* @param $pool is STORAGE POOL NAME
* @param $type is Bkup/Arch/SpMg
*/
public function vols_bypoolbybtype($pool,$type) {
return $this->vols_bypoolbyctype($pool,$this->datatypemap($type));
}
/**
* Return the VOLUMES that this NODE uses by POOL and BACKUP TYPE
* @param $pool is STORAGE POOL NAME
* @param $type is BACKUP/ARCHIVE/SPACE MANAGED
*/
public function vols_bypoolbyctype($pool,$type) {
Log::instance()->add(LOG::DEBUG,'ENTER :method',array(':method'=>__METHOD__));
$k = sprintf('%s-%s-%s-%s',__METHOD__,$this->NODE_NAME,$pool,$type);
$c = Kohana::$config->load('tsm')->cache;
if (is_null($result = Cache::instance($c)->get($k))) {
$result = array();
foreach ($this->_volumeusage() as $vuo)
if ($vuo->STGPOOL_NAME == $pool AND $vuo->COPY_TYPE == $type AND ! in_array($vuo->VOLUME_NAME,$result))
array_push($result,$vuo->VOLUME);
Sort::MASort($result,'VOLUME_NAME');
// @todo Cache time should be configurble
Cache::instance($c)->set($k,$result,300);
}
Log::instance()->add(LOG::DEBUG,'EXIT :method',array(':method'=>__METHOD__));
return $result;
}
public function volumeusage() {
return $this->_volumeusage();
}
}
?>

View File

@@ -0,0 +1,38 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* This class contains our TSM information
*
* @package TSM Database Module
* @category Helpers
* @author Deon George
* @copyright (c) 2010-2014 Deon George
* @license http://dev.leenooks.net/license.html
*/
abstract class lnApp_TSM {
static $_online = FALSE;
public function set($username,$password,Database_TSM_Result $server) {
return TSM::$_online = TRUE;
}
public static function online() {
return TSM::$_online;
}
public static function instance() {
return new TSM;
}
public static function name() {
return Session::instance()->get('SERVER')->get('SERVER_NAME');
}
public static function version() {
$s = Session::instance()->get('SERVER')->rewind()->as_array();
$s = array_pop($s);
return sprintf('%s.%s.%s.%s',$s['VERSION'],$s['RELEASE'],$s['LEVEL'],$s['SUBLEVEL']);
}
}
?>

View File

@@ -0,0 +1,78 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* Configuration - TSM Client
*
* @package TSM Database Module
* @category Configuration
* @author Deon George
* @copyright (c) 2010-2014 Deon George
* @license http://dev.leenooks.net/license.html
*/
return array
(
'dsmadmc' => array
(
'type' => 'tsm_dsmadmc',
'connection' => array(
/**
* The following options are available for MySQL:
*
* string hostname server hostname, or socket
* string database database name
* string username database username
* string password database password
* boolean persistent use persistent connections?
*
* Ports and sockets may be appended to the hostname.
*/
//'hostname' => 'localhost', // Unused
'username' => 'admin',
'password' => 'tsm0593lx',
//'persistent' => FALSE, // Unused
),
'table_prefix' => '',
'charset' => 'utf8',
'caching' => TRUE,
'cache' => array(
'ASSOCIATIONS' => 1200,
'AR_COPYGROUPS' => 1200,
'BU_COPYGROUPS' => 1200,
'CLIENT_SCHEDULES' => 1200,
'CLIENTOPTS' => 1200,
'DEVCLASSES' => 1200,
'DOMAINS' => 1200,
'DRIVES' => 1200,
'EVENTS' => 1200,
'FILESPACES' => 1200,
'LIBRARIES' => 1200,
'LIBVOLUMES' => 1200,
'MEDIA' => 1200,
'MGMTCLASSES' => 1200,
'NODES' => 1200,
'OCCUPANCY' => 1200,
'PATHS' => 1200,
'SCHEMA' => 604800,
'STGPOOLS' => 1200,
'SUMMARY' => 180,
'VOLHISTORY' => 1200,
'VOLUMES' => 1200,
'VOLUMEUSAGE' => 1200,
),
'cachepreload' => array(
'DEVCLASSES' => 1200,
'DOMAINS' => 1200,
'DRIVES' => 1200,
'LIBVOLUMES' => 1200,
'LIBRARIES' => 1200,
'MEDIA' => 1200,
'NODES' => 1200,
'STGPOOLS' => 1200,
'VOLHISTORY' => 1200,
'VOLUMES' => 1200,
),
'profiling' => TRUE,
),
);
?>

View File

@@ -0,0 +1,18 @@
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
* TSM system default configurable items.
*
* @package TSM Database Module
* @category Configuration
* @author Deon George
* @copyright (c) 2010-2014 Deon GEorge
* @license http://dev.leenooks.net/license.html
*/
return array(
'client' => '/opt/tivoli/tsm/client/ba/bin/dsmadmc',
'client_type' => 'dsmadmc',
'client_errorlogname' => '/tmp/tsm-errorlog.log',
);
?>