line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::MacOS::Printers; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
87992167
|
use strict; |
|
1
|
|
|
|
|
19
|
|
|
1
|
|
|
|
|
92
|
|
4
|
1
|
|
|
1
|
|
9
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
120
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
1155
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
199
|
|
7
|
1
|
|
|
1
|
|
600
|
use FusionInventory::Agent::Tools::MacOS; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
233
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub isEnabled { |
10
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
return |
13
|
|
|
|
|
|
|
!$params{no_category}->{printer} && |
14
|
0
|
|
0
|
|
|
|
canRun('/usr/sbin/system_profiler'); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub doInventory { |
18
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
19
|
|
|
|
|
|
|
|
20
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
21
|
0
|
|
|
|
|
|
my $logger = $params{logger}; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
my $infos = getSystemProfilerInfos(type => 'SPPrintersDataType', logger => $logger); |
24
|
0
|
|
|
|
|
|
my $info = $infos->{Printers}; |
25
|
|
|
|
|
|
|
|
26
|
0
|
|
|
|
|
|
foreach my $printer (keys %$info) { |
27
|
0
|
0
|
|
|
|
|
next unless ref($info->{printer}) eq 'HASH'; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$inventory->addEntry( |
30
|
|
|
|
|
|
|
section => 'PRINTERS', |
31
|
|
|
|
|
|
|
entry => { |
32
|
|
|
|
|
|
|
NAME => $printer, |
33
|
|
|
|
|
|
|
DRIVER => $info->{$printer}->{PPD}, |
34
|
|
|
|
|
|
|
PORT => $info->{$printer}->{URI}, |
35
|
|
|
|
|
|
|
} |
36
|
0
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |