line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tivoli::Endpoints;
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our(@ISA, @EXPORT, $VERSION, $Fileparse_fstype, $Fileparse_igncase);
|
4
|
|
|
|
|
|
|
require Exporter;
|
5
|
|
|
|
|
|
|
@ISA = qw(Exporter);
|
6
|
|
|
|
|
|
|
@EXPORT = qw(ExecuteSys SubscrEP UnsubscrEP CheckEPinTMR);
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# Robert.Hase@sysmtec.de
|
9
|
|
|
|
|
|
|
# 07-2001
|
10
|
|
|
|
|
|
|
# thanks to Rosie
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
$VERSION = '0.02';
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
################################################################################################
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=pod
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 NAME
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
Tivoli::Endpoints - Perl Extension for Tivoli
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
use Tivoli::Endpoints;
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 VERSION
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
v0.02
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 License
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Copyright (c) 2001 Robert Hase.
|
34
|
|
|
|
|
|
|
All rights reserved.
|
35
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=over
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
This Package will handle about everything you may need for Endpoints.
|
42
|
|
|
|
|
|
|
If anything has been left out, please contact me at
|
43
|
|
|
|
|
|
|
tivoli.rhase@muc-net.de
|
44
|
|
|
|
|
|
|
so it can be added.
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=back
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head2 DETAILS
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
still in work
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 ROUTINES
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Description of Routines
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head3 ExecuteSys
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=over
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=item * DESCRIPTION
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Execute Unix Command with system
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=item * CALL
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
$Var = &ExecuteSys();
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=item * SAMPLE
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
$Var = &ExecuteSys('ls');
|
71
|
|
|
|
|
|
|
$Var = returncode from the Command
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=back
|
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub ExecuteSys
|
78
|
|
|
|
|
|
|
{
|
79
|
0
|
|
|
0
|
1
|
|
($p_cmd)=@_;
|
80
|
0
|
|
|
|
|
|
my ($rc) ;
|
81
|
0
|
|
|
|
|
|
$command = "$p_cmd 2>>/dev/null";
|
82
|
0
|
|
|
|
|
|
$rc=0xffff & system $command;
|
83
|
0
|
|
|
|
|
|
return $rc;
|
84
|
|
|
|
|
|
|
}
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=pod
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head3 SubscrEP
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=over
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=item * DESCRIPTION
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Subscribe Endpoint to ProfileManager
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=item * CALL
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
$Var = &SubscrEP();
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=item * SAMPLE
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
$Var = &SubscrEP("all-inv-HW_DIFF-ca-pm", "WBK0815");
|
103
|
|
|
|
|
|
|
$Var = 1 = ok, 0 = Failure
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=back
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=cut
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub SubscrEP
|
110
|
|
|
|
|
|
|
{
|
111
|
0
|
|
|
0
|
1
|
|
($p_pm, $p_ep)=@_;
|
112
|
0
|
|
|
|
|
|
$l_cmd="wsub \@ProfileManager:$p_pm \@Endpoint:$p_ep";
|
113
|
0
|
|
|
|
|
|
$l_rc=&ExecuteSys ($l_cmd);
|
114
|
0
|
0
|
|
|
|
|
if ($l_rc) { return(0); }
|
|
0
|
|
|
|
|
|
|
115
|
0
|
|
|
|
|
|
return(1);
|
116
|
|
|
|
|
|
|
}
|
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=pod
|
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head3 UnsubscrEP
|
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=over
|
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=item * DESCRIPTION
|
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Unsubscribe Endpoint from ProfileManager
|
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=item * CALL
|
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
$Var = &UnsubscrEP();
|
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=item * SAMPLE
|
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
$Var = &UnsubscrEP("all-inv-HW_DIFF-ca-pm", "WBK0815");
|
135
|
|
|
|
|
|
|
$Var = 1 = ok, 0 = Failure
|
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=back
|
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=cut
|
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
sub UnsubscrEP
|
142
|
|
|
|
|
|
|
{
|
143
|
0
|
|
|
0
|
1
|
|
($p_pm, $p_ep)=@_;
|
144
|
0
|
|
|
|
|
|
$l_cmd="wunsub \@ProfileManager:$p_pm \@Endpoint:$p_ep";
|
145
|
0
|
|
|
|
|
|
$l_rc=&ExecuteSys ($l_cmd);
|
146
|
0
|
0
|
|
|
|
|
if ($l_rc) { return(0); }
|
|
0
|
|
|
|
|
|
|
147
|
0
|
|
|
|
|
|
return(1);
|
148
|
|
|
|
|
|
|
}
|
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=pod
|
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head3 CheckEPinTMR
|
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=over
|
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=item * DESCRIPTION
|
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
Check, if Endpoint in TMR
|
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=item * CALL
|
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
$Var = &CheckEPinTMR();
|
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
=item * SAMPLE
|
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
$Var = &CheckEPinTMR(""WBK0815");
|
167
|
|
|
|
|
|
|
$Var = 1 = ok, 0 = Failure
|
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
=back
|
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=cut
|
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
sub CheckEPinTMR
|
174
|
|
|
|
|
|
|
{
|
175
|
0
|
|
|
0
|
1
|
|
($p_ep)=@_;
|
176
|
0
|
|
|
|
|
|
$l_erg=0;
|
177
|
0
|
|
|
|
|
|
$l_cmd="wep $p_ep > /dev/null 2>&1";
|
178
|
0
|
|
|
|
|
|
$rc=0xffff & system $l_cmd;
|
179
|
0
|
0
|
|
|
|
|
if ( $rc == 0 ) { $l_erg=1; }
|
|
0
|
|
|
|
|
|
|
180
|
0
|
|
|
|
|
|
return $l_erg;
|
181
|
|
|
|
|
|
|
}
|
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=pod
|
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=head2 Plattforms and Requirements
|
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
=over
|
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
Supported Plattforms and Requirements
|
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=item * Plattforms
|
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
tested on:
|
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
- aix4-r1 (AIX 4.3)
|
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
=back
|
198
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
=item * Requirements
|
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
requires Perl v5 or higher
|
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
=back
|
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
=head2 HISTORY
|
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
VERSION DATE AUTHOR WORK
|
208
|
|
|
|
|
|
|
----------------------------------------------------
|
209
|
|
|
|
|
|
|
0.01 2001-07-06 RHase created
|
210
|
|
|
|
|
|
|
0.01 2001-07-09 RMahner ExecuteSys
|
211
|
|
|
|
|
|
|
0.01 2001-07-09 RMahner SubscrEP
|
212
|
|
|
|
|
|
|
0.01 2001-07-09 RMahner UnsubscrEP
|
213
|
|
|
|
|
|
|
0.01 2001-07-09 RMahner CheckEPinTMR
|
214
|
|
|
|
|
|
|
0.02 2001-08-04 RHase POD-Doku added
|
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=head1 AUTHOR
|
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
Robert Hase
|
219
|
|
|
|
|
|
|
ID : RHASE
|
220
|
|
|
|
|
|
|
eMail : Tivoli.RHase@Muc-Net.de
|
221
|
|
|
|
|
|
|
Web : http://www.Muc-Net.de
|
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
=head1 SEE ALSO
|
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
CPAN
|
226
|
|
|
|
|
|
|
http://www.perl.com
|
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
=cut
|
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
###############################################################################################
|
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
1;
|