The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Siebel::Srvrmgr::ListParser::Output::Tabular::ListSessions - subclass to parse list tasks command

SYNOPSIS

See Siebel::Srvrmgr::ListParser::Output::Tabular for examples.

DESCRIPTION

This subclass of Siebel::Srvrmgr::ListParser::Output::Tabular parses the output of the command list sessions.

It is expected that the srvrmgr program has a proper configuration for the list sessions command. The default configuration can be seen below:

    srvrmgr:> configure list sessions
            SV_NAME (31): Server name
                CC_ALIAS (31): Component alias
                CG_ALIAS (31): Component group alias
                TK_TASKID (11): Internal task id
                TK_PID (11): Task process id
                TK_DISP_RUNSTATE (61): Task run once
                TK_IDLE_STATE (31): Task idle or not
                TK_PING_TIME (13): Last ping time for task
                TK_HUNG_STATE (31): Task hung state
                DB_SESSION_ID (76): Database session Id
                OM_LOGIN (76): Object Manager Login
                OM_BUSSVC (76): OM - Business Service
                OM_VIEW (76): OM - View State
                OM_APPLET (76): OM - Applet
                OM_BUSCOMP (76): OM - Business Component

Be sure to include this configuration when generating output, specially because the columns name width.

The order of the fields is important too: everytime those fields are parsed, if they do not follow the order above an exception will be raised.

An instance of this class will also know how many sessions it has, independently of the sessions state. Since it cannot know which string represents a session state, be sure to use the correct list sessions variation to get the sessions that you're interested in.

METHODS

Some methods from the parent classes are overrided.

get_servers

Returns a list of the Siebel Server names from the parsed output.

count_server_sessions

Returns an integer representing the number of sessions recovered from the parsed output.

Expects a string as parameter being the Siebel Server name, so the number of sessions are those related to the server passed as argument.

Beware that by number of sessions it means all sessions are the output, independent of the status of the session.

count_sv_alias_sessions

Returns an integer representing the number of sessions retrieved from a list sessions command output for a given component alias in a server.

Expects as parameters, in this order:

  • servername

  • component alias

Beware that by number of sessions it means all sessions are the output, independent of the status of the session.

count_alias_sessions

Returns an integer representing the number of sessions retrieved from a list sessions command output for a given component alias. If multiple Siebel servers are available in the output, that will be the sum of all of them.

Expects a component alias as parameter.

Beware that by number of sessions it means all sessions in the output, independent of the status of the session.

get_sessions

Returns an iterator to iterate over the list of sessions of a Siebel Server given as argument.

At each invocation of the iterator, a hash reference is returned or undef in the case that there are no more sessions.

The hash reference will have keys corresponding to the defined columns of the list sessions command and the respective values:

  • comp_alias

  • comp_group_alias

  • task_id

  • task_pid

  • task_state

  • task_idle_state

  • task_ping_time

  • task_hung_state

  • db_session_id

  • om_login

  • om_service

  • om_view

  • om_applet

  • om_buscomp

CAVEATS

Depending on the servers configurations, how output is being read, you might get truncated data from some fields if the fixed width output type is being used.

SEE ALSO

AUTHOR

Alceu Rodrigues de Freitas Junior, <arfreitas@cpan.org>.

COPYRIGHT AND LICENSE

This software is copyright (c) 2013 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/.