Enabling SNMP on VMware ESXi

I always struggle to remember the steps to enable SNMP on ESXi hosts so this post can not help me, but might be useful to others.

How to enable SNMP on ESXi 5.5

  1. Ensure that SSH is enabled on your host(s)
  2. SSH to your host using the root credentials
  3. Once connected run the following commands which will set the community string (as specified by COMMUNITY-STRING, enable SNMP, update the host firewall rules, and finally restart the SNMP service

esxcli system snmp set --communities COMMUNITY-STRING
esxcli system snmp set --enable true
esxcli network firewall ruleset set --ruleset-id snmp --allowed-all true
esxcli network firewall ruleset set --ruleset-id snmp --enabled true
/etc/init.d/snmpd restart

How to enable SNMP on ESXi 6.0

  1. Ensure that SSH is enabled on your host(s)
  2. SSH to your host using the root credentials
  3. Once connected run the following commands which will first reset the SNMP configuration. set the community string (as specified by COMMUNITY-STRING, set the SNMP port number, set the SNMP location information, set the SNMP contact information and finally enable SNMP

esxcli system snmp set -r
esxcli system snmp set -c COMMUNITY-STRING
esxcli system snmp set -p 161
esxcli system snmp set -L "Location (City, State, Country)"
esxcli system snmp set -C email@domain.com
esxcli system snmp set -e yes

Dell OpenManage Live CD

I have been running a PowerEdge 6650 with VMWare ESXi 3.5 Update 4 with no issues as a lab server. I recently purchased a DRAC III card (on eBay) to allow for easy remote shutdown and power on. I quickly discovered that this card wasn’t accessible using the default username/password combination. After doing some web research I found that Dell distributes an incredibly handy live CD running Knoppix and includes OpenManage pre-configured. It can be downloaded from here:

http://linux.dell.com/files/openmanage-contributions/omsa-knoppix/

The beauty part is once it’s installed all you have to do is browse to https://localhost:1311 and provide the username/password combination of root/omsa

SSH access to VMWare ESXi

1. Access the ESXi console and press alt+F1
2. Type unsupported
3. Enter the root password(There is no prompt, input is blind)
4. At the prompt type “vi /etc/inetd.conf”
5. Find the line that starts with “ssh”
6. Remove the “#” (press the “x” if the cursor is on the character)
7. Save “/etc/inetd.conf” by typing “:wq!”
8. Restart the management service “/sbin/services.sh restart”

I had to restart the server in my testing, but restarting the service should work too.