How to Configure SNMP on ESX 5.x and 6.x

Looking at a ESX SSH CLI prompt can be a bit daunting for us folk who grew up with “Windows GUI’s”. One problem that I’ve often ran into in ESX monitoring from Third party utilities, is that the documentation and even terminology can be a bit confusing.

This is a simple straightforward way of configuring SNMP and trap forwarding to a Third Party monitoring utility.

Enable SSH in the ESX Host

  • In Vcenter, select your host. 
  • Once the host is selected, click on the Configure tab
  • Click Security Profile on the left menu
  • Scroll down to Services and click Edit

2019-04-12 00_36_23-vSphere Web Client

SNMP Configuration:

  1. First check if SNMP is already configured:
    #esxcli system snmp get

    2019-04-12 00_50_31-How To_ Configure SNMP on ESX - OneNote
  2. If SNMP is not configured most settings will show blank. We will start  by setting the community name (in this example we use public).
    Note: SNMP community strings are case sensitive 
    #  esxcli system snmp set -c public
  3. Configure the SNMP Agent to Send SNMP v1 or v2c Traps to your monitoring agent’s host IP using the following command:  esxcli system snmp set –targets target_address@port/community.
    Note: SNMP traps by default are sent on port 162
  4. # esxcli system snmp set -t 10.0.157.180@162/public
  5. Enable the SNMP service on the ESX host
    # esxcli system snmp set --enable true
  6. Verify SNMP is configured correctly via the GET command
    # esxcli system snmp get
    2019-04-12 00_54_13-How To_ Configure SNMP on ESX - OneNote
  7. Finally, end a test trap from your ESX host to the monitoring agent host
    #  esxcli system snmp test

    2019-04-12 00_56_01-How To_ Configure SNMP on ESX - OneNote

At this point, you should be able to go to your monitoring agent software and check that the test trap is received. 

Our next article will show how to configure and test a SNMPv3 trap. Stay tuned!

Reference: https://pubs.vmware.com/vsphere-55/index.jsp#com.vmware.vsphere.monitoring.doc/GUID-EA64297A-35FD-4226-A1B2-367C57D38CBD.html

Leave a Reply