line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::MacOS::Printers; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
66241796
|
use strict; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
93
|
|
4
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
81
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
419
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
150
|
|
7
|
1
|
|
|
1
|
|
431
|
use FusionInventory::Agent::Tools::MacOS; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
228
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub isEnabled { |
10
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
return |
13
|
0
|
|
0
|
|
|
|
!$params{no_category}->{printer} && |
14
|
|
|
|
|
|
|
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(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
|
0
|
|
|
|
|
|
$inventory->addEntry( |
30
|
|
|
|
|
|
|
section => 'PRINTERS', |
31
|
|
|
|
|
|
|
entry => { |
32
|
|
|
|
|
|
|
NAME => $printer, |
33
|
|
|
|
|
|
|
DRIVER => $info->{$printer}->{PPD}, |
34
|
|
|
|
|
|
|
PORT => $info->{$printer}->{URI}, |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |