line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::MacOS::Hostname; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
65279485
|
use strict; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
42
|
|
4
|
1
|
|
|
1
|
|
8
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
59
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
392
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
128
|
|
7
|
1
|
|
|
1
|
|
390
|
use FusionInventory::Agent::Tools::MacOS; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
130
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub isEnabled { |
10
|
0
|
|
|
0
|
0
|
|
return canRun('/usr/sbin/system_profiler'); |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub doInventory { |
14
|
0
|
|
|
0
|
0
|
|
my (%params) = @_; |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
my $inventory = $params{inventory}; |
17
|
0
|
|
|
|
|
|
my $logger = $params{logger}; |
18
|
|
|
|
|
|
|
|
19
|
0
|
|
|
|
|
|
my $infos = getSystemProfilerInfos(type => 'SPApplicationsDataType', logger => $logger); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $hostname = |
22
|
0
|
|
|
|
|
|
$infos->{'Software'}->{'System Software Overview'}->{'Computer Name'}; |
23
|
|
|
|
|
|
|
|
24
|
0
|
0
|
|
|
|
|
$inventory->setHardware({ |
25
|
|
|
|
|
|
|
NAME => $hostname |
26
|
|
|
|
|
|
|
}) if $hostname; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |