our
$runAfter
= [
"FusionInventory::Agent::Task::Inventory::OS::Generic"
];
sub
isInventoryEnabled {
return
$OSNAME
=~ /^aix$/ }
sub
doInventory {
my
$params
=
shift
;
my
$inventory
=
$params
->{inventory};
my
@tabOS
;
my
$OSName
;
my
$OSComment
;
my
$OSVersion
;
my
$OSLevel
;
chomp
(
$OSName
=`uname -s`);
chomp
(
$OSVersion
=`oslevel`);
chomp
(
$OSLevel
=`oslevel -r`);
@tabOS
=
split
(/-/,
$OSLevel
);
$OSComment
=
"Maintenance Level :"
.
$tabOS
[1];
$OSVersion
=~ s/(.0)*$//;
$inventory
->setHardware({
OSNAME
=>
"$OSName $OSVersion"
,
OSCOMMENTS
=>
$OSComment
,
OSVERSION
=>
$OSLevel
,
});
$inventory
->setOperatingSystem({
NAME
=>
"AIX"
,
VERSION
=>
$OSVersion
,
FULL_NAME
=>
"$OSName $OSVersion"
});
}
1;