Problem:
To generate virtual machine and environmental traps from ESX 3.5 and ESX 4.0 hosts, you must configure and enable the embedded SNMP agent. You cannot use the Net-SNMP-based agent to generate these traps, although it can receive GET transactions and generate other types of traps.
Solution:
To enable SNMP on ESX Server version 3.5:
1. Login as root
2. Edit the snmpd.conf file and add “rocommunity xxxx” where xxxx is your read-only community string). The file is usually located in /etc/snmpd.
3. While you’re editing the snmpd.conf file, also add “dlmod SNMPESX /usr/lib/vmware/snmp/libSNMPESX.so”
4. 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:
Login as root and issue the following commands:
2. esxcfg-firewall -e snmpd
3. chkconfig snmpd on
4. service snmpd start
To monitor your ESX 3.5 server by using SNMP, we need to enable SNMP on ESX before adding it to your monitoring software. This How-To will show you the steps involved.
or
Log Into ESX Server
Log into your ESX Server either through SSH or through the console of the server.
Use Nano to Edit Snmpd.conf
Use Nano (which is a notepad like text editor) to edit the file /etc/snmp/snmpd.conf file by using the command:
nano /etc/snmp/snmpd.conf
Add SNMP Community to Config File
Use the arrow keys to go down to the section “rocommunity public”. Replace “public” with your community string for your environment (1). Then use “Ctrl+X” to exit out of Nano. You’ll be asked if you would like to save. Type in “y” for yes and hit enter. Press enter again when confirming the filename to save as.
Enable SNMP to Start Automatically After a Reboot
Since SNMP is not started by default, you’ll need to type in this command to ensure it will be started after a reboot of the ESX server. The command is:
chkconfig snmpd on
Enable SNMP Through the ESX Firewall
We’ll need to allow SNMP traffic through the built-in ESX firewall. To do this, type in the following command:
esxcfg-firewall -e snmpd
Start the SNMP Service
Now we’re ready to start the SNMP service. Type in:
service snmpd start
