Display UUID value in the Hardware table
OCS Mac agent does not provide the UUID value of the machine in the Hardware table so far. Maybe it should be provided via the CPU.pm module.
Whiteboard
Here is the proposed modified code:
-------
package Ocsinventory:
use strict;
sub check {
return(undef) unless -r '/usr/sbin/
return(undef) unless can_load(
return 1;
}
sub run {
my $params = shift;
my $common = $params->{common};
# create sysprofile obj. Return undef unless we get a return value
my $profile = Mac::SysProfile
my $data = $profile-
return(undef) unless(ref($data) eq 'ARRAY');
my $h = $data->[0];
######### CPU
my $processort = $h->{'processor
my $processorn = $h->{'number_
my $processors = $h->{'current_
my $uuid = $h->{'platform_
chomp($uuid);
$uuid =~ s/\s+$//g;
# lamp spits out an sql error if there is something other than an int (MHZ) here....
if($processors =~ /GHz$/){
# French Mac returns 2,60 Ghz instead of
# 2.60 Ghz :D
}
if($processors =~ /MHz$/){
}
### mem convert it to meg's if it comes back in gig's
my $mem = $h->{'physical_
if($mem =~ /GB$/){
$mem =~ s/\sGB$//;
$mem = ($mem * 1024);
}
if($mem =~ /MB$/){
$mem =~ s/\sMB$//;
}
$common-
PROCESSORT => $processort,
PROCESSORN => $processorn,
PROCESSORS => $processors,
MEMORY => $mem,
UUID => $uuid,
});
}
1;