From 1c7c79f89c2f8b870771be0be556eeafa6229626 Mon Sep 17 00:00:00 2001 From: Deon George Date: Thu, 13 Dec 2012 13:58:45 +1100 Subject: [PATCH] Fixes for Server Activity Log --- application/classes/Model/ACTLOG.php | 26 ++++++++++++++++++++++++-- application/classes/Model/STATUS.php | 2 +- application/config/config.php | 2 +- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/application/classes/Model/ACTLOG.php b/application/classes/Model/ACTLOG.php index 431b708..5025744 100644 --- a/application/classes/Model/ACTLOG.php +++ b/application/classes/Model/ACTLOG.php @@ -56,13 +56,17 @@ class Model_ACTLOG extends ORM_TSM { ); private $_msgno_admin = array( + 162=>array('msg'=>'ANR0162W Supplemental database diagnostic information: .*','id'=>''), 405=>array('msg'=>'ANR0405I Session [0-9]+ ended for administrator ([0-9a-zA-Z]+) \(.*\)\..*','id'=>''), 407=>array('msg'=>'ANR0407I Session [0-9]+ started for administrator ([0-9a-zA-Z]+) \(.*\) \(.*\)\..*','id'=>''), + 516=>array('msg'=>'ANR0516E SQL processing for statement .* failed.','id'=>''), + 1701=>array('msg'=>'ANR1701E QUERY REPLNODE: No matching servers defined.','id'=>''), 1999=>array('msg'=>'ANR1999I QUERY REPLRULE completed successfully','id'=>''), 2017=>array('msg'=>'ANR2017I Administrator ADMIN issued command: (.*)','id'=>''), 2034=>array('msg'=>'ANR2034E SELECT: No match found using this criteria.','id'=>''), 2906=>array('msg'=>'ANR2906E Unexpected SQL literal token - .*.','id'=>''), - 2939=>array('msg'=>'ANR2939E The reference .* contains an unknown SQL table name','id'=>''), + 2939=>array('msg'=>'ANR2939E The reference .* contains an unknown SQL table name.','id'=>''), + 2940=>array('msg'=>'ANR2940E The command \'.*\ contains an unknown SQL column name.','id'=>''), ); private $_msgno_expire = array( @@ -73,7 +77,19 @@ class Model_ACTLOG extends ORM_TSM { 987=>array('msg'=>'ANR0987I Process [0-9]+ for EXPIRE INVENTORY running in the BACKGROUND processed .* items with a completion state of .* at .*','id'=>''), ); + private $_msgno_volume = array( + 515=>array('msg'=>'ANR0515I Process [0-9]+ closed volume .*','id'=>''), + 8325=>array('msg'=>'ANR8325I Dismounting volume .* - .* minute mount retention expired','id'=>''), + 8336=>array('msg'=>'ANR8336I Verifying label of .* volume .* in drive .* \(.*\)','id'=>''), + 8340=>array('msg'=>'ANR8340I .* volume .* mounted.','id'=>''), + 8341=>array('msg'=>'ANR8341I End-of-volume reached for .* volume .*','id'=>''), + 8468=>array('msg'=>'ANR8468I .* volume .* dismounted from drive .* \(.*\) in library .*.','id'=>''), + 8493=>array('msg'=>'ANR8493I .* volume .* mounted in drive .* \(.*\) in library .*.','id'=>''), + ); + private $_msgno_session = array( + 397=>array('msg'=>'ANR0397I Session [0-9]+ for node .* has begun a proxy session for node .*.','id'=>''), + 399=>array('msg'=>'ANR0399I Session [0-9]+ for node .* has ended a proxy session for node .*.','id'=>''), 403=>array('msg'=>'ANR0403I Session [0-9]+ ended for node .* \(.*\)','id'=>''), 406=>array('msg'=>'ANR0406I Session [0-9]+ started for node .* \(.*\) \(.*\)','id'=>''), 408=>array('msg'=>'ANR0408I Session [0-9]+ started for server .* \(.*\) \(.*\) for configuration management','id'=>''), @@ -81,18 +97,24 @@ class Model_ACTLOG extends ORM_TSM { 482=>array('msg'=>'ANR0482W Session [0-9]+ for node .* \(.*\) terminated - idle for more than .* minutes.','id'=>''), 511=>array('msg'=>'ANR0511I Session [0-9]+ opened output volume .*','id'=>''), 514=>array('msg'=>'ANR0514I Session [0-9]+ closed volume .*','id'=>''), + 568=>array('msg'=>'ANR0568W Session [0-9]+ for admin .* terminated - connection with client severed.','id'=>''), 2507=>array('msg'=>'ANR2507I Schedule .* for domain .* started at .* for node .* completed successfully at .*','id'=>''), 3157=>array('msg'=>'ANR3157I Configuration refresh started for managed server .*','id'=>''), 8592=>array('msg'=>'ANR8592I Session [0-9]+ connection is using SSL version TLSV11, cipher specification AES-128 certificate serial number ([0-9:]+)','id'=>''), 8595=>array('msg'=>'ANR8595I Session to address .* is using SSL version TLSV11, cipher specification AES-128, certificate serial number ([0-9:]+).','id'=>''), ); + private $_msgno_debug = array( + 1257=>array('msg'=>'ANR1257W Storage pool backup skipping damaged file on .*','id'=>''), + 9999=>array('msg'=>'','id'=>''), + ); + private function _bamsgs() { return $this->_msgno_ba_objects+$this->_msgno_ba_bytes+$this->_msgno_ba_transfer+$this->_msgno_ba_reduction; } private function _svrmsgs() { - return $this->_msgno_admin+$this->_msgno_expire+$this->_msgno_session; + return $this->_msgno_admin+$this->_msgno_expire+$this->_msgno_session+$this->_msgno_volume+$this->_msgno_debug; } /** diff --git a/application/classes/Model/STATUS.php b/application/classes/Model/STATUS.php index e6f0631..e1534a6 100644 --- a/application/classes/Model/STATUS.php +++ b/application/classes/Model/STATUS.php @@ -31,7 +31,7 @@ class Model_STATUS extends ORM_TSM { $result = ORM::factory('ACTLOG') ->ExcludeSERVER() ->where('ORIGINATOR','IN',array('SERVER')) - ->and_where('DATE_TIME','>=',date('Y-m-d',time()-86400*Kohana::$config->load('config')->tsmserveractlog)) + ->and_where('DATE_TIME','>=',date('Y-m-d H:00:00',time()-3600*Kohana::$config->load('config')->tsmserveractlog)) ->find_all(); // @todo Cache time should be configurble diff --git a/application/config/config.php b/application/config/config.php index 104234e..32db197 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -24,7 +24,7 @@ return array( 'tsmpooltypes' => array('PRIMARY','ACTIVEDATA','COPY'), 'tsmvolstatus' => array('FULL','FILLING','PENDING','EMPTY'), 'tsmtapeage' => 180, // Age of tapes before prompting to rotate - 'tsmserveractlog' => 0, // How many days to retireve from the Server Act Log + 'tsmserveractlog' => 24, // How many hours to retireve from the Server Act Log 'email_admin_only'=> array( 'method'=>array('wurley@users.sf.net'=>'Deon George'), ),