Skip to content

Commit

Permalink
move the BIOS code in AIX.pm
Browse files Browse the repository at this point in the history
This will simplify the LPAR related code.
  • Loading branch information
Gonéri Le Bouder committed Jan 31, 2013
1 parent 54446df commit 61a64d6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 48 deletions.
28 changes: 27 additions & 1 deletion lib/FusionInventory/Agent/Task/Inventory/Input/AIX.pm
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,35 @@ sub doInventory {
my $vmid;
my $vmname;

my @infos = getLsvpdInfos(logger => $logger);

my $bversion;
my $system = first { $_->{DS} eq 'System Firmware' } @infos;
$bversion = $system->{RM} if $system;

my $platform = first { $_->{DS} eq 'Platform Firmware' } @infos;
$bversion .= "(Firmware : $platform->{RM})" if $platform;

my $vpd = first { $_->{DS} eq 'System VPD' } @infos;

my $unameL = getFirstLine(command => 'uname -L');
# LPAR partition can access the serial number of the
# host compuer.
# If we are such system, the serial number must be store in
# the VMHOSTSERIAL key.
if ($unameL =~ /^(\d+)\s+(\S+)/) {
$vmsystem = "AIX_LPAR";
$vmid = $1;
$vmname = $2;
$vmhostserial = $vpd->{SE};
} else {
$inventory->setBios({
BMANUFACTURER => 'IBM',
SMANUFACTURER => 'IBM',
SMODEL => $vpd->{TM},
SSN => $vpd->{SE},
BVERSION => $bersion,
});
}

$inventory->setHardware({
Expand All @@ -46,14 +70,16 @@ sub doInventory {
OSCOMMENTS => $OSComment,
VMID => $vmid,
VMNAME => $vmname,
VMSYSTEM => $vmsystem
VMSYSTEM => $vmsystem,
VMHOSTSERIAL => $vmhostserial
});

$inventory->setOperatingSystem({
NAME => "AIX",
VERSION => $OSVersion,
FULL_NAME => "$OSName $OSVersion"
});

}

1;
47 changes: 0 additions & 47 deletions lib/FusionInventory/Agent/Task/Inventory/Input/AIX/Bios.pm

This file was deleted.

0 comments on commit 61a64d6

Please sign in to comment.