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.

VMware Vcenter seems not to work

Hello,

I've installed (with success) the Vmware_Vcenter plugins for OCS inventory but i've the message :  "No data available in table"

The files are there :

/usr/share/perl5/vendor_perl/Ocsinventory/Agent/Modules/Vmware.pm

/etc/ocsinventory/ocsinventory-server/plugins/vmware_vcenter.conf

/etc/ocsinventory/ocsinventory-server/perl/Apache/Ocsinventory/Plugins/Vmware_Vcenter/Map.pm
I've add the line (use Ocsinventory::Agent::Modules::Vmware; ) in /etc/ocsinventory-agent/modules.conf
 

my @auth_hashes = (
    {
       URL  => " URL ",
       AUTH_DIG     => " hash ",
    },
 );

curl -X POST -k -H 'Authorization: Basic hash' -i 'URL/rest/com/vmware/cis/session/'
reponse : http 200 OK so i assume my hash and URL are correct, maybe it lacks the "Basic" word in AUTH_DIG ?

in OCS Inventory NG plugins by (290 points)

6 Answers

+1 vote
Hi,

If you try to store the inventory on local store what is the result ? Does the file contain vmware informations ? Post result of this command => ocsinventory-agent --debug --local /tmp

Regards

Frank
by (90.4k points)
0 votes
I've tried to run it and the results are below, I assume it's just general information about VM / ESXi, get by the inventory and not the plugin

cat csrv-ocs01-2020-08-21-15-40-53.ocs | grep ware

      <SMANUFACTURER>VMware, Inc.</SMANUFACTURER>
      <SMODEL>VMware Virtual Platform</SMODEL>
      <SSN>VMware-42 2e ac 04 da 54 55 60-50 89 04 bd 5b c3 ac 53</SSN>
      <MANUFACTURER>VMware Virtual Machine Communication Interface</MANUFACTURER>
      <MANUFACTURER>VMware SVGA II Adapter</MANUFACTURER>
      <MANUFACTURER>VMware PCI bridge</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware PCI Express Root Port</MANUFACTURER>
      <MANUFACTURER>VMware SATA AHCI controller</MANUFACTURER>
      <MANUFACTURER>VMware PVSCSI SCSI Controller</MANUFACTURER>
      <MANUFACTURER>VMware VMXNET3 Ethernet Controller</MANUFACTURER>
      <MANUFACTURER>VMware VMXNET3 Ethernet Controller</MANUFACTURER>
      <VMSYSTEM>VMware</VMSYSTEM>
      <DESCRIPTION>VirtualPS/2 VMware VMMouse</DESCRIPTION>
      <DESCRIPTION>VirtualPS/2 VMware VMMouse</DESCRIPTION>
      <COMMENTS>Open Computer and Software Inventory Next Generation client</COMMENTS>
      <COMMENTS>Open Virtual Machine Tools for virtual machines hosted on VMware</COMMENTS>
      <COMMENTS>Firmware files used by the Linux kernel</COMMENTS>
      <NAME>linux-firmware</NAME>
      <COMMENTS>Open Computer and Software Inventory Next Generation client core componant</COMMENTS>
      <COMMENTS>Open Computer and Software Inventory Next Generation</COMMENTS>
      <COMMENTS>Hardware identification and configuration data</COMMENTS>
      <COMMENTS>TCG's Software Stack v1.2</COMMENTS>
      <MANUFACTURER>VMware</MANUFACTURER>
      <NAME>VMware SVGA II Adapter</NAME>

Edit : in the log file i've this line

[Wed Jan 27 10:49:42 2021][debug] Failed to load `/etc/ocsinventory/modules.conf': 0

After few researches, the JSON module for perl was missing.

The agent load correctly the module, and does the API request but i've still the message "No data available in table" in my WebUI.

The log message from the agent :

[Wed Jan 27 13:14:46 2021][debug] [vmware] Starting VMWare inventory plugin
[Wed Jan 27 13:14:46 2021][debug] [vmware] Auth OK
[Wed Jan 27 13:14:46 2021][debug] [vmware] Used url for api call : URL/rest/vcenter/datacenter
[Wed Jan 27 13:14:48 2021][debug] [vmware] Process info for datacenter : datacenter-2
[Wed Jan 27 13:14:48 2021][debug] [vmware] Used url for api call : URL/rest/vcenter/datacenter/datacenter-2
[Wed Jan 27 13:14:49 2021][debug] [vmware] Used url for api call : URL/rest/vcenter/datastore?filter.datacenters=datacenter-2
[Wed Jan 27 13:14:49 2021][debug] [vmware] Used url for api call : URL/rest/vcenter/datastore/datastore-10
[Wed Jan 27 13:14:49 2021][debug] [vmware] Used url for api call : URL/rest/vcenter/datastore/datastore-191
[Wed Jan 27 13:14:49 2021][debug] [vmware] Used url for api call : URL/rest/vcenter/datastore/datastore-36
[Wed Jan 27 13:14:49 2021][debug] [vmware] Used url for api call : URL/rest/vcenter/datastore/datastore-80
[Wed Jan 27 13:14:49 2021][debug] [vmware] Used url for api call : URL/rest/vcenter/network?filter.datacenters=datacenter-2
[Wed Jan 27 13:14:50 2021][debug] [vmware] Used url for api call : URL/rest/vcenter/folder?filter.datacenters=datacenter-2
[Wed Jan 27 13:14:50 2021][debug] [vmware] Used url for api call : URL/rest/vcenter/cluster?filter.datacenters=datacenter-2
by (290 points)
edited by
0 votes
Je progresse petit à petit mais je n'ai toujours rien sur l'interface Web : "No data available in table".

Quand je lance le scan en local : ocsinventory-agent --debug /tmp/

J'ai les informations sur mon vCenter (datacenter, network ...) qui arrivent dans le fichier de log :

tail  /var/log/ocsinventory-agent/ocsinventory-agent.log
    </VMWARE_DATASTORE>
    <VMWARE_DATASTORE>
      <CAPACITY>17950278942720</CAPACITY>
      <DATACENTER>datacenter-2</DATACENTER>
      <DATASTORE>datastore-36</DATASTORE>
      <FREE_SPACE>14629320261632</FREE_SPACE>
      <IS_ACCESSIBLE>true</IS_ACCESSIBLE>
[...]
by (290 points)
0 votes
le fichier Map.pm est correct ? C'est ce fichier qui permet la répartition des données dans les tables.
by (90.4k points)
0 votes
J'ai ça :

cat /etc/ocsinventory/ocsinventory-server/perl/Apache/Ocsinventory/Plugins/Vmware_Vcenter/Map.pm

###############################################################################
## OCSINVENTORY-NG
## Copyleft Gilles Dubois 2017
## Web : http://www.ocsinventory-ng.org
##
## This code is open source and may be copied and modified as long as the source
## code is always made freely available.
## Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt
################################################################################

package Apache::Ocsinventory::Plugins::Vmware_Vcenter::Map;

use strict;

use Apache::Ocsinventory::Map;
[...]

et ça :

cat /usr/share/perl5/vendor_perl/Apache/Ocsinventory/Map.pm

###############################################################################
## Copyright 2005-2016 OCSInventory-NG/OCSInventory-Server contributors.
## See the Contributors file for more details about them.
##
## This file is part of OCSInventory-NG/OCSInventory-ocsreports.
##
## OCSInventory-NG/OCSInventory-Server is free software: you can redistribute
## it and/or modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation, either version 2 of the License,
## or (at your option) any later version.
##
## OCSInventory-NG/OCSInventory-Server is distributed in the hope that it
## will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
## of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with OCSInventory-NG/OCSInventory-ocsreports. if not, write to the
## Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
## MA 02110-1301, USA.
################################################################################
package Apache::Ocsinventory::Map;

use strict;
[...]
by (290 points)
0 votes
Bon les infos sont montées, alors que je n'ai rien fait (entre le moment ou le plugin fonctionnait mais ne remontait pas les infos sur l'IHM et maintenant).

Par contre je n'ai aucune info sur les ressources pool, les vm et les cluster

Pour le cluster je n'ai qu'un Vcenter en standalone alors c'est surement normal.

J'ai cependant une question, est-il possible d'obtenir les versions firmware des ESXi/vCenter à partir de l'OCSinventory ou il faut passer par du PowerCli ?
by (290 points)
 
Powered by Question2Answer
...