source: ocsinventory-agent/trunk/fuentes/lib/Ocsinventory/Agent/Backend/OS/HPUX/Bios.pm @ 468

Last change on this file since 468 was 468, checked in by mabarracus, 4 years ago

Copyt trusty code

File size: 1.2 KB
Line 
1package Ocsinventory::Agent::Backend::OS::HPUX::Bios;
2use strict;
3
4###
5# Version 1.1
6# Correction of Bug n 522774
7#
8# thanks to Marty Riedling for this correction
9#
10###
11
12sub check { $^O =~ /hpux/ }
13
14sub run { 
15  my $params = shift;
16  my $common = $params->{common};
17
18  my $BiosVersion;
19  my $BiosDate;
20  my $SystemModel;
21  my $SystemSerial;
22 
23 
24  $SystemModel=`model`;
25  if ( can_run ("machinfo") )
26  {
27     foreach ( `machinfo` )
28     {
29        if ( /Firmware\s+revision\s?[:=]\s+(\S+)/ )
30        {
31           $BiosVersion=$1;
32        }
33        if ( /achine\s+serial\s+number\s?[:=]\s+(\S+)/ )
34        {
35                $SystemSerial=$1;
36        }
37     }
38  }
39  else
40  {
41     for ( `echo 'sc product cpu;il' | /usr/sbin/cstm | grep "PDC Firmware"` ) 
42     {
43        if ( /Revision:\s+(\S+)/ ) 
44        {
45             $BiosVersion="PDC $1";
46        }
47     }
48     for ( `echo 'sc product system;il' | /usr/sbin/cstm | grep "System Serial Number"` ) 
49     {
50        if ( /:\s+(\w+)/ ) 
51        {
52           $SystemSerial=$1;
53        }
54     }
55  }
56
57  $common->setBios ({
58      BVERSION => $BiosVersion,
59      BDATE => $BiosDate,
60      BMANUFACTURER => "HP",
61      SMANUFACTURER => "HP",
62      SMODEL => $SystemModel,
63      SSN => $SystemSerial,
64    });
65}
66
671;
Note: See TracBrowser for help on using the repository browser.