Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.12.3 available

The official documentation can be found on https://wiki.ocsinventory-ng.org. Read it before asking your question.

Erro ao executar o ocsinventory-agent

Boa Tarde,
Instalei o Ocs Inventory em docker e o agente nessa maquina onde consta o docker, porém ao executar o comando sudo ocsinventory-agent estou recebendo o erro abaixo.

alguem pode me ajudar a resolver?

Odd number of elements in anonymous hash at /usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic/Users.pm line 109.

Odd number of elements in anonymous hash at /usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic/Users.pm line 109.

Odd number of elements in anonymous hash at /usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic/Users.pm line 109.

[info] [download] Beginning work. I am 534278.

[info] [download] No more package to download.
in OCS Inventory NG agent for Unix by (120 points)

2 Answers

0 votes
Hi, please write only in English or French... Best regards
by (32.6k points)
0 votes

Claro!

O problema ocorre por causa do certificado SSL que vc está usando. O erro informa que ele espera uma hash par,
é preciso alterar a forma de entrada do @members, e coloquei uma condicional ajudar a tratar o problema, coloquei print para vc poder visualizar o retorno.
Pode demorar um pouco, mas vai dar certo. 

Sudo nano /usr/share/perl5/Ocsinventory/Agent/Backend/OS/Generic/Users.pm

Altere essa parte para:

sub _getLocalGroups {

     open(my $fh, '<:encoding(UTF-8)', "/etc/group") or warn;
     my @groupinfo=<$fh>;
     close($fh);

     my @groups;

     foreach my $line (@groupinfo){
         next if $line =~ /^#/;
         chomp $line;
         my ($name, undef, $gid, $members) = split(/:/, $line);

         next unless $members;
         my @members = split(/,/, $members);
         use Data::Dumper;

         print "Group ID: $gid\n";
         print "Group Name: $name\n";
         print "Members: ", Dumper(\@members), "\n";

     if (@members) {
         push @groups, {
             ID     => $gid,
             NAME   => $name,
             MEMBER => \@members,
         };
      }
      }

     return @groups;

}
 

by (180 points)
 
Powered by Question2Answer
...