line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::Solaris::Controllers; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
94406554
|
use strict; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
52
|
|
4
|
1
|
|
|
1
|
|
11
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
71
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
396
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
320
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub isEnabled { |
9
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
10
|
0
|
0
|
|
|
|
|
return if $params{no_category}->{controller}; |
11
|
0
|
|
|
|
|
|
return canRun('cfgadm'); |
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
|
|
|
|
|
|
my $handle = getFileHandle( |
21
|
|
|
|
|
|
|
command => 'cfgadm -s cols=ap_id:type:info', |
22
|
|
|
|
|
|
|
logger => $logger, |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
0
|
0
|
|
|
|
|
return unless $handle; |
26
|
|
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
while (my $line = <$handle>) { |
28
|
0
|
0
|
|
|
|
|
next if $line =~ /^Ap_Id/; |
29
|
0
|
0
|
|
|
|
|
next unless $line =~ /^(\S+)\s+(\S+)\s+(\S+)/; |
30
|
0
|
|
|
|
|
|
my $name = $1; |
31
|
0
|
|
|
|
|
|
my $type = $2; |
32
|
0
|
|
|
|
|
|
my $manufacturer = $3; |
33
|
0
|
|
|
|
|
|
$inventory->addEntry( |
34
|
|
|
|
|
|
|
section => 'CONTROLLERS', |
35
|
|
|
|
|
|
|
entry => { |
36
|
|
|
|
|
|
|
NAME => $name, |
37
|
|
|
|
|
|
|
MANUFACTURER => $manufacturer, |
38
|
|
|
|
|
|
|
TYPE => $type, |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
} |
42
|
0
|
|
|
|
|
|
close $handle; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |