ESXi doesn’t include a lot of the management functions that the licensed product carries (see my previous post on doing backups in ESXi) but most of those functions are already installed, just disabled. Here is how to enable SNMP queries and traps on an ESXi server.
- Enable ssh on your server
- I’m assuming you have already licensed your server, we’re going to need to back that out so ssh to the server as root
- run the following commands
mv /etc/vmware/vmware.lic /etc/vmware/vmware.lic.orig
mv /etc/vmware/license.cfg /etc/vmware/license.cfg.orig
services.sh restart
- That will temporarily put you back into an eval license, you will be disconnected from your vsphere client while the services restart
- Now you need access to the ESX remote command line. You can do that by either downloading and installing the appliance or you can install it locally on your machine.
- Configure SNMP for your environment. -c is the snmp community you want to set for queries and -t is the trap destination
vicfg-snmp.pl –server 192.168.1.1 -c public -t 192.168.1.2@162/public
- enable snmp
vicfg-snmp.pl –server 192.168.1.1 -E
- Test your new snmp config
vicfg-snmp –server 192.168.1.1 -T
- and lastly, download the snmp MIBs for your management platform
- Now move your license keys back
mv /etc/vmware/vmware.lic.orig /etc/vmware/vmware.lic
mv /etc/vmware/license.cfg.orig /etc/vmware/license.cfg
services.sh restart
And that's it, you have snmp queries and traps on your ESXi server now.