Fixing Errors When Trying to Configure SNMP on ESXi

One of the tasts I am working on is the configuration of our fleet of Dell servers to use Dell’s Open Manage Essentials monitoring and management platform. One of the servers however had been unwilling to have it’s SNMP configuration changed using the VSphere CLI tools and was generating the following error:

Changing notification(trap) targets list to: myserver.local@162/DELLOME…
Use of uninitialized value $sub in string eq at C:/Program Files (x86)/VMware/VMware vSphere CLI/Perl/lib/VMware/ line 81.
Use of uninitialized value $package in concatenation (.) or string at C:/Program Files (x86)/VMware/VMware vSphere CLI/Perl/lib/VMware/ l
ine 50.
Undefined subroutine &Can’t call method “ReconfigureSnmpAgent” on an undefined value at C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\vicfg-snm line 297.
::fault_string called at C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\ line 299.

Hrm OK fine. Lets try logging in to the Host’s ESX Shell and use esxcli to set the trap:

Community string was not specified in trap target: myserver.local

Clearly something is broken with the SNMP configuration. Luckily the VMware forums were quick to supply a solution.

The SNMP settings for ESX are stored in the XML file /etc/vmware/snmp.xml. You can either clear this file (cat /dev/null > /etc/vmware/snmp.xml) or if you know what the setting should be, modify it. in my case I needed to update the <targets></targets> XML Tag to have a community string:

<targets>myserver.local@162 DELLOME</targets>