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