The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Siebel::Srvrmgr::Daemon::Action::CheckTasks - subclass of Siebel::Srvrmgr::Daemon::Action to verify components tasks status

SYNOPSIS

        use Siebel::Srvrmgr::Daemon::Action::CheckTasks;

    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::CheckTasks->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::ListTask 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::CheckTasks 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 plug-in concepts, especially regarding threshold levels (see new method for more details).

METHODS

new

The new method returns a instance of Siebel::Srvrmgr::Daemon::Action::CheckTasks. 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::Check::Server.

See the examples directory of this distribution to check a XML file used for configuration for more details.

BUILD

Validates if the params attribute has objects with the Siebel::Srvrmgr::Daemon::Action::Check::Server role applied.

do_parsed

Expects as parameter a instance of Siebel::Srvrmgr::ListParser::Output::Tabular::ListTasks class, otherwise this method will raise an exception.

It will check the output from srvrmgr program parsed by Siebel::Srvrmgr::ListParser::Output::Tabular::ListTask object and compare each task recovered status with the taskOKStatus attribute of each instance of Siebel::Srvrmgr::Daemon::Action::Check::Component available in params attribute 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 the object passed as parameter to this method, the methodreturned by will raise an exception.

Beware that this Action subclass can deal with multiple servers, as long as the buffer output is from a list tasks, dealing with all server tasks 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/>.