NAME
Siebel::Srvrmgr::Daemon::Action::CheckComps - subclass of Siebel::Srvrmgr::Daemon::Action to verify components status
SYNOPSIS
use Siebel::Srvrmgr::Daemon::Action::CheckComps;
my $return_data = Siebel::Srvrmgr::Daemon::ActionStash->instance();
my $comps = [ {name => 'SynchMgr', ok_status => 'Running'}, { name => 'WfProcMgr', ok_status => 'Running'} ];
my $action = Siebel::Srvrmgr::Daemon::Action::CheckComps->new({ parser => Siebel::Srvrmgr::ListParser->new(),
params => [ $server1, $server2 ] });
$action->do();
# do something with $return_data
DESCRIPTION
This subclass of Siebel::Srvrmgr::Daemon::Action will try to find a Siebel::Srvrmgr::ListParser::Output::ListComp object in the given array reference given as parameter to the do
method and compares the status of the components with the array reference given as parameter.
The do
method of Siebel::Srvrmgr::Daemon::Action::CheckComps
uses Siebel::Srvrmgr::Daemon::ActionStash to enable the program that created the object instance to be able to fetch the information returned.
This module was created to work close with Nagios concepts, especially regarding threshold levels (see new
method for more details).
METHODS
new
The new method returns a instance of Siebel::Srvrmgr::Daemon::Action::CheckComps. The parameter expected are the same ones of any subclass of Siebel::Srvrmgr::Daemon::Action, but the params
attribute has a important difference: it expects an array reference with instances of classes that have the role Siebel::Srvrmgr::Daemon::Action::CheckComps::Server. The way that the classes will get the information about which component information is available per server is not important as long as they keep the same methods defined by the roles Siebel::Srvrmgr::Daemon::Action::CheckComps::Server for a Siebel server and Siebel::Srvrmgr::Daemon::Action::CheckComps::Component for a Siebel server component.
See the examples directory of this distribution to check a XML file used for configuration for more details.
BUILD
Validates if the params array reference have objects with the Siebel::Srvrmgr::Daemon::Action::CheckComps::Server role applied.
do
Expects a array reference as the buffer output from srvrmgr program as a parameter.
This method will check the output from srvrmgr
program parsed by Siebel::Srvrmgr::ListParser::Output::ListComp object and compare each component recovered status with the status defined in the array reference given to params
method during object creation.
It will return 1 if this operation was executed successfuly and request a instance of Siebel::Srvrmgr::Daemon::ActionStash, calling it's method instance
and then set_stash
with a hash reference as it's content. Otherwise, the method will return 0 and no data will be set to the ActionStash object.
The hash reference stored at the ActionStash object will have the following structure:
$VAR1 = {
'foobar_server' => {
'CompAlias1' => 0,
'CompAlias2' => 1
},
'foobar2_server' => {
'CompAlias1' => 1,
'CompAlias2' => 1
}
};
If the servername passed during the object creation (as params
attribute of new
method) cannot be found in the buffer parameter, the object will raise an exception.
Beware that this Action subclass can deal with multiple servers, as long as the buffer output is from a list comp
, list all server/components that are part of the Siebel Enterprise.
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/>.