diff --git a/application/classes/Model/ACTLOG.php b/application/classes/Model/ACTLOG.php
index 5025744..f486b24 100644
--- a/application/classes/Model/ACTLOG.php
+++ b/application/classes/Model/ACTLOG.php
@@ -160,7 +160,8 @@ class Model_ACTLOG extends ORM_TSM {
switch ($m[2]) {
case 'GB': $y *= 1024;
case 'MB': $y *= 1024;
- case 'KB': $y *= 1024;
+ break;
+ case 'KB': $y /= 1024;
}
}
diff --git a/application/classes/Model/FILESPACE.php b/application/classes/Model/FILESPACE.php
index ba08b66..4f4bed8 100644
--- a/application/classes/Model/FILESPACE.php
+++ b/application/classes/Model/FILESPACE.php
@@ -146,6 +146,49 @@ class Model_FILESPACE extends ORM_TSM {
return $result;
}
+ /**
+ * Return the physical space that has been given to TSM to store
+ */
+ public function data_physical() {
+ $result = 0;
+
+ foreach ($this->_occupancy() as $oo) {
+ // Quick Sanity Check
+ if ((int)$oo->PHYSICAL_MB == 0 AND $oo->LOGICAL_MB > $oo->REPORTING_MB)
+ SystemMessage::add(array(
+ 'title'=>_('TSM Data Integrity ?'),
+ 'body'=>sprintf('While [%s] PHYSICAL_MB is (%s), LOGICAL_MB (%s) > REPORTING_MB(%s) [%s]?',$oo->FILESPACE_NAME,$oo->PHYSICAL_MB,$oo->LOGICAL_MB,$oo->REPORTING_MB,$oo->STGPOOL_NAME),
+ 'type'=>'error',
+ ));
+
+ elseif ((int)$oo->PHYSICAL_MB > 0 AND $oo->LOGICAL_MB > $oo->PHYSICAL_MB)
+ SystemMessage::add(array(
+ 'title'=>_('TSM Data Integrity ?'),
+ 'body'=>sprintf('While [%s] PHYSICAL_MB is (%s), LOGICAL_MB (%s) is greater [%s]?',$oo->FILESPACE_NAME,$oo->PHYSICAL_MB,$oo->LOGICAL_MB,$oo->STGPOOL_NAME),
+ 'type'=>'error',
+ ));
+
+ if ((int)$oo->PHYSICAL_MB > 0)
+ $result += $oo->PHYSICAL_MB;
+ else
+ $result += $oo->REPORTING_MB;
+ }
+
+ return $result;
+ }
+
+ /**
+ * Return the space that TSM is using to store this data
+ */
+ public function data_logical() {
+ $result = 0;
+
+ foreach ($this->_occupancy() as $oo)
+ $result += $oo->LOGICAL_MB;
+
+ return $result;
+ }
+
/**
* Return the LOGICAL_MB that this FILESYSTEM has in a STORAGE POOL
* @param $pool is STORAGE POOL NAME
diff --git a/application/classes/Model/NODE.php b/application/classes/Model/NODE.php
index ed945f7..488b187 100644
--- a/application/classes/Model/NODE.php
+++ b/application/classes/Model/NODE.php
@@ -507,10 +507,49 @@ class Model_NODE extends ORM_TSM {
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 (int)$this->file_byptype('COPY')/(int)$this->file_byptype('PRIMARY');
+ }
+
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);
+ }
+
/**
* Return a Graph of the BA Client Sessions
* @param $type is Bkup/Arch/SpMg
diff --git a/application/views/node/detail.php b/application/views/node/detail.php
index 5b72215..26307b1 100644
--- a/application/views/node/detail.php
+++ b/application/views/node/detail.php
@@ -2,7 +2,7 @@
set('o',$o); ?> |
- set('o',$o); ?> |
+ set('o',$o); ?> |
set('o',$o->DOMAIN); ?> |
diff --git a/application/views/node/filespace_stats.php b/application/views/node/filespace_stats.php
new file mode 100644
index 0000000..17da5d4
--- /dev/null
+++ b/application/views/node/filespace_stats.php
@@ -0,0 +1,25 @@
+
+
+
+ Filespace Stats |
+
+
+ |
+
+
+ File Space |
+ Data |
+ Backed Up |
+ Stored |
+ Ratio |
+
+ fs() as $fso) { ?>
+
+ display('FILESPACE_NAME'); ?> |
+ utilsation(),0,'',''); ?> |
+ data_physical(),0,'',''); ?> |
+ data_logical(),0,'',''); ?> |
+ utilsation() ? number_format($fso->data_logical()/$fso->utilsation(),2) : 'N/A'; ?> |
+
+
+
diff --git a/application/views/node/stats.php b/application/views/node/stats.php
new file mode 100644
index 0000000..e956a81
--- /dev/null
+++ b/application/views/node/stats.php
@@ -0,0 +1,30 @@
+
+
+
+ Node Stats |
+
+
+ |
+
+
+ Files Protected |
+ file_byptype('PRIMARY'); ?> |
+
+
+ Files on Copy Media |
+ file_byptype('COPY'); ?> (file_mediaprotection(); ?>%) |
+
+
+ Active Files on the Node |
+ file_active(); ?> |
+
+
+ Data on Node |
+ fs_data(),$o->fs_capacity(),$o->fs_utilisation()); ?> |
+
+
+ Data in TSM |
+ fs_logical(),number_format($o->fs_logical()/$o->fs_data(),2)); ?> |
+
+
+set('o',$o); ?>