Knowledge Base > PacketTrap IT (Perspective) > How can I enable SNMP on my VM Ware ESX server?
 
PacketTrap MSP
PacketTrap IT (Perspective)
pt360 Tool Suite
 

How can I enable SNMP on my VM Ware ESX server?

Applies to: PacketTrap Perspective

How can I enable SNMP on my VM Ware ESX server?

ESX4.0 Vmware sphere 4.0 admin guide
ESX/ESXi includes an SNMP agent embedded in hostd that can both send traps and receive polling requests such as GET requests. This agent is referred to as the embedded SNMP agent. Versions of ESX prior to ESX 4.0 included a Net-SNMP-based agent. You can continue to use this Net-SNMPbased agent in ESX 4.0 with MIBs supplied by your hardware vendor and other third-party management applications. However, to use the VMware MIB files, you must use the embedded SNMP agent. By default, the embedded SNMP agent is disabled. To enable it, you must configure it using the vSphere CLI command vicfg-snmp. For a complete reference to vicfg-snmp options, see vSphere Command-Line Interface Installation and Reference Guide. Prerequisites SNMP configuration for ESX/ESXi requires the vSphere CLI. Installing vSphere CLI and Running Commands on Windows The vSphere CLI installation package for Windows includes the ActivePerl runtime from ActiveState Software and required Perl modules and libraries. The vSphere CLI is supported on the following Windows platforms: - Windows XP SP2 32 bit - Windows XP SP2 64 bit - Windows Vista Enterprise SP1 32 bit - Windows Vista Enterprise SP1 64 bit

To install the vSphere CLI Package on Windows

1) Download the vSphere CLI Windows installer package. You can find the installer in the Drivers and Tools tab of the vSphere 4.0 download page.

2) Start the installer.

3) (Optional) If prompted to remove older versions of vSphere SDK for Perl or vSphere CLI, you can either accept the offer or install the package on a different system.

4) Click Next in the Welcome page to continue.

5) If you do want to install the vSphere CLI in a non‐default directory, click Change and select the directory. The default location is C:\Program Files\VMware\VMware vSphere CLI.

6) Click Next to continue.

7) Click Install to proceed with the installation. The installation might take several minutes to complete. After you install the vSphere CLI, you can run commands from the Windows command prompt or include them in scripts.

To run a vSphere CLI command on Windows

1) Open a command prompt.

2) Navigate to the directory in which the vSphere CLI is installed. cd C:\Program Files\VMware\VMware vSphere CLI\bin

3) Run the command, passing in the connection options and any other options..pl The extension .pl is required for most commands, but not for esxcli. Example:

vicfg-nas.pl --server my_vcserver --username: u42 --password: mypwd --vihost my_esxhost --list

Configure SNMP Communities & Enabling the SNMP agent Before you enable the ESX/ESXi embedded SNMP agent, you must configure at least one community for the agent. An SNMP community defines a group of devices and management systems. Only devices and management systems that are members of the same community can exchange SNMP messages. A device or management system can be a member of multiple communities.
Procedure

1) From the vSphere CLI, type:

vicfg-snmp.pl --server --username --password -c

Replace with the community name you wish to set. Each time you specify a community with this command, the setings you specify overwrite the previous configuration. To specify multiple communities, separate the community names with a comma.

For example, to set the communities public and internal on the host host.example.com, you might type:

vicfg-snmp.pl --server host.example.com --username user --password password -c public, internal.

Test Type:

vicfg-snmp.pl --server --username --password --show

to display the current configuration of the embedded SNMP agent. 


ESX 3.5
SNMP is already pre-installed by VMware. It is just a matter of editing the default config file and starting the service. You also need to allow it through the iptables firewall (if you’re running that) with these steps:

Edit the snmpd.conf file and add "rocommunity abcd" where abcd is your read-only community string). The file is usually located in /etc/snmpd.
While you're editing the snmpd.conf file, also add "dlmod SNMPESX /usr/lib/vmware/snmp/libSNMPESX.so"

Restart the SNMP daemon - /etc/init.d/snmpd restart

In some cases, you may also need to edit the firewall settings on the ESX server to allow the SNMP traffic through. To do this:

esxcfg-firewall -e snmpd

chkconfig snmpd on

service snmpd start