line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Tools::AIX; |
2
|
|
|
|
|
|
|
|
3
|
17
|
|
|
17
|
|
5442795
|
use strict; |
|
17
|
|
|
|
|
29
|
|
|
17
|
|
|
|
|
403
|
|
4
|
17
|
|
|
17
|
|
59
|
use warnings; |
|
17
|
|
|
|
|
21
|
|
|
17
|
|
|
|
|
394
|
|
5
|
17
|
|
|
17
|
|
51
|
use base 'Exporter'; |
|
17
|
|
|
|
|
49
|
|
|
17
|
|
|
|
|
1233
|
|
6
|
|
|
|
|
|
|
|
7
|
17
|
|
|
17
|
|
441
|
use English qw(-no_match_vars); |
|
17
|
|
|
|
|
2473
|
|
|
17
|
|
|
|
|
131
|
|
8
|
|
|
|
|
|
|
|
9
|
17
|
|
|
17
|
|
5733
|
use FusionInventory::Agent::Tools; |
|
17
|
|
|
|
|
26
|
|
|
17
|
|
|
|
|
1999
|
|
10
|
17
|
|
|
17
|
|
63
|
use Memoize; |
|
17
|
|
|
|
|
21
|
|
|
17
|
|
|
|
|
5051
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our @EXPORT = qw( |
13
|
|
|
|
|
|
|
getLsvpdInfos |
14
|
|
|
|
|
|
|
getAdaptersFromLsdev |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
memoize('getLsvpdInfos'); |
18
|
|
|
|
|
|
|
memoize('getAdaptersFromLsdev'); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub getLsvpdInfos { |
21
|
|
|
|
|
|
|
my (%params) = ( |
22
|
|
|
|
|
|
|
command => 'lsvpd', |
23
|
|
|
|
|
|
|
@_ |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $handle = getFileHandle(%params); |
27
|
|
|
|
|
|
|
return unless $handle; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
my @devices; |
30
|
|
|
|
|
|
|
my $device; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# skip first lines |
33
|
|
|
|
|
|
|
while (my $line = <$handle>) { |
34
|
|
|
|
|
|
|
last if $line =~ /^\*FC \?+/; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
while (my $line = <$handle>) { |
38
|
|
|
|
|
|
|
if ($line =~ /^\*FC \?+/) { |
39
|
|
|
|
|
|
|
# block delimiter |
40
|
|
|
|
|
|
|
push @devices, $device; |
41
|
|
|
|
|
|
|
undef $device; |
42
|
|
|
|
|
|
|
next; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
chomp $line; |
46
|
|
|
|
|
|
|
next unless $line =~ /^\* ([A-Z]{2}) \s+ (.*\S)/x; |
47
|
|
|
|
|
|
|
$device->{$1} = $2; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
close $handle; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
# last device |
52
|
|
|
|
|
|
|
push @devices, $device; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
return @devices; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub getAdaptersFromLsdev { |
58
|
|
|
|
|
|
|
my (%params) = ( |
59
|
|
|
|
|
|
|
command => 'lsdev -Cc adapter -F "name:type:description"', |
60
|
|
|
|
|
|
|
@_ |
61
|
|
|
|
|
|
|
); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
my $handle = getFileHandle(%params); |
64
|
|
|
|
|
|
|
return unless $handle; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
my @adapters; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
while (my $line = <$handle>) { |
69
|
|
|
|
|
|
|
chomp $line; |
70
|
|
|
|
|
|
|
my @info = split(/:/, $line); |
71
|
|
|
|
|
|
|
push @adapters, { |
72
|
|
|
|
|
|
|
NAME => $info[0], |
73
|
|
|
|
|
|
|
TYPE => $info[1], |
74
|
|
|
|
|
|
|
DESCRIPTION => $info[2] |
75
|
|
|
|
|
|
|
}; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
close $handle; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
return @adapters; |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
1; |
83
|
|
|
|
|
|
|
__END__ |