×


Set up SNMP VMWare ESXi 5 5

Are you trying to set up SNMP VMWare ESXi 5.5?

This guide is for you.

SNMP is not enabled by default on ESXi VMWARE server so you need to enable and configure it before start service snmp on vsphere.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to fix VMWare related errors.
In this context, we shall look into the steps to configure SNMP VMWare.

More information about SNMP Server in VMWare ESXi?

From the vSphere web interface, we can make sure that the "SNMP server" service is running.
You can change its startup settings or stop/start the service.
Start by navigating to "ESXi host >> Configure >> Services >> SNMP Server". The service is stopped by default. So you need to start it.

How to set up SNMP Agent Parameters in ESXi?

In order to monitor the state of VMWare ESXi servers in the monitoring system, we must configure the SNMP agents on hosts.

The following steps will help you to configure SNMP Agent parameters.
Start by specifying the monitoring server IP address (SNMP target). Then the port (by default, 161 UDP) and SNMP community name (usually, public):

esxcli system snmp set –targets=192.168.88.88@161/public

Or we set the community name as follows:

esxcli system snmp set –communities YOUR_COMMUNITY_STRING

Additionally, we specify the location:

esxcli system snmp set –syslocation “Atlee 18, Mun, DE”

Contact information:

esxcli system snmp set --syscontact admin@ibmimedia.com

Then we enable SNMP service on the ESXi host:

esxcli system snmp set --enable true

Then to test the SNMP configuration, we run the below command.

esxcli system snmp test

To apply the settings, we restart the SNMP agent with the following command;

/etc/init.d/snmpd restart

To reset current settings, we use the below command.

esxcli system snmp set –r

Then to disable SNMP, we use the below command:

esxcli system snmp set --disable true


ESXi Firewall Configuration for SNMP Traffic

We follow SNMP traffic in the ESXi host firewall in two ways. To allow SNMP requests from any device on the network:

esxcli network firewall ruleset set --ruleset-id snmp --allowed-all true
esxcli network firewall ruleset set --ruleset-id snmp --enabled true


Or we can allow inbound traffic from an IP address of our monitoring server or an IP subnet where our SNMP servers are located:

esxcli network firewall ruleset set --ruleset-id snmp --allowed-all false
esxcli network firewall ruleset allowedip add --ruleset-id snmp --ip-address 192.168.100.0/24
esxcli network firewall ruleset set --ruleset-id snmp --enabled true

Now we can monitor your VMWare ESXi hosts over SNMP.


Change SNMP Settings on ESXi Host Using PowerCLI

If we want to quickly configure SNMP parameters on multiple ESXi hosts, we use this PowerCLI script:

$ESXi = 'mun-esxi01'
$Community = 'Public'
$Target = '192.168.88.88'
$Port = '161'


#Connection to an ESXi host
Connect-VIServer -Server $sESXiHost
#Clearing the current SNMP settings
Get-VMHostSnmp | Set-VMHostSnmp -ReadonlyCommunity @()
#Configure SNMP parameters
Get-VMHostSnmp | Set-VMHostSnmp -Enabled:$true -AddTarget -TargetCommunity $Community -TargetHost $Target -TargetPort $Port -ReadOnlyCommunity $Community
#Display the current SNMP parameters
$Cmd= Get-EsxCli -VMHost $ESXiHost
$Cmd.System.Snmp.Get()


VMWare ESXi SNMPv3 Configuration

In the above steps, you learnt how to enable and configure an SNMP agent v1 and v2 on ESXi hosts. Starting from ESXi 5.1, a more modern protocol version is used: SNMP v3. We use the following commands to configure a more secure SNMPv3.
We set authentication and encryption protocols by running the below command;

esxcli system snmp set -a MD5 -x AES128

Here is the command that generates hashes for the authentication and encryption passwords (replace authpass and privhash with your password):

esxcli system snmp hash --auth-hash authpass --priv-hash privhash --raw-secret

Using the hashes (authhash and privhash), we add a user.

esxcli system snmp set -e yes -C snmp@ibmimedia.com -u snmpuser/authhash/privhash/priv

Then we specify the SNMP target address as below.

esxcli system snmp set –v3targets 192.168.88.88@161/user/priv/trap

Remotely we check the SNMP configuration using the Linux snmpwalk tool:

snmpwalk -v3 -u snmpuser -l AuthPriv -a SHA -A P@ssw0rd1 -x AES-X P@ssw0rd 192.168.1.121


[Need additional support in fixing VMWare errors? – We are available to help you today.]


Conclusion

This article will guide you on the steps to follow to configure SNMP VMWare ESXi 5.5.