line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::MacOS::Hostname; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
64626004
|
use strict; |
|
1
|
|
|
|
|
9
|
|
|
1
|
|
|
|
|
67
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
0
|
|
|
1
|
|
|
|
|
65
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
413
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
133
|
|
7
|
1
|
|
|
1
|
|
435
|
use FusionInventory::Agent::Tools::MacOS; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
136
|
|
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(logger => $logger); |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
my $hostname = |
22
|
|
|
|
|
|
|
$infos->{'Software'}->{'System Software Overview'}->{'Computer Name'}; |
23
|
|
|
|
|
|
|
|
24
|
0
|
0
|
|
|
|
|
$inventory->setHardware({ |
25
|
|
|
|
|
|
|
NAME => $hostname |
26
|
|
|
|
|
|
|
}) if $hostname; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |