How can I populate the Virtual Machines inventory from my VMWare ESXi hosts?

Article ID: 269
Category: Monitoring
Applies to: 3.1 and newer
Updated: 2018-02-27

EventSentry requires that SNMP is enabled on the VMWare ESXi hosts in order to pull the virtual machine inventory. IMPORTANT: You must enable SNMP on the actual ESXi hosts, it does not help inventory the devices if SNMP is only enabled on the VCSA server that is used to manage the ESXi hosts.

Method A: If you are connected directly to the ESXI shell, via SSH for example, you can execute these commands manually:

esxcli system snmp set --communities yourcommunityname
esxcli system snmp set --enable true
esxcli.exe system snmp get

Please replace "yourcommunityname" with the name of the community you wish to enable and use for monitoring this host in EventSentry.

Method B: Using the vSphere Command-Line Interface, you can execute the following commands.

"C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\esxcli.exe" -s %1 -u root -p %2 system snmp set --communities %3
"C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\esxcli.exe" -s %1 -u root -p %2 system snmp set --enable true
"C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\esxcli.exe" -s %1 -u root -p %2 system snmp get

In this example %1 is the hostname of the VMWare ESXi host, and %2 is the password of the ESXi root account, and %3 is the SNMP community name to enable. You can also log in with an account other than the root account.

Did your commands specify an SNMP community name other than "public"? If so, you'll need to use Set Authentication to configure the matching SNMP community name that EventSentry should use when checking your ESXi hosts:
https://www.eventsentry.com/documentation/help/html/?remoteupdateauthentication.htm
Please save your changes and restart the "EventSentry Heartbeat Monitor" service after creating the new SNMP authentication in EventSentry.

Optional: Send Traps to EventSentry
To configure the VMWare host to send traps to EventSentry (or another SNMP management station), run this command through the ESXi shell:
esxcli system snmp set --targets destinationIP@162/yourcommunityname
Please replace "destinationIP" with the name or IP of the EventSentry server, and replace "yourcommunityname" with the community name that should be used to send traps.

If you're using the vSphere CLI instead, run this command:

"C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\esxcli.exe" -s %1 -u root -p %2 system snmp set --targets destinationIP@162/%3
Please replace "destinationIP" with the name or IP of the EventSentry serve; in this example %1 is the hostname of the VMWare ESXi host, and %2 is the password of the ESXi root account, and %3 is the SNMP community name to be used for sending traps.

Did your commands specify an SNMP community name other than "public"? If so, you'll need to configure the matching SNMP community name that EventSentry should accept when receiving traps:
https://www.eventsentry.com/documentation/help/html/?snmpmibscommunitiesusers.htm
If this is your first time setting up SNMP traps in EventSentry, please also review the Traps-to-Database settings and Traps-to-EventLog settings in the tabs of the SNMP Trap settings.