NAME
Siebel::Srvrmgr::Daemon::Light - class for running commmands with Siebel srvrmgr program
SYNOPSIS
use Siebel::Srvrmgr::Daemon::Light;
my $daemon = Siebel::Srvrmgr::Daemon::Light->new(
{
server => 'servername',
gateway => 'gateway',
enterprise => 'enterprise',
user => 'user',
password => 'password',
bin => 'c:\\siebel\\client\\bin\\srvrmgr.exe',
commands => [
Siebel::Srvrmgr::Daemon::Command->new(
command => 'load preferences',
action => 'LoadPreferences'
),
Siebel::Srvrmgr::Daemon::Command->new(
command => 'list comp type',
action => 'ListCompTypes',
params => [$comp_types_file]
),
Siebel::Srvrmgr::Daemon::Command->new(
command => 'list comp',
action => 'ListComps',
params => [$comps_file]
),
Siebel::Srvrmgr::Daemon::Command->new(
command => 'list comp def',
action => 'ListCompDef',
params => [$comps_defs_file]
)
]
}
);
DESCRIPTION
This is a subclass of Siebel::Srvrmgr::Daemon used to execute the srvrmgr
program in batch mode. For a better understanding of what batch mode means, check out srvrmgr documentation.
This class is recomended for cases where it is not necessary to run several commmands through srvrmgr in a short period of time because in batch mode it will connect to the Siebel Gateway, execute the commands configured and exit, avoiding keeping a connection opened for a long time. For UNIX-like OS, this class would be a good choice for using with Inetd and Xinetd daemons.
This class is also highly recommended for OS plataforms like Microsoft Windows where IPC is not reliable enough, since this class uses system
instead of IPC::Open3.
Since version 0.21, this class does not overrides anymore the parent class method shift_command
. Some attention is required is this matter, since a instance of Siebel::Srvrmgr::Daemon::Light will not maintain configuration previously loaded with load preferences
command. Be sure to maintain this command everytime you invoke run
available in the commands
attribute.
ATTRIBUTES
output_file
A string that represents the "/o" command line parameter of srvrmgr. It is defined internally, so it is read-only.
input_file
A string that represents the "/i" command line parameter of srvrmgr. It is defined internally, so it is read-only.
METHODS
get_output_file
Returns the content of the output_file
attribute.
get_input_file
Returns the content of the input_file
attribute.
run
This method will try to connect to a Siebel Enterprise through srvrmgr
program (if it is the first time the method is invoke) or reuse an already open connection to submit the commands and respective actions defined during object creation. The path to the program is check and if it does not exists the method will issue an warning message and immediatly returns false.
Those operations will be executed in a loop as long the check
method from the class Siebel::Srvrmgr::Daemon::Condition returns true.
Beware that Siebel::Srvrmgr::Daemon uses a single instance of a Siebel::Srvrmgr::ListParser class to process the parsing requests, so it is not possible to execute Siebel::Srvrmgr::Daemon::Command instances in parallel.
cmds_vs_tree
This method compares the number of commands
defined in a instance of this class with the number of nodes passed as parameter.
If their are equal, the number is returned. If their are different (and there is a problem with the parsed output of srvrmgr) this method returns undef
.
CAVEATS
This class is still considered experimental and should be used with care.
The srvrmgr
program uses buffering, which makes difficult to read the generated output as expected.
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/.