line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::HPUX::Slots; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
72584879
|
use strict; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
71
|
|
4
|
1
|
|
|
1
|
|
10
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
58
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
404
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
282
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub isEnabled { |
9
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
10
|
0
|
0
|
|
|
|
|
return 0 if $params{no_category}->{slot}; |
11
|
0
|
|
|
|
|
|
return canRun('ioscan'); |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub doInventory { |
15
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
16
|
|
|
|
|
|
|
|
17
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
18
|
0
|
|
|
|
|
|
my $logger = $params{logger}; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
foreach my $type (qw/ioa ba/) { |
21
|
0
|
|
|
|
|
|
foreach my $slot (_getSlots( |
22
|
|
|
|
|
|
|
command => "ioscan -kFC $type", |
23
|
|
|
|
|
|
|
logger => $logger |
24
|
|
|
|
|
|
|
)) { |
25
|
0
|
|
|
|
|
|
$inventory->addEntry( |
26
|
|
|
|
|
|
|
section => 'SLOTS', |
27
|
|
|
|
|
|
|
entry => $slot |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub _getSlots { |
34
|
0
|
|
|
0
|
|
|
my $handle = getFileHandle(@_); |
35
|
0
|
0
|
|
|
|
|
return unless $handle; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
my @slots; |
38
|
0
|
|
|
|
|
|
while (my $line = <$handle>) { |
39
|
0
|
|
|
|
|
|
my @info = split(/:/, $line); |
40
|
0
|
|
|
|
|
|
push @slots, { |
41
|
|
|
|
|
|
|
DESIGNATION => $info[17], |
42
|
|
|
|
|
|
|
}; |
43
|
|
|
|
|
|
|
} |
44
|
0
|
|
|
|
|
|
close $handle; |
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
return @slots; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |