line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::AIX::Modems; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
106231653
|
use strict; |
|
2
|
|
|
|
|
16
|
|
|
2
|
|
|
|
|
101
|
|
4
|
2
|
|
|
2
|
|
17
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
114
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
1644
|
use FusionInventory::Agent::Tools; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
423
|
|
7
|
2
|
|
|
2
|
|
1194
|
use FusionInventory::Agent::Tools::AIX; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
575
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub isEnabled { |
10
|
0
|
|
|
0
|
0
|
0
|
my (%params) = @_; |
11
|
0
|
0
|
|
|
|
0
|
return 0 if $params{no_category}->{modem}; |
12
|
0
|
|
|
|
|
0
|
return canRun('lsdev'); |
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
|
foreach my $modem (_getModems( |
22
|
|
|
|
|
|
|
logger => $logger, |
23
|
|
|
|
|
|
|
)) { |
24
|
0
|
|
|
|
|
0
|
$inventory->addEntry( |
25
|
|
|
|
|
|
|
section => 'MODEMS', |
26
|
|
|
|
|
|
|
entry => $modem, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub _getModems { |
32
|
7
|
|
|
7
|
|
17107
|
my @adapters = getAdaptersFromLsdev(@_); |
33
|
|
|
|
|
|
|
|
34
|
7
|
|
|
|
|
67
|
my @modems; |
35
|
7
|
|
|
|
|
14
|
foreach my $adapter (@adapters) { |
36
|
82
|
50
|
|
|
|
238
|
next unless $adapter->{DESCRIPTION} =~ /modem/i; |
37
|
|
|
|
|
|
|
push @modems, { |
38
|
|
|
|
|
|
|
NAME => $adapter->{NAME}, |
39
|
|
|
|
|
|
|
DESCRIPTION => $adapter->{DESCRIPTION}, |
40
|
0
|
|
|
|
|
0
|
}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
7
|
|
|
|
|
21
|
return @modems; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |