cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discovery and inventory information are necessary for FlexNet Manager Suite to perform license consumption calculations. For collecting inventory, we recommend that you deploy one or more inventory beacons on your network and use supported inventory collection methods. Each inventory beacon deployed collects discovery and inventory information from the devices within its assigned subnet and sends this information to FlexNet Manager Suite.

To collect VMware inventory, inventory beacons require a network connection to the target VMware vCenter or ESX servers within its assigned subnet. This may not be possible in secure environments (like VMware servers secured by firewalls) – you may not be able to establish a network connection between each installed inventory beacon and the VMware servers within its assigned subnet, or you may not be able to install inventory beacons at all. Flexera offers a stand-alone VMware inventory collection agent for such environments that can be installed on a Windows server.

How the stand-alone VMware inventory agent works

The stand-alone VMware inventory agent remotely collects VMware (ESX or vCenter) inventory when you cannot use the standard inventory collection methods recommended by Flexera. You can deploy the agent on any computer with Windows desktop (Windows 7 or higher) or server (2008 or 2012) edition.

The agent can collect inventory from individual VMware ESX servers but works more efficiently with VMware vCenter servers, where it collects inventory for all VMware ESX servers registered with the target VMware vCenter server. In a clustered environment, the agent can collect VMware inventory for the entire VMware cluster through the target VMware vCenter server. The stand-alone agent saves the collected VMware inventory information (as .ndi files) to a specified location. You can then export the collected data to FlexNet Manager Suite to perform license consumption calculations.

Collecting inventory

To collect VMware inventory, the agent needs credentials for an account with read access to the VMware SDK URL on each of the target VMware servers. After configuring the agent with the details of the target VMware servers, the agent collects VMware inventory using API calls (see the “API Calls for VMware Inventory Collection” section below for details). The collected information is saved to a configured location and can be uploaded to FlexNet Manager Suite for license consumption calculations.

How to collect VMware inventory through the stand-alone VMware inventory agent

To collect VMware inventory through the stand-alone VMware inventory agent, complete the following steps:

VMWareAgent.png

1. Verify the prerequisites

Prerequisites for inventory collection using the stand-alone VMware inventory agent:

  • A VMware vSphere/vCenter/ESXi server, supporting versions from 5.0 to 6.7 inclusive.
    note blue light.pngNote: Inventory is not possible on the free license versions of ESXi.
  • The following software products are required on the server where the agent is to be deployed:
    • Windows desktop (Windows 7 or higher) or Server (2008 or 2012) edition
    • Microsoft .NET Framework version 4.0 or later.
  • Network access to the target VMware vCenter or ESX hosts.
  • An account with read access to the VMware SDK URL is required on each target vCenter or ESX host.

 

2. Deploy the inventory agent

The stand-alone VMware inventory agent is shipped as a zip archive. To deploy the agent:

A. Create a folder (for example, VMwareInventory) on the Windows desktop or your preferred location.

B. Extract the contents of the Flexera-supplied stand-alone inventory agent file FNMS-VMware-Scanner.zip into this folder (see zip file attached).

C. Using Windows Explorer, create a folder to save the collected inventory information (for example, C:\Inventories\). You should add this path to the OutputDir parameter in the esxquery.ini file.

 

3. Configure the inventory agent

To enable the stand-alone VMware inventory agent to collect inventory from target VMware servers, register every target VMware server with the agent, and record the VMware server name in the esxquery.ini file. Follow these steps to configure the agent:

A. Launch the Windows command prompt with the "Run as administrator" option enabled on the computer where you deployed the agent. Locate the folder you created to house VMware inventory (VMwareInventory in this example).

B. Invoke the agent by using the command:

..\VMwareInventory> esxquery 

The agent should display a list of available options:

server Query specified server
-a Query all configured servers
-l List configured servers and credentials
-s Set logon credentials for server
-d Delete logon credentials for server
-c Use existing logon session cookie
-f Set VMware license flag for server

 

C. After running the agent the first time, you can use the following command to list any previously-targeted VMware servers that are still registered with the agent:

esxquery.exe -l

D. If any undesired VMware servers are registered with the agent, use the following command with the name of the VMware server whose registration you want deleted, where <server name> is the VMware server name.

esxquery.exe -d <server name>

E. Use the following command to register a target VMware server with the stand-alone VMware inventory agent, where <server name> is the name of the target VMware server to be registered with the agent.

The agent will collect inventory only from the VMware servers registered with it.

esxquery.exe -s <server name>

 The agent prompts you to enter the credentials for this server.

F. Enter the credentials for the account with read access to the VMware SDK URL <https://<server name>/sdk>> created on this VMware server.

G. Repeat step E for each of the target VMware servers. The agent records each server name with its username and encrypted password in the esxquery.ini file in the VMwareInventory folder.

H. Set the OutputDir parameter to the path where you want the agent to store the collected inventory files.

Example

The following code example sets the output directory to the .\Inventories sub-folder under the VMwareInventory folder. The example shows how two VMware servers (server1 and server2) are recorded in the esxquery.ini file.

[Global] OutputDir=.\Inventories
[server1] Username=<domain\user name> Password=CtCi3795PXgxC3W8W7gdSg==
[server2] Username=<domain\user name> Password=EEfoiY3pmz0xC3W8W7gdSg==

The esxquery.exe tool encrypts the password automatically, before saving it to the esxquery.ini file.

I. Use the following command to review the list of VMware servers registered with the stand-alone agent:

esxquery.exe -l

Your agent is now ready to collect inventory from the target VMware servers.

4. Collect VMware inventory

When you have registered all target VMware servers with the stand-alone VMware inventory agent, you can run the agent to collect VMware inventory from the registered VMware servers.

A. Use the following command to run the stand-alone VMware inventory agent:

esxquery.exe -a
  • The agent executes, collects inventory from each of the servers listed in the esxquery.ini file, and saves the inventory files (.ndi) in the output folder specified in the esxquery.ini file.
  • The agent runs and displays inventory success messages.

The following code shows an example output:

C:\Flexera\VCenter Query>esxquery.exe -a
servername: found VMware vCenter Server v4.1.0
servername: inventory generated successfully

B. Using Windows Explorer, navigate to the output folder (C:\VMwareInventory\Inventories). You should see a .ndi file for each of the target ESX servers. Each .ndi file contains inventory for a target ESX server and all the virtual machines registered with it.

note blue light.pngNote: The stand-alone VMware inventory agent also collects inventory for the virtual machines switched off during the inventory collection process.

 

5. Export inventory to FlexNet Manager Suite

FlexNet Manager Suite’s license consumption calculation process requires the .ndi files collected to calculate your VMware license position.

  • If you have installed FlexNet Beacon, you can manually transfer the collected inventory (.ndi) files to the Incoming\Inventories folder. The FlexNet Beacon uploads the inventory to FlexNet Manager Suite.
  • If you have not installed any inventory beacons, you can use any third-party methods to export the imported inventory to the C:\ProgramData\Flexera Software\Incoming\Inventories folder on the FlexNet Manager Suite server.

Uninstalling the Agent

You can easily uninstall the stand-alone VMware inventory tool by deleting the following folders:

  • Deployment folder (VMwareInventory)
  • Output folder (Inventories)

API Calls for VMware Inventory Collection

The stand-alone VMware inventory agent connects to the VMware SDK URL (https://<servername>/sdk) on each target VMware server. This connection requires an account with read access to the SDK URL.

The agent makes the following API calls through the SDK once a connection is established with the target VMware server:

API name Description
GetServiceContent A single call is made to this API to retrieve the ServiceInstance to enable further queries.
RetrieveProperties: Host Information A single call is made against the root folder to return information about each host server with the following attributes:
  • ComputeResource.host
  • ClusterComputeResource.host
  • Datacenter.hostFolder
  • Datacenter.vmFolder
  • Folder.childEntity
RetrieveProperties: VM Information A call is made against each returned HostSystem to obtain the following attributes for each virtual machine that exists on the host:
  • HostSystem.parent
  • ComputeResource.resourcePool
  • ResourcePool.resourcePool
  • ResourcePool.vm
Was this article helpful? Yes No
100% helpful (7/7)
Comments
pavol_holes
By
Level 6

Where can I download the mentioned zip archive of stand-alone VMware inventory agent ?

Thanks.

Pavol

jonathanl
By
Level 2

Hi.

It is part of the Additional Inventory Tools for FlexNet Manager Suite bundle.

pavol_holes
By
Level 6

Hi @jonathanl,

thanks for reply, I just checked Flexera Product and License center > FlexNet Manager Suite 2018 R2 and also 2019 R1 and I can't find there "Additional Inventory Tools" bundle. Can you please more specific?

Thanks.

Pavol

kstaude
By
Level 4

Any chance this can be made into a standalone "application" which you can input the variables, schedule as a service, and upload to a beacon? Seems like an overly complex setup for a simple task that happens for many customer environments.

jonathanl
By
Level 2

Hi Pavol.

I cannot find the package on the site any longer. I have a copy of it if you give me your email address. Otherwise I guess you could ask Support.

dswann
By
Flexera Alumni

Attachment added. Our apologies that it was missing.

pavol_holes
By
Level 6

Thanks @dswann for attachment 🙂

Pavol

rwiltshire
By
Level 6

Hi All,

 

I get errors running the lite collection against some of our VMware Virtual centers. The Virtual Centers with issues appear to be using SSO.

I can manually log into the VC with the specified account but esxquery.exe shows the below error:

 

BindServer(<server ip>, proto=https, port=0) failed.

 

Anyone else have these issues?

mag00_75
By Level 8 Champion
Level 8 Champion

Hi

Anyone know if their are any possibility for verbose logging for the esxquery.exe?
I'm trying to figure out the reasons why I get Login Failed since it's working interactively.

Are the tool supported on never version of Microsoft Windows, I'm trying to run it on Windows Server 2019? Have anyone succeeded to run it in an ordinary shell not administrative shell?

 

Ralph_Crowley
By
Level 6

Same issue as @rwiltshire  - BindServer(<server ip>, proto=https, port=0) failed.

 

craig_moore
By
Level 6

We are getting the following message and error when we try run esxquery -a 

buf-vCenter: found VMWare vCenter Server v6.7.0

GenerateInventory(C:\_trunk\vCenter\Inventory) failed for server buf-vcenter
 
Any ideas?
stefange
By
Level 6

Hi,

If you have a beacon installed you can enable normal tracing for esxquery which will hopefully give extra information. (C:\Program Files (x86)\Flexera Software\Inventory Beacon\etdp.trace). You should enable the Inventory/VMware section followed the the normal esxquery -a.

@craig_mooreDid you execute the CMD as admin and can you try a different path without the underscore as it looks like everything is working but you cannot write your inventory.

I often came across issue with the local proxy settings which result in errors in the esxquery. you may check the proxy settings by running "netsh winhttp show proxy"

Stefan

 

Stefan

kevin_christens
By
Level 7

We find that each host NDI file from ESXQuery contain the vCenter and it's IP, guests of the ESX host and their IPs, but does not contain the IP of the ESX host itself. How do we get the IP of the ESX Host as part of the ESXQuery or is the IP supposed to come from some other source.  The ESX hosts are not able to have an agent installed.

jasonlu
By Level 7 Champion
Level 7 Champion

I've been in a similar position.

What I ended up doing is creating a spreadsheet adapter with the ip address of the hosts. That inventory plus the rule inventory merges.

 

Years ago, I dived into the Vmware API and found that the IP address is in fact in there, the rule just doesn't pull back the ip address for certain implementations of ESX. I think its found in a different spot.

I did do an enhancement request (prior to the Ideas section being implemented) but it never went anywhere.

j

 

 

anhpham1652
By
Level 7

Hello,

I tried to run esxquery from beacon (open port 443 to VMWare ESXi host) but it failed (BindServer proto: https, port=0 failed). But from the laptop of administrator, it ran successfully.

Are there other requirements for machine running the esxquery command beside those in the post?

durgeshsingh
By
Level 10

Hi

Please share steps performed by you. Hope, you have made environment variable settings in Path.

kclausen
By
Flexera Alumni

The "Stand Alone" ESXQUERY utility is designed to be a stand-alone utility.  It is not meant to be installed on an existing Beacon Server.  As you have noticed, you did have success when it was installed on its own computer without any other FNMS Components.

You would normally use ESXQUERY to access a vCenter that cannot be reached from a Beacon Server.

anhpham1652
By
Level 7

Hello,

I want to install ESXQUERY on beacon server because I will edit the OUTPUTDIR to ...\Incoming\Inventories on it, then inventories can be uploaded automatically to show on FNMS portal.

I did exactly the guide. In my lab environment (no network rule) it was working normally, but on customer's, I just open port 443 and it didn't work.

kclausen
By
Flexera Alumni

@anhpham1652 - It sounds like you will need to troubleshoot with the customer's Network Team to see what may be blocking the 443 traffic.

Can I ask why you are using the ESXQUERY tool and not the built-in vCenter task within the Beacon itself where you can set up a Schedule for the task to run automatically?

durgeshsingh
By
Level 10

Hi,

 

You need to  create Target for all vcenter for your environment to get VM host details. Post Target creation, Assign subnet to respective Beacon. In Beacon under password management tab, Enter vcenter credential over there. 

 

Once all config done, then you can run the created rule for vcenter & check in logs if any error occured.

anhpham1652
By
Level 7

Hello,

I tried but no VMWare virtual servers discovered (in System task after completing the rule). I also try to check as this link https://community.flexera.com/t5/FlexNet-Manager-Knowledge-Base/Failure-to-run-discovery-on-VMware-vCenter-Host-Servers-in/ta-p/2011 :

https://IPAddress:PortNumber/sdk/vimService.wsdl and got the xml page

https://https://IPAddress:PortNumber/mob  and got 503 service unavailable (failed to connect to endpoint... vmware/proxy-mob)

But on the lab environment (which has no firewall rule, it got the same result as accessing these links) but the vmware esx was inventoried successfully as well as esxquery.

DiannaB
By
Level 6

@anhpham1652 what's in the Discovery.log and VMWareInventory.log on the beacon in C:\ProgramData\Flexera Software\Compliance\Logging\InventoryRule\x?  In the discovery log you want to see this: "Device 'xxxxxxxxxx' is in scope: Known vCenter or OVM Manager servers-<rule name>

Did it produce a VMWareInventory log?  If so, what are the messages?

anhpham1652
By
Level 7

Hello DiannaB,

Discovery.log says "Complete VMWare discovery for device 'IP Address': not found"

VMWareInventory.log "Discovery did not find the service on the device"

DiannaB
By
Level 6

@anhpham1652 it sounds like the beacon isn't reaching the IP.  We had a similar situation even though we had the firewall opened.  In the end, the only way we solved this was to install a beacon on a VM in that vCenter itself, and run the discovery rule from that beacon (by assigning the subnet to that beacon).  

Woo_Lam
By
Level 5

Can I put OutputDir=.\Inventories under each server section? e.g.

[Global]

TimeOut=300

[1.1.11.1:19445]
OutputDir=C:\Support\TEMP_INVENTORIES\TEMP1
Username=svc_user
Password=!A1uwcTYyZq0jfOmzcOteVSCg==

[2.2.2.2:19443]
OutputDir=C:\Support\TEMP_INVENTORIES\TEMP2
Username=svc_user
Password=!A1uwcTYyZq0jfOmzcOteVSCg==

[3.3.3.3:19446]
OutputDir=C:\Support\TEMP_INVENTORIES\TEMP3
Username=svc_user
Password=!A1uwcTYyZq0jfOmzcOteVSCg==

Woo_Lam
By
Level 5

Also, if all vCenter servers are using same username and password, can I put the username and password in [Global] section?

staudk27
By
Level 2

Any chance of this getting combined into the Flexera Beacon GUI? This would save a good amount of time rather than having to rely on the process within the Web Interface. (Subnets/Rules/Targets/Schedules across all of the beacons and timing/waiting).

Version history
Last update:
‎Nov 08, 2023 06:25 PM
Updated by: