line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Generic::Dmidecode::Ports; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
119258913
|
use strict; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
87
|
|
4
|
1
|
|
|
1
|
|
10
|
use warnings; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
63
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
468
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
145
|
|
7
|
1
|
|
|
1
|
|
529
|
use FusionInventory::Agent::Tools::Generic; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
279
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub isEnabled { |
10
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
11
|
0
|
0
|
|
|
|
|
return 0 if $params{no_category}->{port}; |
12
|
0
|
|
|
|
|
|
return 1; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub doInventory { |
16
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
17
|
|
|
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
19
|
0
|
|
|
|
|
|
my $logger = $params{logger}; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
my $ports = _getPorts(logger => $logger); |
22
|
|
|
|
|
|
|
|
23
|
0
|
0
|
|
|
|
|
return unless $ports; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
foreach my $port (@$ports) { |
26
|
0
|
|
|
|
|
|
$inventory->addEntry( |
27
|
|
|
|
|
|
|
section => 'PORTS', |
28
|
|
|
|
|
|
|
entry => $port |
29
|
|
|
|
|
|
|
); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub _getPorts { |
34
|
0
|
|
|
0
|
|
|
my $infos = getDmidecodeInfos(@_); |
35
|
|
|
|
|
|
|
|
36
|
0
|
0
|
|
|
|
|
return unless $infos->{8}; |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
my $ports; |
39
|
0
|
|
|
|
|
|
foreach my $info (@{$infos->{8}}) { |
|
0
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
my $port = { |
41
|
|
|
|
|
|
|
CAPTION => $info->{'External Connector Type'}, |
42
|
|
|
|
|
|
|
DESCRIPTION => $info->{'Internal Connector Type'}, |
43
|
|
|
|
|
|
|
NAME => $info->{'Internal Reference Designator'}, |
44
|
|
|
|
|
|
|
TYPE => $info->{'Port Type'}, |
45
|
|
|
|
|
|
|
}; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
push @$ports, $port; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
0
|
|
|
|
|
|
return $ports; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
1; |