line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FusionInventory::Agent::Task::Inventory::HPUX::Bios; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
83976696
|
use strict; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
36
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
51
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
364
|
use FusionInventory::Agent::Tools; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
131
|
|
7
|
1
|
|
|
1
|
|
382
|
use FusionInventory::Agent::Tools::HPUX; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
252
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub isEnabled { |
10
|
0
|
|
|
0
|
0
|
|
return canRun('model'); |
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 $model = getFirstLine(command => 'model'); |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
my ($version, $serial, $uuid); |
22
|
0
|
0
|
|
|
|
|
if (canRun('/usr/contrib/bin/machinfo')) { |
23
|
0
|
|
|
|
|
|
my $info = getInfoFromMachinfo(logger => $logger); |
24
|
0
|
|
|
|
|
|
$version = $info->{'Firmware info'}->{'firmware revision'}; |
25
|
0
|
|
|
|
|
|
$serial = $info->{'Platform info'}->{'machine serial number'}; |
26
|
0
|
|
|
|
|
|
$uuid = uc($info->{'Platform info'}->{'machine id number'}); |
27
|
|
|
|
|
|
|
} else { |
28
|
0
|
|
|
|
|
|
my $handle = getFileHandle( |
29
|
|
|
|
|
|
|
command => "echo 'sc product cpu;il' | /usr/sbin/cstm", |
30
|
|
|
|
|
|
|
logger => $logger |
31
|
|
|
|
|
|
|
); |
32
|
0
|
|
|
|
|
|
while (my $line = <$handle>) { |
33
|
0
|
0
|
|
|
|
|
next unless $line =~ /PDC Firmware/; |
34
|
0
|
0
|
|
|
|
|
next unless $line =~ /Revision:\s+(\S+)/; |
35
|
0
|
|
|
|
|
|
$version = "PDC $1"; |
36
|
|
|
|
|
|
|
} |
37
|
0
|
|
|
|
|
|
close $handle; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
$serial = getFirstMatch( |
40
|
|
|
|
|
|
|
command => "echo 'sc product system;il' | /usr/sbin/cstm", |
41
|
|
|
|
|
|
|
pattern => qr/^System Serial Number:\s+: (\S+)/ |
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
|
|
|
$inventory->setBios({ |
46
|
|
|
|
|
|
|
BVERSION => $version, |
47
|
|
|
|
|
|
|
BMANUFACTURER => "HP", |
48
|
|
|
|
|
|
|
SMANUFACTURER => "HP", |
49
|
|
|
|
|
|
|
SMODEL => $model, |
50
|
|
|
|
|
|
|
SSN => $serial, |
51
|
|
|
|
|
|
|
}); |
52
|
0
|
|
|
|
|
|
$inventory->setHardware({ |
53
|
|
|
|
|
|
|
UUID => $uuid |
54
|
|
|
|
|
|
|
}); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |