NAME
Siebel::Srvrmgr::OS::Unix - module to recover information from OS processes of Siebel components
SYNOPSIS
use Siebel::Srvrmgr::OS::Unix;
my $procs = Siebel::Srvrmgr::OS::Unix->new(
{
enterprise_log => $enterprise_log,
cmd_regex => "^$path_to_siebel_dir",
parent_regex => 'Created\s(multithreaded\s)?server\sprocess\s\(OS\spid\s\=\s+\d+\s+\)\sfor\s\w+'
}
);
my $procs_ref = $procs->get_procs;
foreach my $comp_pid(keys(%{$procs_ref})) {
print 'Component ', $procs_ref->{$comp_pid}->{comp_alias}, ' is using ', $procs_ref->{$comp_pid}->{pctcpu}, "% of CPU now\n";
}
DESCRIPTION
This module is a Moose class.
It is responsible to recover information from a UNIX-like operation system to be able to merge with information regarding Siebel components.
This class represents the processes of a single Siebel Server and will recover processes information from /proc
directory.
Additionally, this class has a method to search the Siebel enterprise log file for processes information as well.
ATTRIBUTES
enterprise_log
Required attribute.
A string of the complete path name to the Siebel enterprise log file.
parent_regex
Required attribute.
A string of the regular expression to match if the process recovered from the enterprise log file has children or not.
Since the enterprise may contain different language settings, this parameter is required and will depend on the language set.
This attribute is a string, not a compiled regular expression with qr
.
cmd_regex
Required attribute.
A string of the regular expression to match the command executed by the Siebel user from the cmdline
file in /proc
. This usually is the path included in the binary when you check with ps -aux
command.
This attribute is a string, not a compiled regular expression with qr
.
mem_limit
Optional attribute.
A integer representing the maximum bytes of RSS a Siebel process might have.
If set together with limits_callback
, this class can execute some action when this threshold is exceeded.
cpu_limit
Optional attribute.
A integer representing the maximum CPU percentage a Siebel process might have.
If set together with limits_callback
, this class can execute some action when this threshold is exceeded.
limits_callback
Optional attribute.
A code reference that will be executed when one of the attributes mem_limit
and cpu_limit
threshold is exceeded.
This is useful, for example, with you want to set a alarm or something like that.
The code reference will receive a hash reference as parameter which keys and values will depend on the type of limit triggered:
memory:
type => 'memory' rss => <processes RSS> vsz => <process VSZ> pid => <process id> fname => <process fname>, cmd => <process cmndline>
CPU:
type => 'cpu' cpu => <process % of cpu> pid => <process id> fname => <process fname> cmd => <process cmndline>
METHODS
get_procs
Searches through /proc
and the Siebel Enterprise log file and returns an hash reference with the pids as keys and hashes references as values. For those hash references, the following keys will be available:
fname: name of the process
pctcpu: % of server total CPU
pctmem: % of server total memory
rss: RSS
vsz: VSZ
comp_alias: alias of the Siebel Component
The only process informations will be those match cmd_regex
and that have fname
equal one of the following values:
siebmtsh
siebmtshmw
siebproc
siebprocmw
siebsess
siebsh
siebshmw
SEE ALSO
AUTHOR
Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 of Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>
This file is part of Siebel Monitoring Tools.
Siebel Monitoring Tools is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Siebel Monitoring Tools is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Siebel Monitoring Tools. If not, see <http://www.gnu.org/licenses/>.