The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

use strict;
use English qw(-no_match_vars);
our $runAfter = ["FusionInventory::Agent::Task::Inventory::Generic"];
sub isEnabled {
return $OSNAME eq 'solaris';
}
sub doInventory {
my (%params) = @_;
my $inventory = $params{inventory};
# Operating system informations
my $info = getReleaseInfo();
my $kernelArch = getFirstLine(command => 'arch -k');
my $kernelVersion = getFirstLine(command => 'uname -v');
my $proct = getFirstLine(command => 'uname -p');
my $platform = getFirstLine(command => 'uname -i');
my $hostid = getFirstLine(command => 'hostid');
my $description = "$platform($kernelArch)/$proct HostID=$hostid";
$inventory->setHardware({
OSNAME => "Solaris",
OSVERSION => $info->{version},
OSCOMMENTS => $info->{subversion},
DESCRIPTION => $description
});
$inventory->setOperatingSystem({
NAME => "Solaris",
HOSTID => $hostid,
FULL_NAME => $info->{fullname},
VERSION => $info->{version},
SERVICE_PACK => $info->{subversion},
KERNEL_VERSION => $kernelVersion
});
}
1;