Skip to content

Commit

Permalink
feature(esx): servicetag & assettag support update
Browse files Browse the repository at this point in the history
Support 2 ServiceTags case to cover chassis & lame board S/N inventory
Updated AssetTag support
  • Loading branch information
g-bougard committed Sep 12, 2018
1 parent 426ce5f commit 3081521
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
4 changes: 4 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ deploy:
* not p2p file parts are now cleaned up after job success if retention duration
is null

esx:
* Support 2 ServiceTags case to cover chassis & lame board S/N inventory
* Updated AssetTag support

maintenance:
* bump Maintenance task version to 1.1
* disable Maintenance task if no maintenance module could be used
Expand Down
31 changes: 18 additions & 13 deletions lib/FusionInventory/Agent/SOAP/VMware/Host.pm
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,36 @@ sub getBiosInfo {
my $hardware = $self->{hash}[0]{hardware};
my $biosInfo = $hardware->{biosInfo};
my $systemInfo = $hardware->{systemInfo};
my $ssn;

return unless ref($biosInfo) eq 'HASH';

my $identifierValue;
my $bios = {
BDATE => $biosInfo->{releaseDate},
BVERSION => $biosInfo->{biosVersion},
SMODEL => $systemInfo->{model},
SMANUFACTURER => $systemInfo->{vendor}
};

if (ref($systemInfo->{otherIdentifyingInfo}) eq 'HASH') {
$identifierValue = $systemInfo->{otherIdentifyingInfo}->{identifierValue};
$bios->{ASSETTAG} = $systemInfo->{otherIdentifyingInfo}->{identifierValue};
}
elsif (ref($systemInfo->{otherIdentifyingInfo}) eq 'ARRAY') {
foreach (@{$systemInfo->{otherIdentifyingInfo}}) {
if ($_->{identifierType}->{key} eq 'ServiceTag') {
$ssn = $_->{identifierValue};
last;
# In the case we found more than one ServiceTag, assume there will be
# only two, the first being the chassis S/N, the second the system S/N
# This cover the case where the second is the lame board S/N
if ($bios->{SSN}) {
$bios->{MSN} = $bios->{SSN};
}
$bios->{SSN} = $_->{identifierValue};
} elsif ($_->{identifierType}->{key} eq 'AssetTag') {
$bios->{ASSETTAG} = $_->{identifierValue};
}
}
}

return {
BDATE => $biosInfo->{releaseDate},
BVERSION => $biosInfo->{biosVersion},
SMODEL => $systemInfo->{model},
SMANUFACTURER => $systemInfo->{vendor},
ASSETTAG => $identifierValue,
SSN => $ssn
};
return $bios;
}

sub getHardwareInfo {
Expand Down

0 comments on commit 3081521

Please sign in to comment.