Here’s a quick and easy way to configure SNMP on your ESXi Servers, which is done by editing the snmp.xml file.
In this tutorial: ESXi Version 4.0
- SSH into your ESXi Host
- Use this command to browse to the right directory: cd /etc/vmware
- Use this command to open the snmp.xml file: vi snmp.xml
- If you haven’t used vi before, you only need to know the following keystrokes and commands: INSERT, ESC, and :wq!Here’s the default xml file:
- In vi, you can move your cursor using the arrow keys. Hit INSERT when are ready to edit. Once you do, only type what you want to type. If you need to back out of editing, hit the ESC key and you’ll be able to move your cursor around again without editing the file. It can be tricky until you get used to it.
- You’re going to want to change the line to the following:<config><snmpSettings><enable>true</enable><communities>customstring</communities><targets></targets></snmpSettings></config>
- To write to the file, hit ESC, then hit :. Using the colon allows you to execute commands in vi. You want to write and quit and not overwrite. The command for that is wq!
- Hit enter. Make sure you’re out of vi and back at your ESXi console.
- Restart services by entering the following command: services.sh restart
- Done!
The communities tag will hold the community string you’l use when you configure your monitoring software. Make sure it’s not “public” since public is typically what the default will be with all SNMP available devices. Let me know if this works for you on other versions of ESXi. Cheers!
Recent Activity