Alceu Rodrigues de Freitas Junior > Siebel-Srvrmgr-0.14 > Siebel::Srvrmgr::Daemon::Action::CheckComps

Download:
Siebel-Srvrmgr-0.14.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Source  

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::Tabular::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 server instance itself will expect to have multiple instances of objects representing a Siebel Component and those instances must be of a class that has the Moose role Siebel::Srvrmgr::Daemon::Action::CheckComps::Component applied.

See the examples directory of this distribution, uh, examples of implementation.

BUILD

Validates if the params array reference have objects with the Siebel::Srvrmgr::Daemon::Action::Check::Server role applied.

do_parsed

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::Tabular::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 in 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/.

syntax highlighting: