our
$runAfter
= [
"FusionInventory::Agent::Task::Inventory::Generic"
];
sub
isEnabled {
return
$OSNAME
eq
'solaris'
;
}
sub
doInventory {
my
(
%params
) =
@_
;
my
$inventory
=
$params
{inventory};
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;