line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Siebel::Srvrmgr::ListParser::Output::ListComp::Server; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=pod |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Siebel::Srvrmgr::ListParser::Output::ListComp::Server - class to parse and aggregate information about servers and their components |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=cut |
10
|
|
|
|
|
|
|
|
11
|
12
|
|
|
12
|
|
4320
|
use Moose 2.0401; |
|
12
|
|
|
|
|
282
|
|
|
12
|
|
|
|
|
99
|
|
12
|
12
|
|
|
12
|
|
107930
|
use namespace::autoclean 0.13; |
|
12
|
|
|
|
|
334
|
|
|
12
|
|
|
|
|
107
|
|
13
|
12
|
|
|
12
|
|
2384
|
use Siebel::Srvrmgr::ListParser::Output::ListComp::Comp; |
|
12
|
|
|
|
|
782
|
|
|
12
|
|
|
|
|
476
|
|
14
|
12
|
|
|
12
|
|
84
|
use Carp; |
|
12
|
|
|
|
|
31
|
|
|
12
|
|
|
|
|
1117
|
|
15
|
12
|
|
|
12
|
|
117
|
use Storable qw(nstore); |
|
12
|
|
|
|
|
46
|
|
|
12
|
|
|
|
|
5161
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our $VERSION = '0.29'; # VERSION |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=pod |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 SYNOPSIS |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
use Siebel::Srvrmgr::ListParser::Output::ListComp::Server; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Siebel::Srvrmgr::ListParser::Output::ListComp::Server->new( |
26
|
|
|
|
|
|
|
{ |
27
|
|
|
|
|
|
|
name => $servername, |
28
|
|
|
|
|
|
|
data => $list_comp_data->{$servername} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
); |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 DESCRIPTION |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
This class represents a server in a Siebel Enterprise and it's related components. This class is meant to be instantied by a method from |
35
|
|
|
|
|
|
|
L<Siebel::Srvrmgr::ListParser::Output::ListComp> object. |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=cut |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head2 data |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
An hash reference with the original data used to create the object. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
has data => |
48
|
|
|
|
|
|
|
( isa => 'HashRef', is => 'ro', required => 1, reader => 'get_data' ); |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=pod |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 name |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
A string with the name of the server. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=cut |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
has name => ( isa => 'Str', is => 'ro', required => 1, reader => 'get_name' ); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=pod |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 comp_attribs |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
A array reference with the components attributes names |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
has 'comp_attribs' => ( |
69
|
|
|
|
|
|
|
is => 'ro', |
70
|
|
|
|
|
|
|
isa => 'ArrayRef', |
71
|
|
|
|
|
|
|
reader => 'get_comp_attribs' |
72
|
|
|
|
|
|
|
); |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=pod |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 METHODS |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 get_data |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Returns an hash reference from the C<data> attribute. |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head2 get_name |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
Returns an string from the C<name> attribute. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head2 store |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Stores the object data and methods in a serialized file. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Expects as a parameter a string the filename (or complete path). |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=cut |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
sub store { |
95
|
9
|
|
|
9
|
1
|
44
|
my ( $self, $filename ) = @_; |
96
|
9
|
|
|
|
|
107
|
nstore $self, $filename; |
97
|
|
|
|
|
|
|
} |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head2 get_comps |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
Returns an array reference with all components aliases available in the server. |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=cut |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
sub get_comps { |
106
|
2
|
|
|
2
|
1
|
8
|
my $self = shift; |
107
|
2
|
|
|
|
|
5
|
return [ keys( %{ $self->get_data() } ) ]; |
|
2
|
|
|
|
|
119
|
|
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=pod |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head2 get_comp |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Expects an string with the component alias. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Returns a L<Siebel::Srvrmgr::ListParser::Output::ListComp::Comp> object if the component exists in the server, otherwise returns C<undef>. |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=cut |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
sub get_comp { |
121
|
378
|
|
|
378
|
1
|
1467
|
my ( $self, $alias ) = @_; |
122
|
|
|
|
|
|
|
|
123
|
378
|
50
|
|
|
|
18355
|
if ( exists( $self->get_data()->{$alias} ) ) { |
124
|
378
|
|
|
|
|
18701
|
my $data_ref = $self->get_data->{$alias}; |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
# :TODO:09/19/2016 07:28:47 PM:: maybe move this mapping detail to the class would be wiser and allow changes easily |
127
|
|
|
|
|
|
|
return Siebel::Srvrmgr::ListParser::Output::ListComp::Comp->new( |
128
|
|
|
|
|
|
|
{ |
129
|
|
|
|
|
|
|
alias => $alias, |
130
|
|
|
|
|
|
|
name => $data_ref->{CC_NAME}, |
131
|
|
|
|
|
|
|
ct_alias => $data_ref->{CT_ALIAS}, |
132
|
|
|
|
|
|
|
cg_alias => $data_ref->{CG_ALIAS}, |
133
|
|
|
|
|
|
|
run_mode => $data_ref->{CC_RUNMODE}, |
134
|
|
|
|
|
|
|
disp_run_state => $data_ref->{CP_DISP_RUN_STATE}, |
135
|
|
|
|
|
|
|
start_mode => $data_ref->{CP_STARTMODE}, |
136
|
|
|
|
|
|
|
num_run_tasks => $data_ref->{CP_NUM_RUN_TASKS}, |
137
|
|
|
|
|
|
|
max_tasks => $data_ref->{CP_MAX_TASKS}, |
138
|
|
|
|
|
|
|
desc_text => $data_ref->{CC_DESC_TEXT}, |
139
|
|
|
|
|
|
|
start_datetime => $data_ref->{CP_START_TIME}, |
140
|
|
|
|
|
|
|
end_datetime => $data_ref->{CP_END_TIME}, |
141
|
|
|
|
|
|
|
status => $data_ref->{CP_STATUS}, |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
# :WORKAROUND:03-02-2015 03:32:57:: in most cases the value from Server Manager is undefined |
144
|
|
|
|
|
|
|
actv_mts_procs => $data_ref->{CP_ACTV_MTS_PROCS} || 0, |
145
|
|
|
|
|
|
|
incarn_no => $data_ref->{CC_INCARN_NO} || 0, |
146
|
378
|
|
100
|
|
|
27558
|
max_mts_procs => $data_ref->{CP_MAX_MTS_PROCS} || 0, |
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
147
|
|
|
|
|
|
|
} |
148
|
|
|
|
|
|
|
); |
149
|
|
|
|
|
|
|
} |
150
|
|
|
|
|
|
|
else { |
151
|
0
|
|
|
|
|
|
return; |
152
|
|
|
|
|
|
|
} |
153
|
|
|
|
|
|
|
} |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=pod |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
=head1 SEE ALSO |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=over |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=item * |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
L<Moose> |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=item * |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
L<namespace::autoclean> |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=item * |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
L<Siebel::Srvrmgr::ListParser::Output::ListComp::Comp> |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=back |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=head1 AUTHOR |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
Alceu Rodrigues de Freitas Junior, E<lt>arfreitas@cpan.orgE<gt>. |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
This software is copyright (c) 2012 of Alceu Rodrigues de Freitas Junior, E<lt>arfreitas@cpan.orgE<gt>. |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
This file is part of Siebel Monitoring Tools. |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
Siebel Monitoring Tools is free software: you can redistribute it and/or modify |
186
|
|
|
|
|
|
|
it under the terms of the GNU General Public License as published by |
187
|
|
|
|
|
|
|
the Free Software Foundation, either version 3 of the License, or |
188
|
|
|
|
|
|
|
(at your option) any later version. |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
Siebel Monitoring Tools is distributed in the hope that it will be useful, |
191
|
|
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
192
|
|
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
193
|
|
|
|
|
|
|
GNU General Public License for more details. |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License |
196
|
|
|
|
|
|
|
along with Siebel Monitoring Tools. If not, see L<http://www.gnu.org/licenses/>. |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
=cut |
199
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |